From 93a5fdd8f35b0e9fa55b05bc06b8a45b38ae0093 Mon Sep 17 00:00:00 2001 From: terence Date: Mon, 12 May 2025 06:25:26 -0700 Subject: [PATCH] Remove unused variables, functions and more (#15264) --- api/client/event/event_stream.go | 20 +- beacon-chain/core/blocks/payload.go | 14 - beacon-chain/db/kv/error.go | 3 - beacon-chain/rpc/eth/shared/testing/json.go | 384 +------------------- changelog/tt_sandwich.md | 3 + consensus-types/blocks/proofs.go | 40 -- encoding/ssz/htrutils.go | 7 - proto/migration/v1alpha1_to_v1.go | 40 -- proto/prysm/v1alpha1/cloners_test.go | 27 -- runtime/interop/genesis.go | 10 - testing/endtoend/params/params.go | 6 - testing/util/electra.go | 9 - testing/util/state.go | 13 - 13 files changed, 8 insertions(+), 568 deletions(-) create mode 100644 changelog/tt_sandwich.md diff --git a/api/client/event/event_stream.go b/api/client/event/event_stream.go index d5d03b60f9..c8fda249c9 100644 --- a/api/client/event/event_stream.go +++ b/api/client/event/event_stream.go @@ -14,22 +14,10 @@ import ( ) const ( - EventHead = "head" - EventBlock = "block" - EventAttestation = "attestation" - EventVoluntaryExit = "voluntary_exit" - EventBlsToExecutionChange = "bls_to_execution_change" - EventProposerSlashing = "proposer_slashing" - EventAttesterSlashing = "attester_slashing" - EventFinalizedCheckpoint = "finalized_checkpoint" - EventChainReorg = "chain_reorg" - EventContributionAndProof = "contribution_and_proof" - EventLightClientFinalityUpdate = "light_client_finality_update" - EventLightClientOptimisticUpdate = "light_client_optimistic_update" - EventPayloadAttributes = "payload_attributes" - EventBlobSidecar = "blob_sidecar" - EventError = "error" - EventConnectionError = "connection_error" + EventHead = "head" + + EventError = "error" + EventConnectionError = "connection_error" ) var ( diff --git a/beacon-chain/core/blocks/payload.go b/beacon-chain/core/blocks/payload.go index 4c9795261e..70d87f13b1 100644 --- a/beacon-chain/core/blocks/payload.go +++ b/beacon-chain/core/blocks/payload.go @@ -12,7 +12,6 @@ import ( "github.com/OffchainLabs/prysm/v6/consensus-types/blocks" "github.com/OffchainLabs/prysm/v6/consensus-types/interfaces" "github.com/OffchainLabs/prysm/v6/consensus-types/primitives" - "github.com/OffchainLabs/prysm/v6/encoding/bytesutil" "github.com/OffchainLabs/prysm/v6/runtime/version" "github.com/OffchainLabs/prysm/v6/time/slots" "github.com/pkg/errors" @@ -240,16 +239,3 @@ func verifyBlobCommitmentCount(slot primitives.Slot, body interfaces.ReadOnlyBea } return nil } - -// GetBlockPayloadHash returns the hash of the execution payload of the block -func GetBlockPayloadHash(blk interfaces.ReadOnlyBeaconBlock) ([32]byte, error) { - var payloadHash [32]byte - if IsPreBellatrixVersion(blk.Version()) { - return payloadHash, nil - } - payload, err := blk.Body().Execution() - if err != nil { - return payloadHash, err - } - return bytesutil.ToBytes32(payload.BlockHash()), nil -} diff --git a/beacon-chain/db/kv/error.go b/beacon-chain/db/kv/error.go index 6d79723cc7..161378efd9 100644 --- a/beacon-chain/db/kv/error.go +++ b/beacon-chain/db/kv/error.go @@ -16,9 +16,6 @@ var ErrNotFoundOriginBlockRoot = errors.Wrap(ErrNotFound, "OriginBlockRoot") // ErrNotFoundGenesisBlockRoot means no genesis block root was found, indicating the db was not initialized with genesis var ErrNotFoundGenesisBlockRoot = errors.Wrap(ErrNotFound, "OriginGenesisRoot") -// ErrNotFoundBackfillBlockRoot is an error specifically for the origin block root getter -var ErrNotFoundBackfillBlockRoot = errors.Wrap(ErrNotFound, "BackfillBlockRoot") - // ErrNotFoundFeeRecipient is a not found error specifically for the fee recipient getter var ErrNotFoundFeeRecipient = errors.Wrap(ErrNotFound, "fee recipient") diff --git a/beacon-chain/rpc/eth/shared/testing/json.go b/beacon-chain/rpc/eth/shared/testing/json.go index 5b70080f53..1e8466dbdf 100644 --- a/beacon-chain/rpc/eth/shared/testing/json.go +++ b/beacon-chain/rpc/eth/shared/testing/json.go @@ -678,187 +678,6 @@ const ( "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }` - // BadBlindedBellatrixBlock contains wrong data to create a block that does not pass ToConsensus conversion - // "parent_root" length too short - // "block_hash" length too short - // "state_root" length too short - BadBlindedBellatrixBlock = `{ - "message": { - "slot": "1", - "proposer_index": "1", - "parent_root": "0xcf8e0d4e95872", - "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "body": { - "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", - "eth1_data": { - "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "deposit_count": "1", - "block_hash": "0xcf8e0d4e95872" - }, - "graffiti": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "proposer_slashings": [ - { - "signed_header_1": { - "message": { - "slot": "1", - "proposer_index": "1", - "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "state_root": "0xcf8e0d4e9580f2", - "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", - "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": "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": "1", - "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "transactions_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" - } - } - }, - "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" -}` CapellaBlock = `{ "message": { "slot": "1", @@ -1056,208 +875,7 @@ const ( }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" }` - // BadCapellaBlock contains wrong data to create a block that does not pass ToConsensus conversion - // "state_root" length too short - // "block_hash" length too short - // "graffiti" length too short - // "state_root" length too short - BadCapellaBlock = `{ - "message": { - "slot": "1", - "proposer_index": "1", - "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "state_root": "0xcf8e0d4e957e8208d920f2", - "body": { - "randao_reveal": "0x1b66ac1fb663c9baf888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", - "eth1_data": { - "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "deposit_count": "1", - "block_hash": "0xcf8e0d4e95873691884560367e8208d920f2" - }, - "graffiti": "0xcf8e0d4e9587369b230120f2", - "proposer_slashings": [ - { - "signed_header_1": { - "message": { - "slot": "1", - "proposer_index": "1", - "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "state_root": "0xcf8e0d4e9587369b2301d208d920f2", - "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", - "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": "0x6451e9f951ebf05edc01de67e593484b672877054f055903ff0df1a1a945cf30ca26bb4d4b154f94a1bc776bcf5d0efb3603e1f9b8ee2499ccdcfe2a18cef458", - "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": "14074904626401341155369551180448584754667373453244490859944217516317499064576", - "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "transactions": [ - "0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86" - ], - "withdrawals": [ - { - "index": "1", - "validator_index": "1", - "address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", - "amount": "1" - } - ] - }, - "bls_to_execution_changes": [ - { - "message": { - "validator_index": "1", - "from_bls_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - "to_execution_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09" - }, - "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" - } - ] - } - }, - "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" -}` + BlindedCapellaBlock = `{ "message": { "slot": "1", diff --git a/changelog/tt_sandwich.md b/changelog/tt_sandwich.md new file mode 100644 index 0000000000..8eb28c6ad8 --- /dev/null +++ b/changelog/tt_sandwich.md @@ -0,0 +1,3 @@ +### Ignored + +- Remove unused. \ No newline at end of file diff --git a/consensus-types/blocks/proofs.go b/consensus-types/blocks/proofs.go index 21806edab8..dffe15695b 100644 --- a/consensus-types/blocks/proofs.go +++ b/consensus-types/blocks/proofs.go @@ -18,7 +18,6 @@ import ( const ( payloadFieldIndex = 9 - bodyFieldIndex = 4 ) func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody) ([][]byte, error) { @@ -196,45 +195,6 @@ func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody) return fieldRoots, nil } -func ComputeBlockFieldRoots(ctx context.Context, block interfaces.ReadOnlyBeaconBlock) ([][]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 - parentRoot := block.ParentRoot() - copy(fieldRoots[2], parentRoot[:]) - - // State Root - stateRoot := block.StateRoot() - copy(fieldRoots[3], 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 interfaces.ReadOnlyBeaconBlock) ([][]byte, error) { i := block.Body() blockBody, ok := i.(*BeaconBlockBody) diff --git a/encoding/ssz/htrutils.go b/encoding/ssz/htrutils.go index 6165d95483..6509f8fb9c 100644 --- a/encoding/ssz/htrutils.go +++ b/encoding/ssz/htrutils.go @@ -153,13 +153,6 @@ 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/migration/v1alpha1_to_v1.go b/proto/migration/v1alpha1_to_v1.go index febdc53ba1..7bb4b5e77a 100644 --- a/proto/migration/v1alpha1_to_v1.go +++ b/proto/migration/v1alpha1_to_v1.go @@ -5,46 +5,6 @@ import ( ethpbalpha "github.com/OffchainLabs/prysm/v6/proto/prysm/v1alpha1" ) -// V1Alpha1SignedHeaderToV1 converts a v1alpha1 signed beacon block header to v1. -func V1Alpha1SignedHeaderToV1(v1alpha1Hdr *ethpbalpha.SignedBeaconBlockHeader) *ethpbv1.SignedBeaconBlockHeader { - if v1alpha1Hdr == nil || v1alpha1Hdr.Header == nil { - return ðpbv1.SignedBeaconBlockHeader{} - } - return ðpbv1.SignedBeaconBlockHeader{ - Message: V1Alpha1HeaderToV1(v1alpha1Hdr.Header), - Signature: v1alpha1Hdr.Signature, - } -} - -// V1Alpha1HeaderToV1 converts a v1alpha1 beacon block header to v1. -func V1Alpha1HeaderToV1(v1alpha1Hdr *ethpbalpha.BeaconBlockHeader) *ethpbv1.BeaconBlockHeader { - if v1alpha1Hdr == nil { - return ðpbv1.BeaconBlockHeader{} - } - - return ðpbv1.BeaconBlockHeader{ - Slot: v1alpha1Hdr.Slot, - ProposerIndex: v1alpha1Hdr.ProposerIndex, - ParentRoot: v1alpha1Hdr.ParentRoot, - StateRoot: v1alpha1Hdr.StateRoot, - BodyRoot: v1alpha1Hdr.BodyRoot, - } -} - -// V1HeaderToV1Alpha1 converts a v1 beacon block header to v1alpha1. -func V1HeaderToV1Alpha1(v1Header *ethpbv1.BeaconBlockHeader) *ethpbalpha.BeaconBlockHeader { - if v1Header == nil { - return ðpbalpha.BeaconBlockHeader{} - } - return ðpbalpha.BeaconBlockHeader{ - Slot: v1Header.Slot, - ProposerIndex: v1Header.ProposerIndex, - ParentRoot: v1Header.ParentRoot, - StateRoot: v1Header.StateRoot, - BodyRoot: v1Header.BodyRoot, - } -} - // V1ValidatorToV1Alpha1 converts a v1 validator to v1alpha1. func V1ValidatorToV1Alpha1(v1Validator *ethpbv1.Validator) *ethpbalpha.Validator { if v1Validator == nil { diff --git a/proto/prysm/v1alpha1/cloners_test.go b/proto/prysm/v1alpha1/cloners_test.go index cab37daf75..b19e9f93bb 100644 --- a/proto/prysm/v1alpha1/cloners_test.go +++ b/proto/prysm/v1alpha1/cloners_test.go @@ -886,25 +886,6 @@ func genPayloadDeneb() *enginev1.ExecutionPayloadDeneb { var genPayloadElectra = genPayloadDeneb -func genPayloadHeader() *enginev1.ExecutionPayloadHeader { - return &enginev1.ExecutionPayloadHeader{ - ParentHash: bytes(32), - FeeRecipient: bytes(32), - StateRoot: bytes(32), - ReceiptsRoot: bytes(32), - LogsBloom: bytes(32), - PrevRandao: bytes(32), - BlockNumber: 1, - GasLimit: 2, - GasUsed: 3, - Timestamp: 4, - ExtraData: bytes(32), - BaseFeePerGas: bytes(32), - BlockHash: bytes(32), - TransactionsRoot: bytes(32), - } -} - func genPayloadHeaderCapella() *enginev1.ExecutionPayloadHeaderCapella { return &enginev1.ExecutionPayloadHeaderCapella{ ParentHash: bytes(32), @@ -949,14 +930,6 @@ func genPayloadHeaderDeneb() *enginev1.ExecutionPayloadHeaderDeneb { var genPayloadHeaderElectra = genPayloadHeaderDeneb -func genWithdrawals(num int) []*enginev1.Withdrawal { - ws := make([]*enginev1.Withdrawal, num) - for i := 0; i < num; i++ { - ws[i] = genWithdrawal() - } - return ws -} - func genWithdrawal() *enginev1.Withdrawal { return &enginev1.Withdrawal{ Index: 123456, diff --git a/runtime/interop/genesis.go b/runtime/interop/genesis.go index c539ce3b2f..78ed84cbb2 100644 --- a/runtime/interop/genesis.go +++ b/runtime/interop/genesis.go @@ -67,16 +67,6 @@ var DefaultDepositContractStorage = map[string]string{ var bigz = big.NewInt(0) var minerBalance = big.NewInt(0) -// DefaultCliqueSigner is the testnet miner (clique signer) address encoded in the special way EIP-225 requires. -// EIP-225 assigns a special meaning to the `extra-data` field in the block header for clique chains. -// In a clique chain, this field contains one secp256k1 "miner" signature. This allows other nodes to -// verify that the block was signed by an authorized signer, in place of the typical PoW verification. -// Clique overloads the meaning of the `miner` and `nonce` fields to implement a voting protocol, whereby additional -// signatures can be added to the list (for details see `Repurposing header fields for signing and voting` in EIP-225). -// https://eips.ethereum.org/EIPS/eip-225 -// The following value is for the key used by the e2e test "miner" node. -const DefaultCliqueSigner = "0x0000000000000000000000000000000000000000000000000000000000000000878705ba3f8bc32fcf7f4caa1a35e72af65cf7660000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - // GethShanghaiTime calculates the absolute time of the shanghai (aka capella) fork block // by adding the relative time of the capella the fork epoch to the given genesis timestamp. func GethShanghaiTime(genesisTime uint64, cfg *clparams.BeaconChainConfig) *uint64 { diff --git a/testing/endtoend/params/params.go b/testing/endtoend/params/params.go index 81a2bcfadb..e1261aa7a3 100644 --- a/testing/endtoend/params/params.go +++ b/testing/endtoend/params/params.go @@ -126,12 +126,6 @@ var PostElectraDepositCount = uint64(32) // PregenesisExecCreds is the number of withdrawal credentials of genesis validators which use an execution address. var PregenesisExecCreds = uint64(8) -// NumOfExecEngineTxs is the number of transaction sent to the execution engine. -var NumOfExecEngineTxs = uint64(200) - -// ExpectedExecEngineTxsThreshold is the portion of execution engine transactions we expect to find in blocks. -var ExpectedExecEngineTxsThreshold = 0.5 - // Base port values. const ( portSpan = 50 diff --git a/testing/util/electra.go b/testing/util/electra.go index c344e5438f..dbe8f35330 100644 --- a/testing/util/electra.go +++ b/testing/util/electra.go @@ -33,15 +33,6 @@ type electraBlockGenerator struct { payload *enginev1.ExecutionPayloadDeneb } -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.ExecutionPayloadDeneb) ElectraBlockGeneratorOption { return func(g *electraBlockGenerator) { g.payload = p diff --git a/testing/util/state.go b/testing/util/state.go index cc643ff802..5e37e456d5 100644 --- a/testing/util/state.go +++ b/testing/util/state.go @@ -71,19 +71,6 @@ func FillRootsNaturalOptCapella(state *ethpb.BeaconStateCapella) error { return nil } -// FillRootsNaturalOptDeneb is meant to be used as an option when calling NewBeaconStateDeneb. -// It fills state and block roots with hex representations of natural numbers starting with 0. -// Example: 16 becomes 0x00...0f. -func FillRootsNaturalOptDeneb(state *ethpb.BeaconStateDeneb) error { - roots, err := PrepareRoots(int(params.BeaconConfig().SlotsPerHistoricalRoot)) - if err != nil { - return err - } - state.StateRoots = roots - state.BlockRoots = roots - return nil -} - type NewBeaconStateOption func(state *ethpb.BeaconState) error // NewBeaconState creates a beacon state with minimum marshalable fields.