mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Remove unused variables, functions and more (#15264)
This commit is contained in:
@@ -14,22 +14,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
EventHead = "head"
|
EventHead = "head"
|
||||||
EventBlock = "block"
|
|
||||||
EventAttestation = "attestation"
|
EventError = "error"
|
||||||
EventVoluntaryExit = "voluntary_exit"
|
EventConnectionError = "connection_error"
|
||||||
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"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import (
|
|||||||
"github.com/OffchainLabs/prysm/v6/consensus-types/blocks"
|
"github.com/OffchainLabs/prysm/v6/consensus-types/blocks"
|
||||||
"github.com/OffchainLabs/prysm/v6/consensus-types/interfaces"
|
"github.com/OffchainLabs/prysm/v6/consensus-types/interfaces"
|
||||||
"github.com/OffchainLabs/prysm/v6/consensus-types/primitives"
|
"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/runtime/version"
|
||||||
"github.com/OffchainLabs/prysm/v6/time/slots"
|
"github.com/OffchainLabs/prysm/v6/time/slots"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
@@ -240,16 +239,3 @@ func verifyBlobCommitmentCount(slot primitives.Slot, body interfaces.ReadOnlyBea
|
|||||||
}
|
}
|
||||||
return nil
|
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
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -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
|
// ErrNotFoundGenesisBlockRoot means no genesis block root was found, indicating the db was not initialized with genesis
|
||||||
var ErrNotFoundGenesisBlockRoot = errors.Wrap(ErrNotFound, "OriginGenesisRoot")
|
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
|
// ErrNotFoundFeeRecipient is a not found error specifically for the fee recipient getter
|
||||||
var ErrNotFoundFeeRecipient = errors.Wrap(ErrNotFound, "fee recipient")
|
var ErrNotFoundFeeRecipient = errors.Wrap(ErrNotFound, "fee recipient")
|
||||||
|
|
||||||
|
|||||||
@@ -678,187 +678,6 @@ const (
|
|||||||
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
|
"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 = `{
|
CapellaBlock = `{
|
||||||
"message": {
|
"message": {
|
||||||
"slot": "1",
|
"slot": "1",
|
||||||
@@ -1056,208 +875,7 @@ const (
|
|||||||
},
|
},
|
||||||
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
|
"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 = `{
|
BlindedCapellaBlock = `{
|
||||||
"message": {
|
"message": {
|
||||||
"slot": "1",
|
"slot": "1",
|
||||||
|
|||||||
3
changelog/tt_sandwich.md
Normal file
3
changelog/tt_sandwich.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
### Ignored
|
||||||
|
|
||||||
|
- Remove unused.
|
||||||
@@ -18,7 +18,6 @@ import (
|
|||||||
|
|
||||||
const (
|
const (
|
||||||
payloadFieldIndex = 9
|
payloadFieldIndex = 9
|
||||||
bodyFieldIndex = 4
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody) ([][]byte, error) {
|
func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody) ([][]byte, error) {
|
||||||
@@ -196,45 +195,6 @@ func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody)
|
|||||||
return fieldRoots, nil
|
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) {
|
func PayloadProof(ctx context.Context, block interfaces.ReadOnlyBeaconBlock) ([][]byte, error) {
|
||||||
i := block.Body()
|
i := block.Body()
|
||||||
blockBody, ok := i.(*BeaconBlockBody)
|
blockBody, ok := i.(*BeaconBlockBody)
|
||||||
|
|||||||
@@ -153,13 +153,6 @@ func WithdrawalRequestsSliceRoot(withdrawalRequests []*enginev1.WithdrawalReques
|
|||||||
return SliceRoot(withdrawalRequests, limit)
|
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]
|
// ByteSliceRoot is a helper func to merkleize an arbitrary List[Byte, N]
|
||||||
// this func runs Chunkify + MerkleizeVector
|
// this func runs Chunkify + MerkleizeVector
|
||||||
// max length is dividable by 32 ( root length )
|
// max length is dividable by 32 ( root length )
|
||||||
|
|||||||
@@ -5,46 +5,6 @@ import (
|
|||||||
ethpbalpha "github.com/OffchainLabs/prysm/v6/proto/prysm/v1alpha1"
|
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.
|
// V1ValidatorToV1Alpha1 converts a v1 validator to v1alpha1.
|
||||||
func V1ValidatorToV1Alpha1(v1Validator *ethpbv1.Validator) *ethpbalpha.Validator {
|
func V1ValidatorToV1Alpha1(v1Validator *ethpbv1.Validator) *ethpbalpha.Validator {
|
||||||
if v1Validator == nil {
|
if v1Validator == nil {
|
||||||
|
|||||||
@@ -886,25 +886,6 @@ func genPayloadDeneb() *enginev1.ExecutionPayloadDeneb {
|
|||||||
|
|
||||||
var genPayloadElectra = genPayloadDeneb
|
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 {
|
func genPayloadHeaderCapella() *enginev1.ExecutionPayloadHeaderCapella {
|
||||||
return &enginev1.ExecutionPayloadHeaderCapella{
|
return &enginev1.ExecutionPayloadHeaderCapella{
|
||||||
ParentHash: bytes(32),
|
ParentHash: bytes(32),
|
||||||
@@ -949,14 +930,6 @@ func genPayloadHeaderDeneb() *enginev1.ExecutionPayloadHeaderDeneb {
|
|||||||
|
|
||||||
var genPayloadHeaderElectra = genPayloadHeaderDeneb
|
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 {
|
func genWithdrawal() *enginev1.Withdrawal {
|
||||||
return &enginev1.Withdrawal{
|
return &enginev1.Withdrawal{
|
||||||
Index: 123456,
|
Index: 123456,
|
||||||
|
|||||||
@@ -67,16 +67,6 @@ var DefaultDepositContractStorage = map[string]string{
|
|||||||
var bigz = big.NewInt(0)
|
var bigz = big.NewInt(0)
|
||||||
var minerBalance = 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
|
// 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.
|
// by adding the relative time of the capella the fork epoch to the given genesis timestamp.
|
||||||
func GethShanghaiTime(genesisTime uint64, cfg *clparams.BeaconChainConfig) *uint64 {
|
func GethShanghaiTime(genesisTime uint64, cfg *clparams.BeaconChainConfig) *uint64 {
|
||||||
|
|||||||
@@ -126,12 +126,6 @@ var PostElectraDepositCount = uint64(32)
|
|||||||
// PregenesisExecCreds is the number of withdrawal credentials of genesis validators which use an execution address.
|
// PregenesisExecCreds is the number of withdrawal credentials of genesis validators which use an execution address.
|
||||||
var PregenesisExecCreds = uint64(8)
|
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.
|
// Base port values.
|
||||||
const (
|
const (
|
||||||
portSpan = 50
|
portSpan = 50
|
||||||
|
|||||||
@@ -33,15 +33,6 @@ type electraBlockGenerator struct {
|
|||||||
payload *enginev1.ExecutionPayloadDeneb
|
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 {
|
func WithElectraPayload(p *enginev1.ExecutionPayloadDeneb) ElectraBlockGeneratorOption {
|
||||||
return func(g *electraBlockGenerator) {
|
return func(g *electraBlockGenerator) {
|
||||||
g.payload = p
|
g.payload = p
|
||||||
|
|||||||
@@ -71,19 +71,6 @@ func FillRootsNaturalOptCapella(state *ethpb.BeaconStateCapella) error {
|
|||||||
return nil
|
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
|
type NewBeaconStateOption func(state *ethpb.BeaconState) error
|
||||||
|
|
||||||
// NewBeaconState creates a beacon state with minimum marshalable fields.
|
// NewBeaconState creates a beacon state with minimum marshalable fields.
|
||||||
|
|||||||
Reference in New Issue
Block a user