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
This commit is contained in:
Potuz
2024-09-25 14:06:52 -03:00
committed by GitHub
parent 7e5738bfcd
commit ddafedc268
79 changed files with 3566 additions and 5947 deletions

View File

@@ -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 capella and deneb changes.
- Light client support: Implement `BlockToLightClientHeaderXXX` functions upto Deneb - Light client support: Implement `BlockToLightClientHeaderXXX` functions upto Deneb
- GetBeaconStateV2: add Electra case. - GetBeaconStateV2: add Electra case.
- Implement [consensus-specs/3875](https://github.com/ethereum/consensus-specs/pull/3875)
### Changed ### Changed

View File

@@ -227,7 +227,7 @@ filegroup(
url = "https://github.com/ethereum/EIPs/archive/5480440fe51742ed23342b68cf106cefd427e39d.tar.gz", 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" bls_test_version = "v0.1.1"
@@ -243,7 +243,7 @@ filegroup(
visibility = ["//visibility:public"], 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, 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"], 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, 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"], 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, 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"], visibility = ["//visibility:public"],
) )
""", """,
integrity = "sha256-mlytz4MPjKh0DwV7FMiAtnRbJw9B6o78/x66/vmnYc8=", integrity = "sha256-BoXckDxXnDcEmAjg/dQgf/tLiJsb6CT0aZvmWHFijrY=",
strip_prefix = "consensus-specs-" + consensus_spec_version[1:], strip_prefix = "consensus-specs-" + consensus_spec_version[1:],
url = "https://github.com/ethereum/consensus-specs/archive/refs/tags/%s.tar.gz" % consensus_spec_version, url = "https://github.com/ethereum/consensus-specs/archive/refs/tags/%s.tar.gz" % consensus_spec_version,
) )

View File

@@ -365,6 +365,7 @@ type BeaconBlockBodyElectra struct {
ExecutionPayload *ExecutionPayloadElectra `json:"execution_payload"` ExecutionPayload *ExecutionPayloadElectra `json:"execution_payload"`
BLSToExecutionChanges []*SignedBLSToExecutionChange `json:"bls_to_execution_changes"` BLSToExecutionChanges []*SignedBLSToExecutionChange `json:"bls_to_execution_changes"`
BlobKzgCommitments []string `json:"blob_kzg_commitments"` BlobKzgCommitments []string `json:"blob_kzg_commitments"`
ExecutionRequests *ExecutionRequests `json:"execution_requests"`
} }
type BlindedBeaconBlockElectra struct { type BlindedBeaconBlockElectra struct {
@@ -403,6 +404,7 @@ type BlindedBeaconBlockBodyElectra struct {
ExecutionPayloadHeader *ExecutionPayloadHeaderElectra `json:"execution_payload_header"` ExecutionPayloadHeader *ExecutionPayloadHeaderElectra `json:"execution_payload_header"`
BLSToExecutionChanges []*SignedBLSToExecutionChange `json:"bls_to_execution_changes"` BLSToExecutionChanges []*SignedBLSToExecutionChange `json:"bls_to_execution_changes"`
BlobKzgCommitments []string `json:"blob_kzg_commitments"` BlobKzgCommitments []string `json:"blob_kzg_commitments"`
ExecutionRequests *ExecutionRequests `json:"execution_requests"`
} }
type SignedBeaconBlockHeaderContainer struct { type SignedBeaconBlockHeaderContainer struct {
@@ -514,6 +516,8 @@ type ExecutionPayloadDeneb struct {
ExcessBlobGas string `json:"excess_blob_gas"` ExcessBlobGas string `json:"excess_blob_gas"`
} }
type ExecutionPayloadElectra = ExecutionPayloadDeneb
type ExecutionPayloadHeaderDeneb struct { type ExecutionPayloadHeaderDeneb struct {
ParentHash string `json:"parent_hash"` ParentHash string `json:"parent_hash"`
FeeRecipient string `json:"fee_recipient"` FeeRecipient string `json:"fee_recipient"`
@@ -534,48 +538,10 @@ type ExecutionPayloadHeaderDeneb struct {
ExcessBlobGas string `json:"excess_blob_gas"` ExcessBlobGas string `json:"excess_blob_gas"`
} }
type ExecutionPayloadElectra struct { type ExecutionPayloadHeaderElectra = ExecutionPayloadHeaderDeneb
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 { type ExecutionRequests struct {
ParentHash string `json:"parent_hash"` Deposits []*DepositRequest `json:"deposits"`
FeeRecipient string `json:"fee_recipient"` Withdrawals []*WithdrawalRequest `json:"withdrawals"`
StateRoot string `json:"state_root"` Consolidations []*ConsolidationRequest `json:"consolidations"`
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"`
} }

View File

@@ -2088,27 +2088,31 @@ func (b *BeaconBlockElectra) ToConsensus() (*eth.BeaconBlockElectra, error) {
return nil, server.NewDecodeError(err, "Body.ExecutionPayload.ExcessBlobGas") return nil, server.NewDecodeError(err, "Body.ExecutionPayload.ExcessBlobGas")
} }
depositRequests := make([]*enginev1.DepositRequest, len(b.Body.ExecutionPayload.DepositRequests)) if b.Body.ExecutionRequests == nil {
for i, d := range b.Body.ExecutionPayload.DepositRequests { 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() depositRequests[i], err = d.ToConsensus()
if err != nil { 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)) withdrawalRequests := make([]*enginev1.WithdrawalRequest, len(b.Body.ExecutionRequests.Withdrawals))
for i, w := range b.Body.ExecutionPayload.WithdrawalRequests { for i, w := range b.Body.ExecutionRequests.Withdrawals {
withdrawalRequests[i], err = w.ToConsensus() withdrawalRequests[i], err = w.ToConsensus()
if err != nil { 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)) consolidationRequests := make([]*enginev1.ConsolidationRequest, len(b.Body.ExecutionRequests.Consolidations))
for i, c := range b.Body.ExecutionPayload.ConsolidationRequests { for i, c := range b.Body.ExecutionRequests.Consolidations {
consolidationRequests[i], err = c.ToConsensus() consolidationRequests[i], err = c.ToConsensus()
if err != nil { 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, SyncCommitteeSignature: syncCommitteeSig,
}, },
ExecutionPayload: &enginev1.ExecutionPayloadElectra{ ExecutionPayload: &enginev1.ExecutionPayloadElectra{
ParentHash: payloadParentHash, ParentHash: payloadParentHash,
FeeRecipient: payloadFeeRecipient, FeeRecipient: payloadFeeRecipient,
StateRoot: payloadStateRoot, StateRoot: payloadStateRoot,
ReceiptsRoot: payloadReceiptsRoot, ReceiptsRoot: payloadReceiptsRoot,
LogsBloom: payloadLogsBloom, LogsBloom: payloadLogsBloom,
PrevRandao: payloadPrevRandao, PrevRandao: payloadPrevRandao,
BlockNumber: payloadBlockNumber, BlockNumber: payloadBlockNumber,
GasLimit: payloadGasLimit, GasLimit: payloadGasLimit,
GasUsed: payloadGasUsed, GasUsed: payloadGasUsed,
Timestamp: payloadTimestamp, Timestamp: payloadTimestamp,
ExtraData: payloadExtraData, ExtraData: payloadExtraData,
BaseFeePerGas: payloadBaseFeePerGas, BaseFeePerGas: payloadBaseFeePerGas,
BlockHash: payloadBlockHash, BlockHash: payloadBlockHash,
Transactions: txs, Transactions: txs,
Withdrawals: withdrawals, Withdrawals: withdrawals,
BlobGasUsed: payloadBlobGasUsed, BlobGasUsed: payloadBlobGasUsed,
ExcessBlobGas: payloadExcessBlobGas, ExcessBlobGas: payloadExcessBlobGas,
DepositRequests: depositRequests,
WithdrawalRequests: withdrawalRequests,
ConsolidationRequests: consolidationRequests,
}, },
BlsToExecutionChanges: blsChanges, BlsToExecutionChanges: blsChanges,
BlobKzgCommitments: blobKzgCommitments, BlobKzgCommitments: blobKzgCommitments,
ExecutionRequests: &enginev1.ExecutionRequests{
Deposits: depositRequests,
Withdrawals: withdrawalRequests,
Consolidations: consolidationRequests,
},
}, },
}, nil }, nil
} }
@@ -2383,17 +2389,31 @@ func (b *BlindedBeaconBlockElectra) ToConsensus() (*eth.BlindedBeaconBlockElectr
if err != nil { if err != nil {
return nil, server.NewDecodeError(err, "Body.ExecutionPayload.ExcessBlobGas") return nil, server.NewDecodeError(err, "Body.ExecutionPayload.ExcessBlobGas")
} }
payloadDepositRequestsRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.DepositRequestsRoot, fieldparams.RootLength) if b.Body.ExecutionRequests == nil {
if err != nil { return nil, server.NewDecodeError(errors.New("nil execution requests"), "Body.ExecutionRequests")
return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.DepositRequestsRoot")
} }
payloadWithdrawalRequestsRoot, err := bytesutil.DecodeHexWithLength(b.Body.ExecutionPayloadHeader.WithdrawalRequestsRoot, fieldparams.RootLength) depositRequests := make([]*enginev1.DepositRequest, len(b.Body.ExecutionRequests.Deposits))
if err != nil { for i, d := range b.Body.ExecutionRequests.Deposits {
return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.WithdrawalRequestsRoot") 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 { withdrawalRequests := make([]*enginev1.WithdrawalRequest, len(b.Body.ExecutionRequests.Withdrawals))
return nil, server.NewDecodeError(err, "Body.ExecutionPayloadHeader.ConsolidationRequestsRoot") 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) blsChanges, err := SignedBLSChangesToConsensus(b.Body.BLSToExecutionChanges)
@@ -2436,29 +2456,31 @@ func (b *BlindedBeaconBlockElectra) ToConsensus() (*eth.BlindedBeaconBlockElectr
SyncCommitteeSignature: syncCommitteeSig, SyncCommitteeSignature: syncCommitteeSig,
}, },
ExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{ ExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{
ParentHash: payloadParentHash, ParentHash: payloadParentHash,
FeeRecipient: payloadFeeRecipient, FeeRecipient: payloadFeeRecipient,
StateRoot: payloadStateRoot, StateRoot: payloadStateRoot,
ReceiptsRoot: payloadReceiptsRoot, ReceiptsRoot: payloadReceiptsRoot,
LogsBloom: payloadLogsBloom, LogsBloom: payloadLogsBloom,
PrevRandao: payloadPrevRandao, PrevRandao: payloadPrevRandao,
BlockNumber: payloadBlockNumber, BlockNumber: payloadBlockNumber,
GasLimit: payloadGasLimit, GasLimit: payloadGasLimit,
GasUsed: payloadGasUsed, GasUsed: payloadGasUsed,
Timestamp: payloadTimestamp, Timestamp: payloadTimestamp,
ExtraData: payloadExtraData, ExtraData: payloadExtraData,
BaseFeePerGas: payloadBaseFeePerGas, BaseFeePerGas: payloadBaseFeePerGas,
BlockHash: payloadBlockHash, BlockHash: payloadBlockHash,
TransactionsRoot: payloadTxsRoot, TransactionsRoot: payloadTxsRoot,
WithdrawalsRoot: payloadWithdrawalsRoot, WithdrawalsRoot: payloadWithdrawalsRoot,
BlobGasUsed: payloadBlobGasUsed, BlobGasUsed: payloadBlobGasUsed,
ExcessBlobGas: payloadExcessBlobGas, ExcessBlobGas: payloadExcessBlobGas,
DepositRequestsRoot: payloadDepositRequestsRoot,
WithdrawalRequestsRoot: payloadWithdrawalRequestsRoot,
ConsolidationRequestsRoot: payloadConsolidationRequestsRoot,
}, },
BlsToExecutionChanges: blsChanges, BlsToExecutionChanges: blsChanges,
BlobKzgCommitments: blobKzgCommitments, BlobKzgCommitments: blobKzgCommitments,
ExecutionRequests: &enginev1.ExecutionRequests{
Deposits: depositRequests,
Withdrawals: withdrawalRequests,
Consolidations: consolidationRequests,
},
}, },
}, nil }, nil
} }
@@ -2963,10 +2985,19 @@ func BlindedBeaconBlockElectraFromConsensus(b *eth.BlindedBeaconBlockElectra) (*
ExecutionPayloadHeader: payload, ExecutionPayloadHeader: payload,
BLSToExecutionChanges: SignedBLSChangesFromConsensus(b.Body.BlsToExecutionChanges), BLSToExecutionChanges: SignedBLSChangesFromConsensus(b.Body.BlsToExecutionChanges),
BlobKzgCommitments: blobKzgCommitments, BlobKzgCommitments: blobKzgCommitments,
ExecutionRequests: ExecutionRequestsFromConsensus(b.Body.ExecutionRequests),
}, },
}, nil }, 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) { func SignedBlindedBeaconBlockElectraFromConsensus(b *eth.SignedBlindedBeaconBlockElectra) (*SignedBlindedBeaconBlockElectra, error) {
block, err := BlindedBeaconBlockElectraFromConsensus(b.Message) block, err := BlindedBeaconBlockElectraFromConsensus(b.Message)
if err != nil { if err != nil {
@@ -3009,6 +3040,7 @@ func BeaconBlockElectraFromConsensus(b *eth.BeaconBlockElectra) (*BeaconBlockEle
ExecutionPayload: payload, ExecutionPayload: payload,
BLSToExecutionChanges: SignedBLSChangesFromConsensus(b.Body.BlsToExecutionChanges), BLSToExecutionChanges: SignedBLSChangesFromConsensus(b.Body.BlsToExecutionChanges),
BlobKzgCommitments: blobKzgCommitments, BlobKzgCommitments: blobKzgCommitments,
ExecutionRequests: ExecutionRequestsFromConsensus(b.Body.ExecutionRequests),
}, },
}, nil }, nil
} }
@@ -3112,39 +3144,7 @@ func ExecutionPayloadDenebFromConsensus(payload *enginev1.ExecutionPayloadDeneb)
}, nil }, nil
} }
func ExecutionPayloadElectraFromConsensus(payload *enginev1.ExecutionPayloadElectra) (*ExecutionPayloadElectra, error) { var ExecutionPayloadElectraFromConsensus = ExecutionPayloadDenebFromConsensus
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) { func ExecutionPayloadHeaderFromConsensus(payload *enginev1.ExecutionPayloadHeader) (*ExecutionPayloadHeader, error) {
baseFeePerGas, err := sszBytesToUint256String(payload.BaseFeePerGas) baseFeePerGas, err := sszBytesToUint256String(payload.BaseFeePerGas)
@@ -3222,32 +3222,4 @@ func ExecutionPayloadHeaderDenebFromConsensus(payload *enginev1.ExecutionPayload
}, nil }, nil
} }
func ExecutionPayloadHeaderElectraFromConsensus(payload *enginev1.ExecutionPayloadHeaderElectra) (*ExecutionPayloadHeaderElectra, error) { var ExecutionPayloadHeaderElectraFromConsensus = ExecutionPayloadHeaderDenebFromConsensus
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
}

View File

@@ -674,7 +674,7 @@ func BeaconStateElectraFromConsensus(st beaconState.BeaconState) (*BeaconStateEl
if err != nil { if err != nil {
return nil, err return nil, err
} }
srcPayload, ok := execData.Proto().(*enginev1.ExecutionPayloadHeaderElectra) srcPayload, ok := execData.Proto().(*enginev1.ExecutionPayloadHeaderDeneb)
if !ok { if !ok {
return nil, errPayloadHeaderNotFound return nil, errPayloadHeaderNotFound
} }

View File

@@ -213,6 +213,11 @@ func NewGenesisBlockForState(ctx context.Context, st state.BeaconState) (interfa
}, },
BlsToExecutionChanges: make([]*ethpb.SignedBLSToExecutionChange, 0), BlsToExecutionChanges: make([]*ethpb.SignedBLSToExecutionChange, 0),
BlobKzgCommitments: make([][]byte, 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[:], Signature: params.BeaconConfig().EmptySignature[:],

View File

@@ -78,23 +78,19 @@ func ProcessOperations(
return nil, errors.Wrap(err, "could not process bls-to-execution changes") return nil, errors.Wrap(err, "could not process bls-to-execution changes")
} }
// new in electra // new in electra
e, err := bb.Execution() requests, err := bb.ExecutionRequests()
if err != nil { 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) st, err = ProcessDepositRequests(ctx, st, requests.Deposits)
if !ok {
return nil, errors.New("could not cast execution data to electra execution data")
}
st, err = ProcessDepositRequests(ctx, st, exe.DepositRequests())
if err != nil { if err != nil {
return nil, errors.Wrap(err, "could not process deposit receipts") 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 { if err != nil {
return nil, errors.Wrap(err, "could not process execution layer withdrawal requests") 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 nil, fmt.Errorf("could not process consolidation requests: %w", err)
} }
return st, nil return st, nil

View File

@@ -10,7 +10,6 @@ import (
state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native" state_native "github.com/prysmaticlabs/prysm/v5/beacon-chain/state/state-native"
"github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/time/slots" "github.com/prysmaticlabs/prysm/v5/time/slots"
@@ -245,26 +244,23 @@ func UpgradeToElectra(beaconState state.BeaconState) (state.BeaconState, error)
CurrentSyncCommittee: currentSyncCommittee, CurrentSyncCommittee: currentSyncCommittee,
NextSyncCommittee: nextSyncCommittee, NextSyncCommittee: nextSyncCommittee,
LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{ LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{
ParentHash: payloadHeader.ParentHash(), ParentHash: payloadHeader.ParentHash(),
FeeRecipient: payloadHeader.FeeRecipient(), FeeRecipient: payloadHeader.FeeRecipient(),
StateRoot: payloadHeader.StateRoot(), StateRoot: payloadHeader.StateRoot(),
ReceiptsRoot: payloadHeader.ReceiptsRoot(), ReceiptsRoot: payloadHeader.ReceiptsRoot(),
LogsBloom: payloadHeader.LogsBloom(), LogsBloom: payloadHeader.LogsBloom(),
PrevRandao: payloadHeader.PrevRandao(), PrevRandao: payloadHeader.PrevRandao(),
BlockNumber: payloadHeader.BlockNumber(), BlockNumber: payloadHeader.BlockNumber(),
GasLimit: payloadHeader.GasLimit(), GasLimit: payloadHeader.GasLimit(),
GasUsed: payloadHeader.GasUsed(), GasUsed: payloadHeader.GasUsed(),
Timestamp: payloadHeader.Timestamp(), Timestamp: payloadHeader.Timestamp(),
ExtraData: payloadHeader.ExtraData(), ExtraData: payloadHeader.ExtraData(),
BaseFeePerGas: payloadHeader.BaseFeePerGas(), BaseFeePerGas: payloadHeader.BaseFeePerGas(),
BlockHash: payloadHeader.BlockHash(), BlockHash: payloadHeader.BlockHash(),
TransactionsRoot: txRoot, TransactionsRoot: txRoot,
WithdrawalsRoot: wdRoot, WithdrawalsRoot: wdRoot,
ExcessBlobGas: excessBlobGas, ExcessBlobGas: excessBlobGas,
BlobGasUsed: blobGasUsed, 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, NextWithdrawalIndex: wi,
NextWithdrawalValidatorIndex: vi, NextWithdrawalValidatorIndex: vi,

View File

@@ -8,7 +8,6 @@ import (
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time" "github.com/prysmaticlabs/prysm/v5/beacon-chain/core/time"
"github.com/prysmaticlabs/prysm/v5/config/params" "github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1" enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/testing/require"
@@ -113,24 +112,21 @@ func TestUpgradeToElectra(t *testing.T) {
wdRoot, err := prevHeader.WithdrawalsRoot() wdRoot, err := prevHeader.WithdrawalsRoot()
require.NoError(t, err) require.NoError(t, err)
wanted := &enginev1.ExecutionPayloadHeaderElectra{ wanted := &enginev1.ExecutionPayloadHeaderElectra{
ParentHash: prevHeader.ParentHash(), ParentHash: prevHeader.ParentHash(),
FeeRecipient: prevHeader.FeeRecipient(), FeeRecipient: prevHeader.FeeRecipient(),
StateRoot: prevHeader.StateRoot(), StateRoot: prevHeader.StateRoot(),
ReceiptsRoot: prevHeader.ReceiptsRoot(), ReceiptsRoot: prevHeader.ReceiptsRoot(),
LogsBloom: prevHeader.LogsBloom(), LogsBloom: prevHeader.LogsBloom(),
PrevRandao: prevHeader.PrevRandao(), PrevRandao: prevHeader.PrevRandao(),
BlockNumber: prevHeader.BlockNumber(), BlockNumber: prevHeader.BlockNumber(),
GasLimit: prevHeader.GasLimit(), GasLimit: prevHeader.GasLimit(),
GasUsed: prevHeader.GasUsed(), GasUsed: prevHeader.GasUsed(),
Timestamp: prevHeader.Timestamp(), Timestamp: prevHeader.Timestamp(),
ExtraData: prevHeader.ExtraData(), ExtraData: prevHeader.ExtraData(),
BaseFeePerGas: prevHeader.BaseFeePerGas(), BaseFeePerGas: prevHeader.BaseFeePerGas(),
BlockHash: prevHeader.BlockHash(), BlockHash: prevHeader.BlockHash(),
TransactionsRoot: txRoot, TransactionsRoot: txRoot,
WithdrawalsRoot: wdRoot, WithdrawalsRoot: wdRoot,
DepositRequestsRoot: bytesutil.Bytes32(0),
WithdrawalRequestsRoot: bytesutil.Bytes32(0),
ConsolidationRequestsRoot: bytesutil.Bytes32(0),
} }
require.DeepEqual(t, wanted, protoHeader) require.DeepEqual(t, wanted, protoHeader)

View File

@@ -138,20 +138,17 @@ func TestState_CanSaveRetrieve(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.NoError(t, st.SetSlot(100)) require.NoError(t, st.SetSlot(100))
p, err := blocks.WrappedExecutionPayloadHeaderElectra(&enginev1.ExecutionPayloadHeaderElectra{ p, err := blocks.WrappedExecutionPayloadHeaderElectra(&enginev1.ExecutionPayloadHeaderElectra{
ParentHash: make([]byte, 32), ParentHash: make([]byte, 32),
FeeRecipient: make([]byte, 20), FeeRecipient: make([]byte, 20),
StateRoot: make([]byte, 32), StateRoot: make([]byte, 32),
ReceiptsRoot: make([]byte, 32), ReceiptsRoot: make([]byte, 32),
LogsBloom: make([]byte, 256), LogsBloom: make([]byte, 256),
PrevRandao: make([]byte, 32), PrevRandao: make([]byte, 32),
ExtraData: []byte("foo"), ExtraData: []byte("foo"),
BaseFeePerGas: make([]byte, 32), BaseFeePerGas: make([]byte, 32),
BlockHash: make([]byte, 32), BlockHash: make([]byte, 32),
TransactionsRoot: make([]byte, 32), TransactionsRoot: make([]byte, 32),
WithdrawalsRoot: 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, err)
require.NoError(t, st.SetLatestExecutionPayloadHeader(p)) require.NoError(t, st.SetLatestExecutionPayloadHeader(p))

View File

@@ -167,15 +167,6 @@ func (s *Service) NewPayload(ctx context.Context, payload interfaces.ExecutionDa
if err != nil { if err != nil {
return nil, handleRPCError(err) 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: default:
return nil, errors.New("unknown execution data type") return nil, errors.New("unknown execution data type")
} }
@@ -268,9 +259,6 @@ func (s *Service) ForkchoiceUpdated(
func getPayloadMethodAndMessage(slot primitives.Slot) (string, proto.Message) { func getPayloadMethodAndMessage(slot primitives.Slot) (string, proto.Message) {
pe := slots.ToEpoch(slot) pe := slots.ToEpoch(slot)
if pe >= params.BeaconConfig().ElectraForkEpoch {
return GetPayloadMethodV4, &pb.ExecutionPayloadElectraWithValueAndBlobsBundle{}
}
if pe >= params.BeaconConfig().DenebForkEpoch { if pe >= params.BeaconConfig().DenebForkEpoch {
return GetPayloadMethodV3, &pb.ExecutionPayloadDenebWithValueAndBlobsBundle{} return GetPayloadMethodV3, &pb.ExecutionPayloadDenebWithValueAndBlobsBundle{}
} }
@@ -566,7 +554,7 @@ func fullPayloadFromPayloadBody(
Transactions: pb.RecastHexutilByteSlice(body.Transactions), Transactions: pb.RecastHexutilByteSlice(body.Transactions),
Withdrawals: body.Withdrawals, Withdrawals: body.Withdrawals,
}) // 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: case version.Deneb, version.Electra:
ebg, err := header.ExcessBlobGas() ebg, err := header.ExcessBlobGas()
if err != nil { if err != nil {
return nil, errors.Wrap(err, "unable to extract ExcessBlobGas attribute from execution payload header") return nil, errors.Wrap(err, "unable to extract ExcessBlobGas attribute from execution payload header")
@@ -595,50 +583,6 @@ func fullPayloadFromPayloadBody(
ExcessBlobGas: ebg, ExcessBlobGas: ebg,
BlobGasUsed: bgu, BlobGasUsed: bgu,
}) // 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 {
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: default:
return nil, fmt.Errorf("unknown execution block version for payload %d", bVersion) 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), Transactions: make([][]byte, 0),
Withdrawals: make([]*pb.Withdrawal, 0), Withdrawals: make([]*pb.Withdrawal, 0),
}, nil }, nil
case version.Deneb: case version.Deneb, version.Electra:
return &pb.ExecutionPayloadDeneb{ return &pb.ExecutionPayloadDeneb{
ParentHash: make([]byte, fieldparams.RootLength), ParentHash: make([]byte, fieldparams.RootLength),
FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), FeeRecipient: make([]byte, fieldparams.FeeRecipientLength),
@@ -775,22 +719,6 @@ func buildEmptyExecutionPayload(v int) (proto.Message, error) {
Transactions: make([][]byte, 0), Transactions: make([][]byte, 0),
Withdrawals: make([]*pb.Withdrawal, 0), Withdrawals: make([]*pb.Withdrawal, 0),
}, nil }, 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: default:
return nil, errors.Wrapf(ErrUnsupportedVersion, "version=%s", version.String(v)) return nil, errors.Wrapf(ErrUnsupportedVersion, "version=%s", version.String(v))
} }

View File

@@ -320,72 +320,6 @@ func TestClient_HTTP(t *testing.T) {
blobs := [][]byte{bytesutil.PadTo([]byte("a"), fieldparams.BlobLength), bytesutil.PadTo([]byte("b"), fieldparams.BlobLength)} blobs := [][]byte{bytesutil.PadTo([]byte("a"), fieldparams.BlobLength), bytesutil.PadTo([]byte("b"), fieldparams.BlobLength)}
require.DeepEqual(t, blobs, resp.BlobsBundle.Blobs) 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) { t.Run(ForkchoiceUpdatedMethod+" VALID status", func(t *testing.T) {
forkChoiceState := &pb.ForkchoiceState{ forkChoiceState := &pb.ForkchoiceState{
HeadBlockHash: []byte("head"), HeadBlockHash: []byte("head"),
@@ -568,20 +502,6 @@ func TestClient_HTTP(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.DeepEqual(t, want.LatestValidHash, resp) 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) { t.Run(NewPayloadMethod+" SYNCING status", func(t *testing.T) {
execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload)
require.Equal(t, true, ok) require.Equal(t, true, ok)
@@ -624,20 +544,6 @@ func TestClient_HTTP(t *testing.T) {
require.ErrorIs(t, ErrAcceptedSyncingPayloadStatus, err) require.ErrorIs(t, ErrAcceptedSyncingPayloadStatus, err)
require.DeepEqual(t, []uint8(nil), resp) 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) { t.Run(NewPayloadMethod+" INVALID_BLOCK_HASH status", func(t *testing.T) {
execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload)
require.Equal(t, true, ok) require.Equal(t, true, ok)
@@ -680,20 +586,6 @@ func TestClient_HTTP(t *testing.T) {
require.ErrorIs(t, ErrInvalidBlockHashPayloadStatus, err) require.ErrorIs(t, ErrInvalidBlockHashPayloadStatus, err)
require.DeepEqual(t, []uint8(nil), resp) 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) { t.Run(NewPayloadMethod+" INVALID status", func(t *testing.T) {
execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload)
require.Equal(t, true, ok) require.Equal(t, true, ok)
@@ -736,20 +628,6 @@ func TestClient_HTTP(t *testing.T) {
require.ErrorIs(t, ErrInvalidPayloadStatus, err) require.ErrorIs(t, ErrInvalidPayloadStatus, err)
require.DeepEqual(t, want.LatestValidHash, resp) 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) { t.Run(NewPayloadMethod+" UNKNOWN status", func(t *testing.T) {
execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload) execPayload, ok := fix["ExecutionPayload"].(*pb.ExecutionPayload)
require.Equal(t, true, ok) require.Equal(t, true, ok)
@@ -1417,10 +1295,8 @@ func fixtures() map[string]interface{} {
"ExecutionPayload": s.ExecutionPayload, "ExecutionPayload": s.ExecutionPayload,
"ExecutionPayloadCapella": s.ExecutionPayloadCapella, "ExecutionPayloadCapella": s.ExecutionPayloadCapella,
"ExecutionPayloadDeneb": s.ExecutionPayloadDeneb, "ExecutionPayloadDeneb": s.ExecutionPayloadDeneb,
"ExecutionPayloadElectra": s.ExecutionPayloadElectra,
"ExecutionPayloadCapellaWithValue": s.ExecutionPayloadWithValueCapella, "ExecutionPayloadCapellaWithValue": s.ExecutionPayloadWithValueCapella,
"ExecutionPayloadDenebWithValue": s.ExecutionPayloadWithValueDeneb, "ExecutionPayloadDenebWithValue": s.ExecutionPayloadWithValueDeneb,
"ExecutionPayloadElectraWithValue": s.ExecutionPayloadWithValueElectra,
"ValidPayloadStatus": s.ValidPayloadStatus, "ValidPayloadStatus": s.ValidPayloadStatus,
"InvalidBlockHashStatus": s.InvalidBlockHashStatus, "InvalidBlockHashStatus": s.InvalidBlockHashStatus,
"AcceptedStatus": s.AcceptedStatus, "AcceptedStatus": s.AcceptedStatus,
@@ -1558,40 +1434,6 @@ func fixturesStruct() *payloadFixtures {
TargetPubkey: &tPubkey, 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) hexUint := hexutil.Uint64(1)
executionPayloadWithValueFixtureCapella := &pb.GetPayloadV2ResponseJson{ executionPayloadWithValueFixtureCapella := &pb.GetPayloadV2ResponseJson{
ExecutionPayload: &pb.ExecutionPayloadCapellaJSON{ ExecutionPayload: &pb.ExecutionPayloadCapellaJSON{
@@ -1641,36 +1483,6 @@ func fixturesStruct() *payloadFixtures {
Blobs: []hexutil.Bytes{{'a'}, {'b'}}, 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) parent := bytesutil.PadTo([]byte("parentHash"), fieldparams.RootLength)
sha3Uncles := bytesutil.PadTo([]byte("sha3Uncles"), fieldparams.RootLength) sha3Uncles := bytesutil.PadTo([]byte("sha3Uncles"), fieldparams.RootLength)
miner := bytesutil.PadTo([]byte("miner"), fieldparams.FeeRecipientLength) miner := bytesutil.PadTo([]byte("miner"), fieldparams.FeeRecipientLength)
@@ -1762,10 +1574,8 @@ func fixturesStruct() *payloadFixtures {
ExecutionPayloadCapella: executionPayloadFixtureCapella, ExecutionPayloadCapella: executionPayloadFixtureCapella,
ExecutionPayloadDeneb: executionPayloadFixtureDeneb, ExecutionPayloadDeneb: executionPayloadFixtureDeneb,
EmptyExecutionPayloadDeneb: emptyExecutionPayloadDeneb, EmptyExecutionPayloadDeneb: emptyExecutionPayloadDeneb,
ExecutionPayloadElectra: executionPayloadFixtureElectra,
ExecutionPayloadWithValueCapella: executionPayloadWithValueFixtureCapella, ExecutionPayloadWithValueCapella: executionPayloadWithValueFixtureCapella,
ExecutionPayloadWithValueDeneb: executionPayloadWithValueFixtureDeneb, ExecutionPayloadWithValueDeneb: executionPayloadWithValueFixtureDeneb,
ExecutionPayloadWithValueElectra: executionPayloadWithValueFixtureElectra,
ValidPayloadStatus: validStatus, ValidPayloadStatus: validStatus,
InvalidBlockHashStatus: inValidBlockHashStatus, InvalidBlockHashStatus: inValidBlockHashStatus,
AcceptedStatus: acceptedStatus, AcceptedStatus: acceptedStatus,
@@ -1787,10 +1597,8 @@ type payloadFixtures struct {
ExecutionPayloadCapella *pb.ExecutionPayloadCapella ExecutionPayloadCapella *pb.ExecutionPayloadCapella
EmptyExecutionPayloadDeneb *pb.ExecutionPayloadDeneb EmptyExecutionPayloadDeneb *pb.ExecutionPayloadDeneb
ExecutionPayloadDeneb *pb.ExecutionPayloadDeneb ExecutionPayloadDeneb *pb.ExecutionPayloadDeneb
ExecutionPayloadElectra *pb.ExecutionPayloadElectra
ExecutionPayloadWithValueCapella *pb.GetPayloadV2ResponseJson ExecutionPayloadWithValueCapella *pb.GetPayloadV2ResponseJson
ExecutionPayloadWithValueDeneb *pb.GetPayloadV3ResponseJson ExecutionPayloadWithValueDeneb *pb.GetPayloadV3ResponseJson
ExecutionPayloadWithValueElectra *pb.GetPayloadV4ResponseJson
ValidPayloadStatus *pb.PayloadStatus ValidPayloadStatus *pb.PayloadStatus
InvalidBlockHashStatus *pb.PayloadStatus InvalidBlockHashStatus *pb.PayloadStatus
AcceptedStatus *pb.PayloadStatus AcceptedStatus *pb.PayloadStatus
@@ -2149,40 +1957,6 @@ func newPayloadV3Setup(t *testing.T, status *pb.PayloadStatus, payload *pb.Execu
return service 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) { func TestReconstructBlindedBlockBatch(t *testing.T) {
t.Run("empty response works", func(t *testing.T) { t.Run("empty response works", func(t *testing.T) {
ctx := context.Background() ctx := context.Background()

View File

@@ -64,12 +64,6 @@ func payloadToBody(t *testing.T, ed interfaces.ExecutionData) *pb.ExecutionPaylo
for i := range txs { for i := range txs {
body.Transactions = append(body.Transactions, txs[i]) 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 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)) afterSkipBlock, _ := util.GenerateTestDenebBlockWithSidecar(t, [32]byte{}, denebSlot(t)+3, 0, util.WithPayloadSetter(afterSkip))
fx.afterSkipDeneb = blindedBlockWithHeader(t, afterSkipBlock) fx.afterSkipDeneb = blindedBlockWithHeader(t, afterSkipBlock)
electra := fixturesStruct().ExecutionPayloadElectra electra := fixturesStruct().ExecutionPayloadDeneb
electra.BlockHash = bytesutil.PadTo([]byte("electra"), 32) electra.BlockHash = bytesutil.PadTo([]byte("electra"), 32)
electra.BlockNumber = 5 electra.BlockNumber = 5
electraBlock, _ := util.GenerateTestElectraBlockWithSidecar(t, [32]byte{}, electraSlot(t), 0, util.WithElectraPayload(electra)) 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()) payload, err := bbr.payloadForHeader(fx.denebBlock.blinded.header, fx.denebBlock.blinded.block.Version())
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, version.Deneb, fx.denebBlock.blinded.block.Version())
unblindFull, err := blocks.BuildSignedBeaconBlockFromExecutionPayload(fx.denebBlock.blinded.block, payload) unblindFull, err := blocks.BuildSignedBeaconBlockFromExecutionPayload(fx.denebBlock.blinded.block, payload)
require.NoError(t, err) require.NoError(t, err)
testAssertReconstructedEquivalent(t, fx.denebBlock.full, unblindFull) testAssertReconstructedEquivalent(t, fx.denebBlock.full, unblindFull)

View File

@@ -472,6 +472,6 @@ data: {"version":"deneb","data":{"proposer_index":"0","proposal_slot":"1","paren
const payloadAttributesElectraResultWithTVC = `: const payloadAttributesElectraResultWithTVC = `:
event: payload_attributes 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"}}}
` `

View File

@@ -1814,10 +1814,7 @@ var BlindedElectraBlock = fmt.Sprintf(`{
"blob_gas_used": "1", "blob_gas_used": "1",
"excess_blob_gas": "2", "excess_blob_gas": "2",
"transactions_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "transactions_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"withdrawals_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "withdrawals_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
"deposit_requests_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"withdrawal_requests_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2",
"consolidation_requests_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2"
}, },
"bls_to_execution_changes": [ "bls_to_execution_changes": [
{ {
@@ -1829,7 +1826,33 @@ var BlindedElectraBlock = fmt.Sprintf(`{
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" "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" "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"
@@ -2225,30 +2248,7 @@ var ElectraBlockContents = fmt.Sprintf(`{
"address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", "address": "0xabcf8e0d4e9587369b2301d0790347320302cc09",
"amount": "1" "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": [ "bls_to_execution_changes": [
{ {
@@ -2260,7 +2260,32 @@ var ElectraBlockContents = fmt.Sprintf(`{
"signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" "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" "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505"

View File

@@ -586,40 +586,6 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
var scBits [fieldparams.SyncAggregateSyncCommitteeBytesLength]byte var scBits [fieldparams.SyncAggregateSyncCommitteeBytesLength]byte
blk := &ethpb.SignedBeaconBlockElectra{
Block: &ethpb.BeaconBlockElectra{
Slot: electraSlot + 1,
ParentRoot: parentRoot[:],
StateRoot: genesis.Block.StateRoot,
Body: &ethpb.BeaconBlockBodyElectra{
RandaoReveal: genesis.Block.Body.RandaoReveal,
Graffiti: genesis.Block.Body.Graffiti,
Eth1Data: genesis.Block.Body.Eth1Data,
SyncAggregate: &ethpb.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.DepositRequest{{ dr := []*enginev1.DepositRequest{{
Pubkey: bytesutil.PadTo(privKeys[0].PublicKey().Marshal(), 48), Pubkey: bytesutil.PadTo(privKeys[0].PublicKey().Marshal(), 48),
WithdrawalCredentials: bytesutil.PadTo([]byte("wc"), 32), WithdrawalCredentials: bytesutil.PadTo([]byte("wc"), 32),
@@ -641,21 +607,56 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) {
TargetPubkey: bytesutil.PadTo(privKeys[2].PublicKey().Marshal(), 48), TargetPubkey: bytesutil.PadTo(privKeys[2].PublicKey().Marshal(), 48),
}, },
} }
payload := &enginev1.ExecutionPayloadElectra{ blk := &ethpb.SignedBeaconBlockElectra{
Timestamp: uint64(timeStamp.Unix()), Block: &ethpb.BeaconBlockElectra{
ParentHash: make([]byte, fieldparams.RootLength), Slot: electraSlot + 1,
FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), ParentRoot: parentRoot[:],
StateRoot: make([]byte, fieldparams.RootLength), StateRoot: genesis.Block.StateRoot,
ReceiptsRoot: make([]byte, fieldparams.RootLength), Body: &ethpb.BeaconBlockBodyElectra{
LogsBloom: make([]byte, fieldparams.LogsBloomLength), RandaoReveal: genesis.Block.Body.RandaoReveal,
PrevRandao: random, Graffiti: genesis.Block.Body.Graffiti,
BaseFeePerGas: make([]byte, fieldparams.RootLength), Eth1Data: genesis.Block.Body.Eth1Data,
BlockHash: make([]byte, fieldparams.RootLength), SyncAggregate: &ethpb.SyncAggregate{SyncCommitteeBits: scBits[:], SyncCommitteeSignature: make([]byte, 96)},
DepositRequests: dr, ExecutionPayload: &enginev1.ExecutionPayloadElectra{
WithdrawalRequests: wr, ParentHash: make([]byte, fieldparams.RootLength),
ConsolidationRequests: cr, 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),
},
ExecutionRequests: &enginev1.ExecutionRequests{
Withdrawals: wr,
Deposits: dr,
Consolidations: cr,
},
},
},
} }
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)
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),
}
proposerServer := getProposerServer(db, beaconState, parentRoot[:]) proposerServer := getProposerServer(db, beaconState, parentRoot[:])
ed, err := blocks.NewWrappedExecutionData(payload) ed, err := blocks.NewWrappedExecutionData(payload)
require.NoError(t, err) require.NoError(t, err)
@@ -675,11 +676,8 @@ func TestServer_GetBeaconBlock_Electra(t *testing.T) {
Graffiti: graffiti[:], Graffiti: graffiti[:],
} }
got, err := proposerServer.GetBeaconBlock(ctx, req) _, err = proposerServer.GetBeaconBlock(ctx, req)
require.NoError(t, err) 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) { func TestServer_GetBeaconBlock_Optimistic(t *testing.T) {

View File

@@ -55,7 +55,6 @@ type BeaconState struct {
latestExecutionPayloadHeader *enginev1.ExecutionPayloadHeader latestExecutionPayloadHeader *enginev1.ExecutionPayloadHeader
latestExecutionPayloadHeaderCapella *enginev1.ExecutionPayloadHeaderCapella latestExecutionPayloadHeaderCapella *enginev1.ExecutionPayloadHeaderCapella
latestExecutionPayloadHeaderDeneb *enginev1.ExecutionPayloadHeaderDeneb latestExecutionPayloadHeaderDeneb *enginev1.ExecutionPayloadHeaderDeneb
latestExecutionPayloadHeaderElectra *enginev1.ExecutionPayloadHeaderElectra
nextWithdrawalIndex uint64 nextWithdrawalIndex uint64
nextWithdrawalValidatorIndex primitives.ValidatorIndex nextWithdrawalValidatorIndex primitives.ValidatorIndex
@@ -114,7 +113,6 @@ type beaconStateMarshalable struct {
LatestExecutionPayloadHeader *enginev1.ExecutionPayloadHeader `json:"latest_execution_payload_header" yaml:"latest_execution_payload_header"` 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"` 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"` 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"` NextWithdrawalIndex uint64 `json:"next_withdrawal_index" yaml:"next_withdrawal_index"`
NextWithdrawalValidatorIndex primitives.ValidatorIndex `json:"next_withdrawal_validator_index" yaml:"next_withdrawal_validator_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"` 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, LatestExecutionPayloadHeader: b.latestExecutionPayloadHeader,
LatestExecutionPayloadHeaderCapella: b.latestExecutionPayloadHeaderCapella, LatestExecutionPayloadHeaderCapella: b.latestExecutionPayloadHeaderCapella,
LatestExecutionPayloadHeaderDeneb: b.latestExecutionPayloadHeaderDeneb, LatestExecutionPayloadHeaderDeneb: b.latestExecutionPayloadHeaderDeneb,
LatestExecutionPayloadHeaderElectra: b.latestExecutionPayloadHeaderElectra,
NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalIndex: b.nextWithdrawalIndex,
NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex,
DepositRequestsStartIndex: b.depositRequestsStartIndex, DepositRequestsStartIndex: b.depositRequestsStartIndex,

View File

@@ -22,10 +22,8 @@ func (b *BeaconState) LatestExecutionPayloadHeader() (interfaces.ExecutionData,
return blocks.WrappedExecutionPayloadHeader(b.latestExecutionPayloadHeader.Copy()) return blocks.WrappedExecutionPayloadHeader(b.latestExecutionPayloadHeader.Copy())
case version.Capella: case version.Capella:
return blocks.WrappedExecutionPayloadHeaderCapella(b.latestExecutionPayloadHeaderCapella.Copy()) return blocks.WrappedExecutionPayloadHeaderCapella(b.latestExecutionPayloadHeaderCapella.Copy())
case version.Deneb: case version.Deneb, version.Electra:
return blocks.WrappedExecutionPayloadHeaderDeneb(b.latestExecutionPayloadHeaderDeneb.Copy()) return blocks.WrappedExecutionPayloadHeaderDeneb(b.latestExecutionPayloadHeaderDeneb.Copy())
case version.Electra:
return blocks.WrappedExecutionPayloadHeaderElectra(b.latestExecutionPayloadHeaderElectra.Copy())
default: default:
return nil, fmt.Errorf("unsupported version (%s) for latest execution payload header", version.String(b.version)) return nil, fmt.Errorf("unsupported version (%s) for latest execution payload header", version.String(b.version))
} }

View File

@@ -198,7 +198,7 @@ func (b *BeaconState) ToProtoUnsafe() interface{} {
InactivityScores: b.inactivityScoresVal(), InactivityScores: b.inactivityScoresVal(),
CurrentSyncCommittee: b.currentSyncCommittee, CurrentSyncCommittee: b.currentSyncCommittee,
NextSyncCommittee: b.nextSyncCommittee, NextSyncCommittee: b.nextSyncCommittee,
LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderElectra, LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderDeneb,
NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalIndex: b.nextWithdrawalIndex,
NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex,
HistoricalSummaries: b.historicalSummaries, HistoricalSummaries: b.historicalSummaries,
@@ -404,7 +404,7 @@ func (b *BeaconState) ToProto() interface{} {
InactivityScores: b.inactivityScoresVal(), InactivityScores: b.inactivityScoresVal(),
CurrentSyncCommittee: b.currentSyncCommitteeVal(), CurrentSyncCommittee: b.currentSyncCommitteeVal(),
NextSyncCommittee: b.nextSyncCommitteeVal(), NextSyncCommittee: b.nextSyncCommitteeVal(),
LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderElectra.Copy(), LatestExecutionPayloadHeader: b.latestExecutionPayloadHeaderDeneb.Copy(),
NextWithdrawalIndex: b.nextWithdrawalIndex, NextWithdrawalIndex: b.nextWithdrawalIndex,
NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex, NextWithdrawalValidatorIndex: b.nextWithdrawalValidatorIndex,
HistoricalSummaries: b.historicalSummariesVal(), HistoricalSummaries: b.historicalSummariesVal(),

View File

@@ -243,7 +243,7 @@ func ComputeFieldRootsWithHasher(ctx context.Context, state *BeaconState) ([][]b
fieldRoots[types.LatestExecutionPayloadHeaderCapella.RealPosition()] = executionPayloadRoot[:] fieldRoots[types.LatestExecutionPayloadHeaderCapella.RealPosition()] = executionPayloadRoot[:]
} }
if state.version == version.Deneb { if state.version >= version.Deneb {
// Execution payload root. // Execution payload root.
executionPayloadRoot, err := state.latestExecutionPayloadHeaderDeneb.HashTreeRoot() executionPayloadRoot, err := state.latestExecutionPayloadHeaderDeneb.HashTreeRoot()
if err != nil { if err != nil {
@@ -252,15 +252,6 @@ func ComputeFieldRootsWithHasher(ctx context.Context, state *BeaconState) ([][]b
fieldRoots[types.LatestExecutionPayloadHeaderDeneb.RealPosition()] = executionPayloadRoot[:] 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 { if state.version >= version.Capella {
// Next withdrawal index root. // Next withdrawal index root.
nextWithdrawalIndexRoot := make([]byte, 32) nextWithdrawalIndexRoot := make([]byte, 32)

View File

@@ -45,7 +45,7 @@ func (b *BeaconState) SetLatestExecutionPayloadHeader(val interfaces.ExecutionDa
b.markFieldAsDirty(types.LatestExecutionPayloadHeaderCapella) b.markFieldAsDirty(types.LatestExecutionPayloadHeaderCapella)
return nil return nil
case *enginev1.ExecutionPayloadDeneb: 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)) return fmt.Errorf("wrong state version (%s) for deneb execution payload", version.String(b.version))
} }
latest, err := consensusblocks.PayloadToHeaderDeneb(val) latest, err := consensusblocks.PayloadToHeaderDeneb(val)
@@ -55,21 +55,6 @@ func (b *BeaconState) SetLatestExecutionPayloadHeader(val interfaces.ExecutionDa
b.latestExecutionPayloadHeaderDeneb = latest b.latestExecutionPayloadHeaderDeneb = latest
b.markFieldAsDirty(types.LatestExecutionPayloadHeaderDeneb) b.markFieldAsDirty(types.LatestExecutionPayloadHeaderDeneb)
return nil 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: case *enginev1.ExecutionPayloadHeader:
if b.version != version.Bellatrix { if b.version != version.Bellatrix {
return fmt.Errorf("wrong state version (%s) for bellatrix execution payload header", version.String(b.version)) 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) b.markFieldAsDirty(types.LatestExecutionPayloadHeaderCapella)
return nil return nil
case *enginev1.ExecutionPayloadHeaderDeneb: 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)) return fmt.Errorf("wrong state version (%s) for deneb execution payload header", version.String(b.version))
} }
b.latestExecutionPayloadHeaderDeneb = header b.latestExecutionPayloadHeaderDeneb = header
b.markFieldAsDirty(types.LatestExecutionPayloadHeaderDeneb) b.markFieldAsDirty(types.LatestExecutionPayloadHeaderDeneb)
return nil 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: default:
return errors.New("value must be an execution payload header") return errors.New("value must be an execution payload header")
} }

View File

@@ -62,7 +62,7 @@ func TestSetLatestExecutionPayloadHeader(t *testing.T) {
}(), }(),
func() interfaces.ExecutionData { func() interfaces.ExecutionData {
e := util.NewBlindedBeaconBlockElectra().Message.Body.ExecutionPayloadHeader e := util.NewBlindedBeaconBlockElectra().Message.Body.ExecutionPayloadHeader
ee, err := blocks.WrappedExecutionPayloadHeaderElectra(e) ee, err := blocks.WrappedExecutionPayloadHeaderDeneb(e)
require.NoError(t, err) require.NoError(t, err)
return ee return ee
}(), }(),
@@ -93,6 +93,13 @@ func TestSetLatestExecutionPayloadHeader(t *testing.T) {
if i == j { if i == j {
continue 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) { 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) s := state_native.EmptyStateFromVersion(t, i+versionOffset)
p := payloads[j] p := payloads[j]

View File

@@ -99,7 +99,7 @@ var electraFields = append(
types.NextWithdrawalIndex, types.NextWithdrawalIndex,
types.NextWithdrawalValidatorIndex, types.NextWithdrawalValidatorIndex,
types.HistoricalSummaries, types.HistoricalSummaries,
types.LatestExecutionPayloadHeaderElectra, types.LatestExecutionPayloadHeaderDeneb,
types.DepositRequestsStartIndex, types.DepositRequestsStartIndex,
types.DepositBalanceToConsume, types.DepositBalanceToConsume,
types.ExitBalanceToConsume, types.ExitBalanceToConsume,
@@ -726,38 +726,38 @@ func InitializeFromProtoUnsafeElectra(st *ethpb.BeaconStateElectra) (state.Beaco
fieldCount := params.BeaconConfig().BeaconStateElectraFieldCount fieldCount := params.BeaconConfig().BeaconStateElectraFieldCount
b := &BeaconState{ b := &BeaconState{
version: version.Electra, version: version.Electra,
genesisTime: st.GenesisTime, genesisTime: st.GenesisTime,
genesisValidatorsRoot: bytesutil.ToBytes32(st.GenesisValidatorsRoot), genesisValidatorsRoot: bytesutil.ToBytes32(st.GenesisValidatorsRoot),
slot: st.Slot, slot: st.Slot,
fork: st.Fork, fork: st.Fork,
latestBlockHeader: st.LatestBlockHeader, latestBlockHeader: st.LatestBlockHeader,
historicalRoots: hRoots, historicalRoots: hRoots,
eth1Data: st.Eth1Data, eth1Data: st.Eth1Data,
eth1DataVotes: st.Eth1DataVotes, eth1DataVotes: st.Eth1DataVotes,
eth1DepositIndex: st.Eth1DepositIndex, eth1DepositIndex: st.Eth1DepositIndex,
slashings: st.Slashings, slashings: st.Slashings,
previousEpochParticipation: st.PreviousEpochParticipation, previousEpochParticipation: st.PreviousEpochParticipation,
currentEpochParticipation: st.CurrentEpochParticipation, currentEpochParticipation: st.CurrentEpochParticipation,
justificationBits: st.JustificationBits, justificationBits: st.JustificationBits,
previousJustifiedCheckpoint: st.PreviousJustifiedCheckpoint, previousJustifiedCheckpoint: st.PreviousJustifiedCheckpoint,
currentJustifiedCheckpoint: st.CurrentJustifiedCheckpoint, currentJustifiedCheckpoint: st.CurrentJustifiedCheckpoint,
finalizedCheckpoint: st.FinalizedCheckpoint, finalizedCheckpoint: st.FinalizedCheckpoint,
currentSyncCommittee: st.CurrentSyncCommittee, currentSyncCommittee: st.CurrentSyncCommittee,
nextSyncCommittee: st.NextSyncCommittee, nextSyncCommittee: st.NextSyncCommittee,
latestExecutionPayloadHeaderElectra: st.LatestExecutionPayloadHeader, latestExecutionPayloadHeaderDeneb: st.LatestExecutionPayloadHeader,
nextWithdrawalIndex: st.NextWithdrawalIndex, nextWithdrawalIndex: st.NextWithdrawalIndex,
nextWithdrawalValidatorIndex: st.NextWithdrawalValidatorIndex, nextWithdrawalValidatorIndex: st.NextWithdrawalValidatorIndex,
historicalSummaries: st.HistoricalSummaries, historicalSummaries: st.HistoricalSummaries,
depositRequestsStartIndex: st.DepositRequestsStartIndex, depositRequestsStartIndex: st.DepositRequestsStartIndex,
depositBalanceToConsume: st.DepositBalanceToConsume, depositBalanceToConsume: st.DepositBalanceToConsume,
exitBalanceToConsume: st.ExitBalanceToConsume, exitBalanceToConsume: st.ExitBalanceToConsume,
earliestExitEpoch: st.EarliestExitEpoch, earliestExitEpoch: st.EarliestExitEpoch,
consolidationBalanceToConsume: st.ConsolidationBalanceToConsume, consolidationBalanceToConsume: st.ConsolidationBalanceToConsume,
earliestConsolidationEpoch: st.EarliestConsolidationEpoch, earliestConsolidationEpoch: st.EarliestConsolidationEpoch,
pendingBalanceDeposits: st.PendingBalanceDeposits, pendingBalanceDeposits: st.PendingBalanceDeposits,
pendingPartialWithdrawals: st.PendingPartialWithdrawals, pendingPartialWithdrawals: st.PendingPartialWithdrawals,
pendingConsolidations: st.PendingConsolidations, pendingConsolidations: st.PendingConsolidations,
dirtyFields: make(map[types.FieldIndex]bool, fieldCount), dirtyFields: make(map[types.FieldIndex]bool, fieldCount),
dirtyIndices: make(map[types.FieldIndex][]uint64, 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.Slashings] = stateutil.NewRef(1)
b.sharedFieldReferences[types.PreviousEpochParticipationBits] = stateutil.NewRef(1) b.sharedFieldReferences[types.PreviousEpochParticipationBits] = stateutil.NewRef(1)
b.sharedFieldReferences[types.CurrentEpochParticipationBits] = stateutil.NewRef(1) b.sharedFieldReferences[types.CurrentEpochParticipationBits] = stateutil.NewRef(1)
b.sharedFieldReferences[types.LatestExecutionPayloadHeaderElectra] = 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.HistoricalSummaries] = stateutil.NewRef(1) // New in Capella.
b.sharedFieldReferences[types.PendingBalanceDeposits] = stateutil.NewRef(1) // New in Electra. b.sharedFieldReferences[types.PendingBalanceDeposits] = stateutil.NewRef(1) // New in Electra.
b.sharedFieldReferences[types.PendingPartialWithdrawals] = 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.PendingConsolidations] = stateutil.NewRef(1) // New in Electra.
if !features.Get().EnableExperimentalState { if !features.Get().EnableExperimentalState {
b.sharedFieldReferences[types.BlockRoots] = stateutil.NewRef(1) b.sharedFieldReferences[types.BlockRoots] = stateutil.NewRef(1)
b.sharedFieldReferences[types.StateRoots] = stateutil.NewRef(1) b.sharedFieldReferences[types.StateRoots] = stateutil.NewRef(1)
@@ -916,7 +916,6 @@ func (b *BeaconState) Copy() state.BeaconState {
latestExecutionPayloadHeader: b.latestExecutionPayloadHeader.Copy(), latestExecutionPayloadHeader: b.latestExecutionPayloadHeader.Copy(),
latestExecutionPayloadHeaderCapella: b.latestExecutionPayloadHeaderCapella.Copy(), latestExecutionPayloadHeaderCapella: b.latestExecutionPayloadHeaderCapella.Copy(),
latestExecutionPayloadHeaderDeneb: b.latestExecutionPayloadHeaderDeneb.Copy(), latestExecutionPayloadHeaderDeneb: b.latestExecutionPayloadHeaderDeneb.Copy(),
latestExecutionPayloadHeaderElectra: b.latestExecutionPayloadHeaderElectra.Copy(),
id: types.Enumerator.Inc(), id: types.Enumerator.Inc(),
@@ -1284,8 +1283,6 @@ func (b *BeaconState) rootSelector(ctx context.Context, field types.FieldIndex)
return b.latestExecutionPayloadHeaderCapella.HashTreeRoot() return b.latestExecutionPayloadHeaderCapella.HashTreeRoot()
case types.LatestExecutionPayloadHeaderDeneb: case types.LatestExecutionPayloadHeaderDeneb:
return b.latestExecutionPayloadHeaderDeneb.HashTreeRoot() return b.latestExecutionPayloadHeaderDeneb.HashTreeRoot()
case types.LatestExecutionPayloadHeaderElectra:
return b.latestExecutionPayloadHeaderElectra.HashTreeRoot()
case types.NextWithdrawalIndex: case types.NextWithdrawalIndex:
return ssz.Uint64Root(b.nextWithdrawalIndex), nil return ssz.Uint64Root(b.nextWithdrawalIndex), nil
case types.NextWithdrawalValidatorIndex: case types.NextWithdrawalValidatorIndex:

View File

@@ -88,8 +88,6 @@ func (f FieldIndex) String() string {
return "latestExecutionPayloadHeaderCapella" return "latestExecutionPayloadHeaderCapella"
case LatestExecutionPayloadHeaderDeneb: case LatestExecutionPayloadHeaderDeneb:
return "latestExecutionPayloadHeaderDeneb" return "latestExecutionPayloadHeaderDeneb"
case LatestExecutionPayloadHeaderElectra:
return "latestExecutionPayloadHeaderElectra"
case NextWithdrawalIndex: case NextWithdrawalIndex:
return "nextWithdrawalIndex" return "nextWithdrawalIndex"
case NextWithdrawalValidatorIndex: case NextWithdrawalValidatorIndex:
@@ -171,7 +169,7 @@ func (f FieldIndex) RealPosition() int {
return 22 return 22
case NextSyncCommittee: case NextSyncCommittee:
return 23 return 23
case LatestExecutionPayloadHeader, LatestExecutionPayloadHeaderCapella, LatestExecutionPayloadHeaderDeneb, LatestExecutionPayloadHeaderElectra: case LatestExecutionPayloadHeader, LatestExecutionPayloadHeaderCapella, LatestExecutionPayloadHeaderDeneb:
return 24 return 24
case NextWithdrawalIndex: case NextWithdrawalIndex:
return 25 return 25
@@ -249,7 +247,6 @@ const (
LatestExecutionPayloadHeader LatestExecutionPayloadHeader
LatestExecutionPayloadHeaderCapella LatestExecutionPayloadHeaderCapella
LatestExecutionPayloadHeaderDeneb LatestExecutionPayloadHeaderDeneb
LatestExecutionPayloadHeaderElectra
NextWithdrawalIndex NextWithdrawalIndex
NextWithdrawalValidatorIndex NextWithdrawalValidatorIndex
HistoricalSummaries HistoricalSummaries

View File

@@ -269,7 +269,7 @@ func TestExtractDataType(t *testing.T) {
chain: &mock.ChainService{ValidatorsRoot: [32]byte{}}, chain: &mock.ChainService{ValidatorsRoot: [32]byte{}},
}, },
wantBlock: func() interfaces.ReadOnlySignedBeaconBlock { wantBlock: func() interfaces.ReadOnlySignedBeaconBlock {
wsb, err := blocks.NewSignedBeaconBlock(&ethpb.SignedBeaconBlockElectra{Block: &ethpb.BeaconBlockElectra{Body: &ethpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{}}}}) wsb, err := blocks.NewSignedBeaconBlock(&ethpb.SignedBeaconBlockElectra{Block: &ethpb.BeaconBlockElectra{Body: &ethpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadDeneb{}}}})
require.NoError(t, err) require.NoError(t, err)
return wsb return wsb
}(), }(),

View File

@@ -40,6 +40,7 @@ var placeholderFields = []string{
"MAX_BLOB_COMMITMENTS_PER_BLOCK", // Compile time constant on BeaconBlockBodyDeneb.blob_kzg_commitments. "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_BYTES_PER_TRANSACTION", // Used for ssz of EL transactions. Unused in Prysm.
"MAX_EXTRA_DATA_BYTES", // Compile time constant on ExecutionPayload.extra_data. "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. "MAX_TRANSACTIONS_PER_PAYLOAD", // Compile time constant on ExecutionPayload.transactions.
"REORG_HEAD_WEIGHT_THRESHOLD", "REORG_HEAD_WEIGHT_THRESHOLD",
"SAMPLES_PER_SLOT", "SAMPLES_PER_SLOT",

View File

@@ -14,8 +14,6 @@ import (
"google.golang.org/protobuf/proto" "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 // 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 // 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. // 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) return WrappedExecutionPayloadDeneb(pbStruct)
case *enginev1.ExecutionPayloadDenebWithValueAndBlobsBundle: case *enginev1.ExecutionPayloadDenebWithValueAndBlobsBundle:
return WrappedExecutionPayloadDeneb(pbStruct.Payload) return WrappedExecutionPayloadDeneb(pbStruct.Payload)
case *enginev1.ExecutionPayloadElectra:
return WrappedExecutionPayloadElectra(pbStruct)
case *enginev1.ExecutionPayloadElectraWithValueAndBlobsBundle:
return WrappedExecutionPayloadElectra(pbStruct.Payload)
default: default:
return nil, ErrUnsupportedVersion return nil, ErrUnsupportedVersion
} }
@@ -787,74 +781,7 @@ func PayloadToHeaderDeneb(payload interfaces.ExecutionData) (*enginev1.Execution
}, nil }, nil
} }
// PayloadToHeaderElectra converts `payload` into execution payload header format. var PayloadToHeaderElectra = PayloadToHeaderDeneb
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
}
// IsEmptyExecutionData checks if an execution data is empty underneath. If a single field has // IsEmptyExecutionData checks if an execution data is empty underneath. If a single field has
// a non-zero value, this function will return false. // a non-zero value, this function will return false.
@@ -913,20 +840,6 @@ func IsEmptyExecutionData(data interfaces.ExecutionData) (bool, error) {
if data.Timestamp() != 0 { if data.Timestamp() != 0 {
return false, nil 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 return true, nil
} }
@@ -948,6 +861,8 @@ func WrappedExecutionPayloadHeaderDeneb(p *enginev1.ExecutionPayloadHeaderDeneb)
return w, nil return w, nil
} }
var WrappedExecutionPayloadHeaderElectra = WrappedExecutionPayloadHeaderDeneb
// IsNil checks if the underlying data is nil. // IsNil checks if the underlying data is nil.
func (e executionPayloadHeaderDeneb) IsNil() bool { func (e executionPayloadHeaderDeneb) IsNil() bool {
return e.p == nil return e.p == nil
@@ -1106,6 +1021,8 @@ func WrappedExecutionPayloadDeneb(p *enginev1.ExecutionPayloadDeneb) (interfaces
return w, nil return w, nil
} }
var WrappedExecutionPayloadElectra = WrappedExecutionPayloadDeneb
// IsNil checks if the underlying data is nil. // IsNil checks if the underlying data is nil.
func (e executionPayloadDeneb) IsNil() bool { func (e executionPayloadDeneb) IsNil() bool {
return e.p == nil return e.p == nil
@@ -1243,342 +1160,3 @@ func (e executionPayloadDeneb) ExcessBlobGas() (uint64, error) {
func (e executionPayloadDeneb) IsBlinded() bool { func (e executionPayloadDeneb) IsBlinded() bool {
return false 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
}

View File

@@ -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 // BuildSignedBeaconBlockFromExecutionPayload takes a signed, blinded beacon block and converts into
// a full, signed beacon block by specifying an execution payload. // a full, signed beacon block by specifying an execution payload.
func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBeaconBlock, payload interface{}) (interfaces.SignedBeaconBlock, error) { // nolint:gocognit 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") return nil, errors.Wrap(err, "could not get execution payload header")
} }
var wrappedPayload interfaces.ExecutionData wrappedPayload, err := getWrappedPayload(payload)
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)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if !empty { if err := checkPayloadAgainstHeader(wrappedPayload, payloadHeader); err != nil {
payloadRoot, err := wrappedPayload.HashTreeRoot() return nil, err
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,
)
}
} }
syncAgg, err := b.Body().SyncAggregate() syncAgg, err := b.Body().SyncAggregate()
if err != nil { if err != nil {
@@ -302,8 +311,12 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea
sig := blk.Signature() sig := blk.Signature()
var fullBlock interface{} var fullBlock interface{}
switch p := payload.(type) { switch blk.Version() {
case *enginev1.ExecutionPayload: case version.Bellatrix:
p, ok := payload.(*enginev1.ExecutionPayload)
if !ok {
return nil, errors.New("payload not of Bellatrix type")
}
var atts []*eth.Attestation var atts []*eth.Attestation
if b.Body().Attestations() != nil { if b.Body().Attestations() != nil {
atts = make([]*eth.Attestation, len(b.Body().Attestations())) atts = make([]*eth.Attestation, len(b.Body().Attestations()))
@@ -347,7 +360,11 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea
}, },
Signature: sig[:], 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() blsToExecutionChanges, err := b.Body().BLSToExecutionChanges()
if err != nil { if err != nil {
return nil, err return nil, err
@@ -396,7 +413,11 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea
}, },
Signature: sig[:], 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() blsToExecutionChanges, err := b.Body().BLSToExecutionChanges()
if err != nil { if err != nil {
return nil, err return nil, err
@@ -450,7 +471,11 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea
}, },
Signature: sig[:], 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() blsToExecutionChanges, err := b.Body().BLSToExecutionChanges()
if err != nil { if err != nil {
return nil, err return nil, err
@@ -481,6 +506,12 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea
attSlashings[i] = s attSlashings[i] = s
} }
} }
er, err := b.Body().ExecutionRequests()
if err != nil {
return nil, err
}
fullBlock = &eth.SignedBeaconBlockElectra{ fullBlock = &eth.SignedBeaconBlockElectra{
Block: &eth.BeaconBlockElectra{ Block: &eth.BeaconBlockElectra{
Slot: b.Slot(), Slot: b.Slot(),
@@ -500,12 +531,13 @@ func BuildSignedBeaconBlockFromExecutionPayload(blk interfaces.ReadOnlySignedBea
ExecutionPayload: p, ExecutionPayload: p,
BlsToExecutionChanges: blsToExecutionChanges, BlsToExecutionChanges: blsToExecutionChanges,
BlobKzgCommitments: commitments, BlobKzgCommitments: commitments,
ExecutionRequests: er,
}, },
}, },
Signature: sig[:], Signature: sig[:],
} }
default: 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) return NewSignedBeaconBlock(fullBlock)

View File

@@ -152,6 +152,42 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e
return nil, err 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(
&eth.SignedBlindedBeaconBlockElectra{
Message: &eth.BlindedBeaconBlockElectra{
Slot: b.block.slot,
ProposerIndex: b.block.proposerIndex,
ParentRoot: b.block.parentRoot[:],
StateRoot: b.block.stateRoot[:],
Body: &eth.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) { switch p := payload.Proto().(type) {
case *enginev1.ExecutionPayload: case *enginev1.ExecutionPayload:
header, err := PayloadToHeader(payload) header, err := PayloadToHeader(payload)
@@ -237,39 +273,6 @@ func (b *SignedBeaconBlock) ToBlinded() (interfaces.ReadOnlySignedBeaconBlock, e
}, },
Signature: b.signature[:], 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(
&eth.SignedBlindedBeaconBlockElectra{
Message: &eth.BlindedBeaconBlockElectra{
Slot: b.block.slot,
ProposerIndex: b.block.proposerIndex,
ParentRoot: b.block.parentRoot[:],
StateRoot: b.block.stateRoot[:],
Body: &eth.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: default:
return nil, fmt.Errorf("%T is not an execution payload header", p) 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 // Version returns the version of the beacon block body
func (b *BeaconBlockBody) Version() int { func (b *BeaconBlockBody) Version() int {
return b.version return b.version

View File

@@ -614,26 +614,22 @@ func hydrateBeaconBlockBodyElectra() *eth.BeaconBlockBodyElectra {
SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength), SyncCommitteeSignature: make([]byte, fieldparams.BLSSignatureLength),
}, },
ExecutionPayload: &pb.ExecutionPayloadElectra{ ExecutionPayload: &pb.ExecutionPayloadElectra{
ParentHash: make([]byte, fieldparams.RootLength), ParentHash: make([]byte, fieldparams.RootLength),
FeeRecipient: make([]byte, 20), FeeRecipient: make([]byte, 20),
StateRoot: make([]byte, fieldparams.RootLength), StateRoot: make([]byte, fieldparams.RootLength),
ReceiptsRoot: make([]byte, fieldparams.RootLength), ReceiptsRoot: make([]byte, fieldparams.RootLength),
LogsBloom: make([]byte, 256), LogsBloom: make([]byte, 256),
PrevRandao: make([]byte, fieldparams.RootLength), PrevRandao: make([]byte, fieldparams.RootLength),
ExtraData: make([]byte, 0), ExtraData: make([]byte, 0),
BaseFeePerGas: make([]byte, fieldparams.RootLength), BaseFeePerGas: make([]byte, fieldparams.RootLength),
BlockHash: make([]byte, fieldparams.RootLength), BlockHash: make([]byte, fieldparams.RootLength),
Transactions: make([][]byte, 0), Transactions: make([][]byte, 0),
Withdrawals: make([]*pb.Withdrawal, 0), Withdrawals: make([]*pb.Withdrawal, 0),
DepositRequests: make([]*pb.DepositRequest, 0), },
WithdrawalRequests: make([]*pb.WithdrawalRequest, 0), ExecutionRequests: &pb.ExecutionRequests{
ConsolidationRequests: make([]*pb.ConsolidationRequest, 0), 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)
}

View File

@@ -12,7 +12,7 @@ import (
) )
const ( 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 logBodyLength = 4 // The log 2 of bodyLength
kzgPosition = 11 // The index of the KZG commitment list in the Body 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 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[:]) copy(layer[10], root[:])
// KZG commitments is not needed // 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 return layer, nil
} }

View File

@@ -42,7 +42,7 @@ func ComputeBlockBodyFieldRoots(ctx context.Context, blockBody *BeaconBlockBody)
case version.Deneb: case version.Deneb:
fieldRoots = make([][]byte, 12) fieldRoots = make([][]byte, 12)
case version.Electra: case version.Electra:
fieldRoots = make([][]byte, 12) fieldRoots = make([][]byte, 13)
default: default:
return nil, fmt.Errorf("unknown block body version %s", version.String(blockBody.version)) 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[:]) 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 return fieldRoots, nil
} }

View File

@@ -531,6 +531,7 @@ func (b *BeaconBlockBody) Proto() (proto.Message, error) {
ExecutionPayloadHeader: ph, ExecutionPayloadHeader: ph,
BlsToExecutionChanges: b.blsToExecutionChanges, BlsToExecutionChanges: b.blsToExecutionChanges,
BlobKzgCommitments: b.blobKzgCommitments, BlobKzgCommitments: b.blobKzgCommitments,
ExecutionRequests: b.executionRequests,
}, nil }, nil
} }
var p *enginev1.ExecutionPayloadElectra var p *enginev1.ExecutionPayloadElectra
@@ -554,6 +555,7 @@ func (b *BeaconBlockBody) Proto() (proto.Message, error) {
ExecutionPayload: p, ExecutionPayload: p,
BlsToExecutionChanges: b.blsToExecutionChanges, BlsToExecutionChanges: b.blsToExecutionChanges,
BlobKzgCommitments: b.blobKzgCommitments, BlobKzgCommitments: b.blobKzgCommitments,
ExecutionRequests: b.executionRequests,
}, nil }, nil
default: default:
@@ -1142,6 +1144,10 @@ func initBlockBodyFromProtoElectra(pb *eth.BeaconBlockBodyElectra) (*BeaconBlock
if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) { if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) {
return nil, err return nil, err
} }
er := pb.ExecutionRequests
if er == nil {
er = &enginev1.ExecutionRequests{}
}
b := &BeaconBlockBody{ b := &BeaconBlockBody{
version: version.Electra, version: version.Electra,
randaoReveal: bytesutil.ToBytes96(pb.RandaoReveal), randaoReveal: bytesutil.ToBytes96(pb.RandaoReveal),
@@ -1156,6 +1162,7 @@ func initBlockBodyFromProtoElectra(pb *eth.BeaconBlockBodyElectra) (*BeaconBlock
executionPayload: p, executionPayload: p,
blsToExecutionChanges: pb.BlsToExecutionChanges, blsToExecutionChanges: pb.BlsToExecutionChanges,
blobKzgCommitments: pb.BlobKzgCommitments, blobKzgCommitments: pb.BlobKzgCommitments,
executionRequests: er,
} }
return b, nil return b, nil
} }
@@ -1170,6 +1177,10 @@ func initBlindedBlockBodyFromProtoElectra(pb *eth.BlindedBeaconBlockBodyElectra)
if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) { if err != nil && !errors.Is(err, consensus_types.ErrNilObjectWrapped) {
return nil, err return nil, err
} }
er := pb.ExecutionRequests
if er == nil {
er = &enginev1.ExecutionRequests{}
}
b := &BeaconBlockBody{ b := &BeaconBlockBody{
version: version.Electra, version: version.Electra,
randaoReveal: bytesutil.ToBytes96(pb.RandaoReveal), randaoReveal: bytesutil.ToBytes96(pb.RandaoReveal),
@@ -1184,6 +1195,7 @@ func initBlindedBlockBodyFromProtoElectra(pb *eth.BlindedBeaconBlockBodyElectra)
executionPayloadHeader: ph, executionPayloadHeader: ph,
blsToExecutionChanges: pb.BlsToExecutionChanges, blsToExecutionChanges: pb.BlsToExecutionChanges,
blobKzgCommitments: pb.BlobKzgCommitments, blobKzgCommitments: pb.BlobKzgCommitments,
executionRequests: er,
} }
return b, nil return b, nil
} }

View File

@@ -5,6 +5,7 @@ import (
field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "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" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
) )
@@ -54,6 +55,7 @@ type BeaconBlockBody struct {
executionPayloadHeader interfaces.ExecutionData executionPayloadHeader interfaces.ExecutionData
blsToExecutionChanges []*eth.SignedBLSToExecutionChange blsToExecutionChanges []*eth.SignedBLSToExecutionChange
blobKzgCommitments [][]byte blobKzgCommitments [][]byte
executionRequests *enginev1.ExecutionRequests
} }
var _ interfaces.ReadOnlyBeaconBlockBody = &BeaconBlockBody{} var _ interfaces.ReadOnlyBeaconBlockBody = &BeaconBlockBody{}

View File

@@ -69,6 +69,7 @@ type ReadOnlyBeaconBlockBody interface {
Execution() (ExecutionData, error) Execution() (ExecutionData, error)
BLSToExecutionChanges() ([]*ethpb.SignedBLSToExecutionChange, error) BLSToExecutionChanges() ([]*ethpb.SignedBLSToExecutionChange, error)
BlobKzgCommitments() ([][]byte, error) BlobKzgCommitments() ([][]byte, error)
ExecutionRequests() (*enginev1.ExecutionRequests, error)
} }
type SignedBeaconBlock interface { type SignedBeaconBlock interface {
@@ -122,10 +123,3 @@ type ExecutionData interface {
Withdrawals() ([]*enginev1.Withdrawal, error) Withdrawals() ([]*enginev1.Withdrawal, error)
WithdrawalsRoot() ([]byte, error) WithdrawalsRoot() ([]byte, error)
} }
type ExecutionDataElectra interface {
ExecutionData
DepositRequests() []*enginev1.DepositRequest
WithdrawalRequests() []*enginev1.WithdrawalRequest
ConsolidationRequests() []*enginev1.ConsolidationRequest
}

View File

@@ -9,6 +9,7 @@ go_library(
"//config/fieldparams:go_default_library", "//config/fieldparams:go_default_library",
"//consensus-types/interfaces:go_default_library", "//consensus-types/interfaces:go_default_library",
"//consensus-types/primitives:go_default_library", "//consensus-types/primitives:go_default_library",
"//proto/engine/v1:go_default_library",
"//proto/eth/v1:go_default_library", "//proto/eth/v1:go_default_library",
"//proto/prysm/v1alpha1:go_default_library", "//proto/prysm/v1alpha1:go_default_library",
"//proto/prysm/v1alpha1/validator-client:go_default_library", "//proto/prysm/v1alpha1/validator-client:go_default_library",

View File

@@ -5,6 +5,7 @@ import (
field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams" field_params "github.com/prysmaticlabs/prysm/v5/config/fieldparams"
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces" "github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives" "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" ethpb "github.com/prysmaticlabs/prysm/v5/proto/eth/v1"
eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client" validatorpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/validator-client"
@@ -273,6 +274,10 @@ func (b *BeaconBlockBody) BlobKzgCommitments() ([][]byte, error) {
panic("implement me") panic("implement me")
} }
func (b *BeaconBlockBody) ExecutionRequests() (*enginev1.ExecutionRequests, error) {
panic("implement me")
}
func (b *BeaconBlockBody) Attestations() []eth.Att { func (b *BeaconBlockBody) Attestations() []eth.Att {
panic("implement me") panic("implement me")
} }

View File

@@ -42,14 +42,13 @@ ssz_gen_marshal(
"ExecutionPayloadHeaderCapella", "ExecutionPayloadHeaderCapella",
"ExecutionPayloadHeaderDeneb", "ExecutionPayloadHeaderDeneb",
"ExecutionPayloadDeneb", "ExecutionPayloadDeneb",
"ExecutionPayloadHeaderElectra",
"ExecutionPayloadElectra",
"BlindedBlobsBundle", "BlindedBlobsBundle",
"BlobsBundle", "BlobsBundle",
"Withdrawal", "Withdrawal",
"WithdrawalRequest", "WithdrawalRequest",
"DepositRequest", "DepositRequest",
"ConsolidationRequest", "ConsolidationRequest",
"ExecutionRequests",
], ],
) )
@@ -75,6 +74,7 @@ go_proto_library(
go_library( go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"electra.go",
"execution_engine.go", "execution_engine.go",
"json_marshal_unmarshal.go", "json_marshal_unmarshal.go",
":ssz_generated_files", # keep ":ssz_generated_files", # keep
@@ -111,6 +111,7 @@ ssz_proto_files(
name = "ssz_proto_files", name = "ssz_proto_files",
srcs = [ srcs = [
"execution_engine.proto", "execution_engine.proto",
"electra.proto",
], ],
config = select({ config = select({
"//conditions:default": "mainnet", "//conditions:default": "mainnet",

View File

@@ -0,0 +1,4 @@
package enginev1
type ExecutionPayloadElectra = ExecutionPayloadDeneb
type ExecutionPayloadHeaderElectra = ExecutionPayloadHeaderDeneb

464
proto/engine/v1/electra.pb.go generated Executable file
View File

@@ -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
}

View File

@@ -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"];
}

File diff suppressed because it is too large Load Diff

View File

@@ -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 // Copy -- Deneb
func (payload *ExecutionPayloadDeneb) Copy() *ExecutionPayloadDeneb { func (payload *ExecutionPayloadDeneb) Copy() *ExecutionPayloadDeneb {
if payload == nil { 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 // Copy -- Deneb
func (payload *ExecutionPayloadHeaderDeneb) Copy() *ExecutionPayloadHeaderDeneb { func (payload *ExecutionPayloadHeaderDeneb) Copy() *ExecutionPayloadHeaderDeneb {
if payload == nil { if payload == nil {

File diff suppressed because it is too large Load Diff

View File

@@ -81,37 +81,6 @@ message ExecutionPayloadDeneb {
uint64 excess_blob_gas = 17; 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 { message ExecutionPayloadCapellaWithValue {
ExecutionPayloadCapella payload = 1; ExecutionPayloadCapella payload = 1;
bytes value = 2; bytes value = 2;
@@ -180,29 +149,6 @@ message ExecutionPayloadHeaderDeneb {
uint64 excess_blob_gas = 17; 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 { message PayloadAttributes {
uint64 timestamp = 1; uint64 timestamp = 1;
bytes prev_randao = 2 [(ethereum.eth.ext.ssz_size) = "32"]; bytes prev_randao = 2 [(ethereum.eth.ext.ssz_size) = "32"];
@@ -281,37 +227,3 @@ message Blob {
message ExchangeCapabilities { message ExchangeCapabilities {
repeated string supported_methods = 1; 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"];
}

View File

@@ -10,14 +10,12 @@ import (
) )
func TestCopyExecutionPayload_Fuzz(t *testing.T) { func TestCopyExecutionPayload_Fuzz(t *testing.T) {
fuzzCopies(t, &enginev1.ExecutionPayloadElectra{})
fuzzCopies(t, &enginev1.ExecutionPayloadDeneb{}) fuzzCopies(t, &enginev1.ExecutionPayloadDeneb{})
fuzzCopies(t, &enginev1.ExecutionPayloadCapella{}) fuzzCopies(t, &enginev1.ExecutionPayloadCapella{})
fuzzCopies(t, &enginev1.ExecutionPayload{}) fuzzCopies(t, &enginev1.ExecutionPayload{})
} }
func TestCopyExecutionPayloadHeader_Fuzz(t *testing.T) { func TestCopyExecutionPayloadHeader_Fuzz(t *testing.T) {
fuzzCopies(t, &enginev1.ExecutionPayloadHeaderElectra{})
fuzzCopies(t, &enginev1.ExecutionPayloadHeaderDeneb{}) fuzzCopies(t, &enginev1.ExecutionPayloadHeaderDeneb{})
fuzzCopies(t, &enginev1.ExecutionPayloadHeaderCapella{}) fuzzCopies(t, &enginev1.ExecutionPayloadHeaderCapella{})
fuzzCopies(t, &enginev1.ExecutionPayloadHeader{}) fuzzCopies(t, &enginev1.ExecutionPayloadHeader{})

View File

@@ -297,37 +297,6 @@ type GetPayloadV3ResponseJson struct {
ShouldOverrideBuilder bool `json:"shouldOverrideBuilder"` 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. // ExecutionPayloadBody represents the engine API ExecutionPayloadV1 or ExecutionPayloadV2 type.
type ExecutionPayloadBody struct { type ExecutionPayloadBody struct {
Transactions []hexutil.Bytes `json:"transactions"` Transactions []hexutil.Bytes `json:"transactions"`
@@ -337,64 +306,6 @@ type ExecutionPayloadBody struct {
ConsolidationRequests []ConsolidationRequestV1 `json:"consolidationRequests"` 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 { type ExecutionPayloadDenebJSON struct {
ParentHash *common.Hash `json:"parentHash"` ParentHash *common.Hash `json:"parentHash"`
FeeRecipient *common.Address `json:"feeRecipient"` 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) { func JsonDepositRequestsToProto(j []DepositRequestV1) ([]*DepositRequest, error) {
reqs := make([]*DepositRequest, len(j)) reqs := make([]*DepositRequest, len(j))
@@ -1128,112 +990,6 @@ func ProtoConsolidationRequestsToJson(reqs []*ConsolidationRequest) []Consolidat
return j 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 { func (e *ExecutionPayloadDenebWithValueAndBlobsBundle) UnmarshalJSON(enc []byte) error {
dec := GetPayloadV3ResponseJson{} dec := GetPayloadV3ResponseJson{}
if err := json.Unmarshal(enc, &dec); err != nil { if err := json.Unmarshal(enc, &dec); err != nil {

View File

@@ -273,161 +273,6 @@ func TestJsonMarshalUnmarshal(t *testing.T) {
bytesutil.PadTo([]byte{'k'}, 131072), bytesutil.PadTo([]byte{'k'}, 131072),
bytesutil.PadTo([]byte{'l'}, 131072)}, pb.BlobsBundle.Blobs) 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) { t.Run("execution block", func(t *testing.T) {
baseFeePerGas := big.NewInt(1770307273) baseFeePerGas := big.NewInt(1770307273)
want := &gethtypes.Header{ want := &gethtypes.Header{

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT. // Code generated by fastssz. DO NOT EDIT.
// Hash: dc11029a7f019f6c900b35f68bbe0a9ff6ca31ba1f7d8c18518cad810690300d // Hash: 13c946aa898cca1afa84687b619bc5a10fc79a46340e98dcfb07dde835d39a0c
package v1 package v1
import ( import (

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT. // Code generated by fastssz. DO NOT EDIT.
// Hash: e1b3713d854395a4c86aa7a0bf0249d9f2764183a636fcc53badddeaf38990f2 // Hash: bc8a0f7f6c8dadac6bcb0eaab2dea4888cc44c5b3f4fe9998a71e15f1a059399
package eth package eth
import ( import (

View File

@@ -29,6 +29,7 @@ const (
Version_BELLATRIX Version = 2 Version_BELLATRIX Version = 2
Version_CAPELLA Version = 3 Version_CAPELLA Version = 3
Version_DENEB Version = 4 Version_DENEB Version = 4
Version_ELECTRA Version = 5
) )
// Enum value maps for Version. // Enum value maps for Version.
@@ -39,6 +40,7 @@ var (
2: "BELLATRIX", 2: "BELLATRIX",
3: "CAPELLA", 3: "CAPELLA",
4: "DENEB", 4: "DENEB",
5: "ELECTRA",
} }
Version_value = map[string]int32{ Version_value = map[string]int32{
"PHASE0": 0, "PHASE0": 0,
@@ -46,6 +48,7 @@ var (
"BELLATRIX": 2, "BELLATRIX": 2,
"CAPELLA": 3, "CAPELLA": 3,
"DENEB": 4, "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{ 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, 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, 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, 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, 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, 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, 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, 0x44, 0x45, 0x4e, 0x45, 0x42, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x45, 0x4c, 0x45, 0x43, 0x54,
0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x52, 0x41, 0x10, 0x05, 0x42, 0x7d, 0x0a, 0x13, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65,
0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x56, 0x65, 0x72,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x73, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x32, 0x67, 0x69, 0x74,
0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69,
0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70,
0x74, 0x68, 0xaa, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x74, 0x68, 0x2f, 0x76, 0x32, 0x3b, 0x65, 0x74, 0x68, 0xaa,
0x68, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x02, 0x0f, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56,
0x45, 0x74, 0x68, 0x5c, 0x76, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 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 ( var (

View File

@@ -29,4 +29,5 @@ enum Version {
BELLATRIX = 2; BELLATRIX = 2;
CAPELLA = 3; CAPELLA = 3;
DENEB = 4; DENEB = 4;
ELECTRA = 5;
} }

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT. // Code generated by fastssz. DO NOT EDIT.
// Hash: c00c1be829cdae457076ef3e840f3af313626147927e503e90fb5585cf242d36 // Hash: bb838fc0c2dfdadd4a8274dd1b438b1051f7b84d7c8e7470900621284dba8f43
package eth package eth
import ( import (

View File

@@ -1,6 +1,9 @@
package eth 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 -- // Copy --
func (sigBlock *SignedBeaconBlock) Copy() *SignedBeaconBlock { func (sigBlock *SignedBeaconBlock) Copy() *SignedBeaconBlock {
@@ -310,6 +313,7 @@ func (body *BlindedBeaconBlockBodyElectra) Copy() *BlindedBeaconBlockBodyElectra
ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(), ExecutionPayloadHeader: body.ExecutionPayloadHeader.Copy(),
BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges),
BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments),
ExecutionRequests: CopyExecutionRequests(body.ExecutionRequests),
} }
} }
@@ -362,6 +366,31 @@ func CopyBlobKZGs(b [][]byte) [][]byte {
return bytesutil.SafeCopy2dBytes(b) 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 -- // Copy --
func (sigBlock *SignedBeaconBlockDeneb) Copy() *SignedBeaconBlockDeneb { func (sigBlock *SignedBeaconBlockDeneb) Copy() *SignedBeaconBlockDeneb {
if sigBlock == nil { if sigBlock == nil {
@@ -451,6 +480,7 @@ func (body *BeaconBlockBodyElectra) Copy() *BeaconBlockBodyElectra {
ExecutionPayload: body.ExecutionPayload.Copy(), ExecutionPayload: body.ExecutionPayload.Copy(),
BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges), BlsToExecutionChanges: CopySlice(body.BlsToExecutionChanges),
BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments), BlobKzgCommitments: CopyBlobKZGs(body.BlobKzgCommitments),
ExecutionRequests: CopyExecutionRequests(body.ExecutionRequests),
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -19,6 +19,7 @@ import "proto/eth/ext/options.proto";
import "proto/prysm/v1alpha1/attestation.proto"; import "proto/prysm/v1alpha1/attestation.proto";
import "proto/prysm/v1alpha1/withdrawals.proto"; import "proto/prysm/v1alpha1/withdrawals.proto";
import "proto/engine/v1/execution_engine.proto"; import "proto/engine/v1/execution_engine.proto";
import "proto/engine/v1/electra.proto";
option csharp_namespace = "Ethereum.Eth.v1alpha1"; option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth"; option go_package = "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1;eth";
@@ -817,12 +818,14 @@ message BeaconBlockBodyElectra {
SyncAggregate sync_aggregate = 9; SyncAggregate sync_aggregate = 9;
// Execution payload from the execution chain. New in Bellatrix network upgrade. // 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. // 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 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 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 { message SignedBlindedBeaconBlockElectra {
@@ -880,12 +883,14 @@ message BlindedBeaconBlockBodyElectra {
SyncAggregate sync_aggregate = 9; SyncAggregate sync_aggregate = 9;
// Execution payload header from the execution chain. New in Bellatrix network upgrade to accommodate MEV interaction. // 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. // 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 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 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 { message ValidatorRegistrationV1 {

View File

@@ -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"` 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"` 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"` 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"` 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"` 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"` 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 return nil
} }
func (x *BeaconStateElectra) GetLatestExecutionPayloadHeader() *v1.ExecutionPayloadHeaderElectra { func (x *BeaconStateElectra) GetLatestExecutionPayloadHeader() *v1.ExecutionPayloadHeaderDeneb {
if x != nil { if x != nil {
return x.LatestExecutionPayloadHeader 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 0x44, 0x65, 0x6e, 0x65, 0x62, 0x52, 0x1c, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x45, 0x78, 0x65,
0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x48, 0x65, 0x61,
0x65, 0x61, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68,
0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xf9, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xf9, 0x55, 0x20,
0x55, 0x20, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x01, 0x28, 0x04, 0x52, 0x13, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61,
0x72, 0x61, 0x77, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x97, 0x01, 0x0a, 0x1f, 0x6e, 0x77, 0x61, 0x6c, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x97, 0x01, 0x0a, 0x1f, 0x6e, 0x65, 0x78,
0x65, 0x78, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x76, 0x74, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x5f, 0x76, 0x61, 0x6c,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xfa, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xfa, 0x55, 0x20,
0x55, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62,
0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65,
0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69,
0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49,
0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1c, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x1c, 0x6e, 0x65, 0x78, 0x74, 0x57, 0x69, 0x74, 0x68, 0x64, 0x72,
0x64, 0x72, 0x61, 0x77, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x61, 0x77, 0x61, 0x6c, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64,
0x6e, 0x64, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x14, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x65, 0x78, 0x12, 0x6a, 0x0a, 0x14, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c,
0x61, 0x6c, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0xfb, 0x55, 0x20, 0x5f, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x18, 0xfb, 0x55, 0x20, 0x03, 0x28,
0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x74, 0x68,
0x74, 0x68, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72,
0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x42, 0x0c, 0x92, 0xb5, 0x18,
0xb5, 0x18, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x08, 0x31, 0x36, 0x37, 0x37, 0x37, 0x32, 0x31, 0x36, 0x52, 0x13, 0x68, 0x69, 0x73, 0x74, 0x6f,
0x74, 0x6f, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x72, 0x69, 0x63, 0x61, 0x6c, 0x53, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x69, 0x65, 0x73, 0x12, 0x40,
0x12, 0x40, 0x0a, 0x1c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x0a, 0x1c, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73,
0x65, 0x73, 0x74, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x74, 0x73, 0x5f, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0xe1,
0x18, 0xe1, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5d, 0x20, 0x01, 0x28, 0x04, 0x52, 0x19, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x53, 0x74, 0x61, 0x72, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78,
0x65, 0x78, 0x12, 0x83, 0x01, 0x0a, 0x1a, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x62, 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, 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, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74,
0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f,
0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x63, 0x6f, 0x6e, 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, 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, 0x14, 0x65, 0x78, 0x69, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f,
0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x7d, 0x0a, 0x17, 0x65, 0x78, 0x69, 0x74, 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, 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, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d,
0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76,
0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 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, 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, 0x69, 0x52, 0x1d, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x77, 0x0a, 0x13, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x54, 0x6f, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65,
0x65, 0x73, 0x74, 0x5f, 0x65, 0x78, 0x69, 0x74, 0x5f, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0xe4, 0x12, 0x89, 0x01, 0x0a, 0x1c, 0x65, 0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x5f, 0x63, 0x6f,
0x5d, 0x20, 0x01, 0x28, 0x04, 0x42, 0x46, 0x82, 0xb5, 0x18, 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 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, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c,
0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f,
0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61,
0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x52, 0x11, 0x65, 0x31, 0x3b, 0x65, 0x74, 0x68, 0xaa, 0x02, 0x15, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
0x61, 0x72, 0x6c, 0x69, 0x65, 0x73, 0x74, 0x45, 0x78, 0x69, 0x74, 0x45, 0x70, 0x6f, 0x63, 0x68, 0x2e, 0x45, 0x74, 0x68, 0x2e, 0x56, 0x31, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, 0x02, 0x15,
0x12, 0x8f, 0x01, 0x0a, 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x74, 0x68, 0x5c, 0x76, 0x31, 0x61,
0x6f, 0x6e, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
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,
} }
var ( var (
@@ -3285,10 +3285,9 @@ var file_proto_prysm_v1alpha1_beacon_state_proto_goTypes = []interface{}{
(*v1.ExecutionPayloadHeader)(nil), // 23: ethereum.engine.v1.ExecutionPayloadHeader (*v1.ExecutionPayloadHeader)(nil), // 23: ethereum.engine.v1.ExecutionPayloadHeader
(*v1.ExecutionPayloadHeaderCapella)(nil), // 24: ethereum.engine.v1.ExecutionPayloadHeaderCapella (*v1.ExecutionPayloadHeaderCapella)(nil), // 24: ethereum.engine.v1.ExecutionPayloadHeaderCapella
(*v1.ExecutionPayloadHeaderDeneb)(nil), // 25: ethereum.engine.v1.ExecutionPayloadHeaderDeneb (*v1.ExecutionPayloadHeaderDeneb)(nil), // 25: ethereum.engine.v1.ExecutionPayloadHeaderDeneb
(*v1.ExecutionPayloadHeaderElectra)(nil), // 26: ethereum.engine.v1.ExecutionPayloadHeaderElectra (*PendingBalanceDeposit)(nil), // 26: ethereum.eth.v1alpha1.PendingBalanceDeposit
(*PendingBalanceDeposit)(nil), // 27: ethereum.eth.v1alpha1.PendingBalanceDeposit (*PendingPartialWithdrawal)(nil), // 27: ethereum.eth.v1alpha1.PendingPartialWithdrawal
(*PendingPartialWithdrawal)(nil), // 28: ethereum.eth.v1alpha1.PendingPartialWithdrawal (*PendingConsolidation)(nil), // 28: ethereum.eth.v1alpha1.PendingConsolidation
(*PendingConsolidation)(nil), // 29: ethereum.eth.v1alpha1.PendingConsolidation
} }
var file_proto_prysm_v1alpha1_beacon_state_proto_depIdxs = []int32{ var file_proto_prysm_v1alpha1_beacon_state_proto_depIdxs = []int32{
2, // 0: ethereum.eth.v1alpha1.BeaconState.fork:type_name -> ethereum.eth.v1alpha1.Fork 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 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, // 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 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 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 26, // 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 27, // 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 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 output_type
72, // [72:72] is the sub-list for method input_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 type_name

View File

@@ -388,7 +388,7 @@ message BeaconStateElectra {
SyncCommittee next_sync_committee = 9003; SyncCommittee next_sync_committee = 9003;
// Fields introduced in Bellatrix fork [10001-11000] // 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] // Fields introduced in Capella fork [11001-12000]
uint64 next_withdrawal_index = 11001; uint64 next_withdrawal_index = 11001;

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT. // Code generated by fastssz. DO NOT EDIT.
// Hash: 61890aa32d72c0c0325f0bf6dd44776068840a9d50a102e4c3c53ac46cf66567 // Hash: 693cad07de8560b2681132d912aebb927e668fe15e5cb9f42e8a36bbac6e2c5e
package eth package eth
import ( import (

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT. // Code generated by fastssz. DO NOT EDIT.
// Hash: 13b762a7d53ab6cf5d5ffb582d580edb05efc65de762692f09af914819d3bb3e // Hash: a5507ef7d71897486989f37eb4dbb19fc2c49e7c47f244291a9f3122c9bfe546
package eth package eth
import ( import (

View File

@@ -884,6 +884,8 @@ func genPayloadDeneb() *enginev1.ExecutionPayloadDeneb {
} }
} }
var genPayloadElectra = genPayloadDeneb
func genPayloadHeader() *enginev1.ExecutionPayloadHeader { func genPayloadHeader() *enginev1.ExecutionPayloadHeader {
return &enginev1.ExecutionPayloadHeader{ return &enginev1.ExecutionPayloadHeader{
ParentHash: bytes(32), ParentHash: bytes(32),
@@ -945,6 +947,8 @@ func genPayloadHeaderDeneb() *enginev1.ExecutionPayloadHeaderDeneb {
} }
} }
var genPayloadHeaderElectra = genPayloadHeaderDeneb
func genWithdrawals(num int) []*enginev1.Withdrawal { func genWithdrawals(num int) []*enginev1.Withdrawal {
ws := make([]*enginev1.Withdrawal, num) ws := make([]*enginev1.Withdrawal, num)
for i := 0; i < num; i++ { for i := 0; i < num; i++ {
@@ -1049,34 +1053,10 @@ func genBlindedBeaconBlockBodyElectra() *v1alpha1.BlindedBeaconBlockBodyElectra
Deposits: genDeposits(5), Deposits: genDeposits(5),
VoluntaryExits: genSignedVoluntaryExits(12), VoluntaryExits: genSignedVoluntaryExits(12),
SyncAggregate: genSyncAggregate(), SyncAggregate: genSyncAggregate(),
ExecutionPayloadHeader: genExecutionPayloadHeaderElectra(), ExecutionPayloadHeader: genPayloadHeaderElectra(),
BlsToExecutionChanges: genBLSToExecutionChanges(10), BlsToExecutionChanges: genBLSToExecutionChanges(10),
BlobKzgCommitments: getKZGCommitments(4), BlobKzgCommitments: getKZGCommitments(4),
} ExecutionRequests: genExecutionRequests(),
}
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),
} }
} }
@@ -1108,34 +1088,18 @@ func genBeaconBlockBodyElectra() *v1alpha1.BeaconBlockBodyElectra {
Deposits: genDeposits(5), Deposits: genDeposits(5),
VoluntaryExits: genSignedVoluntaryExits(12), VoluntaryExits: genSignedVoluntaryExits(12),
SyncAggregate: genSyncAggregate(), SyncAggregate: genSyncAggregate(),
ExecutionPayload: genExecutionPayloadElectra(), ExecutionPayload: genPayloadElectra(),
BlsToExecutionChanges: genBLSToExecutionChanges(10), BlsToExecutionChanges: genBLSToExecutionChanges(10),
BlobKzgCommitments: getKZGCommitments(4), BlobKzgCommitments: getKZGCommitments(4),
ExecutionRequests: genExecutionRequests(),
} }
} }
func genExecutionPayloadElectra() *enginev1.ExecutionPayloadElectra { func genExecutionRequests() *enginev1.ExecutionRequests {
return &enginev1.ExecutionPayloadElectra{ return &enginev1.ExecutionRequests{
ParentHash: bytes(32), Deposits: genDepositRequests(10),
FeeRecipient: bytes(20), Withdrawals: genWithdrawalRequests(10),
StateRoot: bytes(32), Consolidations: genConsolidationRequests(10),
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),
} }
} }

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT. // Code generated by fastssz. DO NOT EDIT.
// Hash: adfca9994daf736f0526568d87329503d997b98308a409e71cd510115380af5a // Hash: 4c3e6932bf84838e8de21e5c121c14d03cbccb051c3990d3b924932f531f4d30
package eth package eth
import ( import (

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT. // Code generated by fastssz. DO NOT EDIT.
// Hash: 502599304fd370b8602d212eaf1956fe5bf034fe59c75d1a3a6e3db8bcde291a // Hash: 6d900c40d922575c27ef51a244f7bf935f56aa440017288a3405a3025d7750a6
package eth package eth
import ( import (
@@ -1126,7 +1126,7 @@ func (b *BeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) {
// MarshalSSZTo ssz marshals the BeaconBlockBodyElectra object to a target array // MarshalSSZTo ssz marshals the BeaconBlockBodyElectra object to a target array
func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf dst = buf
offset := int(392) offset := int(396)
// Field (0) 'RandaoReveal' // Field (0) 'RandaoReveal'
if size := len(b.RandaoReveal); size != 96 { if size := len(b.RandaoReveal); size != 96 {
@@ -1187,7 +1187,7 @@ func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error
// Offset (9) 'ExecutionPayload' // Offset (9) 'ExecutionPayload'
dst = ssz.WriteOffset(dst, offset) dst = ssz.WriteOffset(dst, offset)
if b.ExecutionPayload == nil { if b.ExecutionPayload == nil {
b.ExecutionPayload = new(v1.ExecutionPayloadElectra) b.ExecutionPayload = new(v1.ExecutionPayloadDeneb)
} }
offset += b.ExecutionPayload.SizeSSZ() offset += b.ExecutionPayload.SizeSSZ()
@@ -1199,6 +1199,13 @@ func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error
dst = ssz.WriteOffset(dst, offset) dst = ssz.WriteOffset(dst, offset)
offset += len(b.BlobKzgCommitments) * 48 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' // Field (3) 'ProposerSlashings'
if size := len(b.ProposerSlashings); size > 16 { if size := len(b.ProposerSlashings); size > 16 {
err = ssz.ErrListTooBigFn("--.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]...) dst = append(dst, b.BlobKzgCommitments[ii]...)
} }
// Field (12) 'ExecutionRequests'
if dst, err = b.ExecutionRequests.MarshalSSZTo(dst); err != nil {
return
}
return return
} }
@@ -1304,12 +1316,12 @@ func (b *BeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error
func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error {
var err error var err error
size := uint64(len(buf)) size := uint64(len(buf))
if size < 392 { if size < 396 {
return ssz.ErrSize return ssz.ErrSize
} }
tail := buf 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' // Field (0) 'RandaoReveal'
if cap(b.RandaoReveal) == 0 { if cap(b.RandaoReveal) == 0 {
@@ -1336,7 +1348,7 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error {
return ssz.ErrOffset return ssz.ErrOffset
} }
if o3 != 392 { if o3 != 396 {
return ssz.ErrInvalidVariableOffset return ssz.ErrInvalidVariableOffset
} }
@@ -1383,6 +1395,11 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error {
return ssz.ErrOffset return ssz.ErrOffset
} }
// Offset (12) 'ExecutionRequests'
if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 {
return ssz.ErrOffset
}
// Field (3) 'ProposerSlashings' // Field (3) 'ProposerSlashings'
{ {
buf = tail[o3:o4] buf = tail[o3:o4]
@@ -1485,7 +1502,7 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error {
{ {
buf = tail[o9:o10] buf = tail[o9:o10]
if b.ExecutionPayload == nil { if b.ExecutionPayload == nil {
b.ExecutionPayload = new(v1.ExecutionPayloadElectra) b.ExecutionPayload = new(v1.ExecutionPayloadDeneb)
} }
if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil { if err = b.ExecutionPayload.UnmarshalSSZ(buf); err != nil {
return err return err
@@ -1512,7 +1529,7 @@ func (b *BeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error {
// Field (11) 'BlobKzgCommitments' // Field (11) 'BlobKzgCommitments'
{ {
buf = tail[o11:] buf = tail[o11:o12]
num, err := ssz.DivideInt2(len(buf), 48, 4096) num, err := ssz.DivideInt2(len(buf), 48, 4096)
if err != nil { if err != nil {
return err 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]...) 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 return err
} }
// SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyElectra object // SizeSSZ returns the ssz encoded size in bytes for the BeaconBlockBodyElectra object
func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) { func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) {
size = 392 size = 396
// Field (3) 'ProposerSlashings' // Field (3) 'ProposerSlashings'
size += len(b.ProposerSlashings) * 416 size += len(b.ProposerSlashings) * 416
@@ -1555,7 +1583,7 @@ func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) {
// Field (9) 'ExecutionPayload' // Field (9) 'ExecutionPayload'
if b.ExecutionPayload == nil { if b.ExecutionPayload == nil {
b.ExecutionPayload = new(v1.ExecutionPayloadElectra) b.ExecutionPayload = new(v1.ExecutionPayloadDeneb)
} }
size += b.ExecutionPayload.SizeSSZ() size += b.ExecutionPayload.SizeSSZ()
@@ -1565,6 +1593,12 @@ func (b *BeaconBlockBodyElectra) SizeSSZ() (size int) {
// Field (11) 'BlobKzgCommitments' // Field (11) 'BlobKzgCommitments'
size += len(b.BlobKzgCommitments) * 48 size += len(b.BlobKzgCommitments) * 48
// Field (12) 'ExecutionRequests'
if b.ExecutionRequests == nil {
b.ExecutionRequests = new(v1.ExecutionRequests)
}
size += b.ExecutionRequests.SizeSSZ()
return return
} }
@@ -1721,6 +1755,11 @@ func (b *BeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err error) {
hh.MerkleizeWithMixin(subIndx, numItems, 4096) hh.MerkleizeWithMixin(subIndx, numItems, 4096)
} }
// Field (12) 'ExecutionRequests'
if err = b.ExecutionRequests.HashTreeRootWith(hh); err != nil {
return
}
hh.Merkleize(indx) hh.Merkleize(indx)
return return
} }
@@ -1989,7 +2028,7 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZ() ([]byte, error) {
// MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyElectra object to a target array // MarshalSSZTo ssz marshals the BlindedBeaconBlockBodyElectra object to a target array
func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) { func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) {
dst = buf dst = buf
offset := int(392) offset := int(396)
// Field (0) 'RandaoReveal' // Field (0) 'RandaoReveal'
if size := len(b.RandaoReveal); size != 96 { if size := len(b.RandaoReveal); size != 96 {
@@ -2050,7 +2089,7 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, er
// Offset (9) 'ExecutionPayloadHeader' // Offset (9) 'ExecutionPayloadHeader'
dst = ssz.WriteOffset(dst, offset) dst = ssz.WriteOffset(dst, offset)
if b.ExecutionPayloadHeader == nil { if b.ExecutionPayloadHeader == nil {
b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb)
} }
offset += b.ExecutionPayloadHeader.SizeSSZ() offset += b.ExecutionPayloadHeader.SizeSSZ()
@@ -2062,6 +2101,13 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, er
dst = ssz.WriteOffset(dst, offset) dst = ssz.WriteOffset(dst, offset)
offset += len(b.BlobKzgCommitments) * 48 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' // Field (3) 'ProposerSlashings'
if size := len(b.ProposerSlashings); size > 16 { if size := len(b.ProposerSlashings); size > 16 {
err = ssz.ErrListTooBigFn("--.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]...) dst = append(dst, b.BlobKzgCommitments[ii]...)
} }
// Field (12) 'ExecutionRequests'
if dst, err = b.ExecutionRequests.MarshalSSZTo(dst); err != nil {
return
}
return return
} }
@@ -2167,12 +2218,12 @@ func (b *BlindedBeaconBlockBodyElectra) MarshalSSZTo(buf []byte) (dst []byte, er
func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error { func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error {
var err error var err error
size := uint64(len(buf)) size := uint64(len(buf))
if size < 392 { if size < 396 {
return ssz.ErrSize return ssz.ErrSize
} }
tail := buf 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' // Field (0) 'RandaoReveal'
if cap(b.RandaoReveal) == 0 { if cap(b.RandaoReveal) == 0 {
@@ -2199,7 +2250,7 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error {
return ssz.ErrOffset return ssz.ErrOffset
} }
if o3 != 392 { if o3 != 396 {
return ssz.ErrInvalidVariableOffset return ssz.ErrInvalidVariableOffset
} }
@@ -2246,6 +2297,11 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error {
return ssz.ErrOffset return ssz.ErrOffset
} }
// Offset (12) 'ExecutionRequests'
if o12 = ssz.ReadOffset(buf[392:396]); o12 > size || o11 > o12 {
return ssz.ErrOffset
}
// Field (3) 'ProposerSlashings' // Field (3) 'ProposerSlashings'
{ {
buf = tail[o3:o4] buf = tail[o3:o4]
@@ -2348,7 +2404,7 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error {
{ {
buf = tail[o9:o10] buf = tail[o9:o10]
if b.ExecutionPayloadHeader == nil { if b.ExecutionPayloadHeader == nil {
b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb)
} }
if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { if err = b.ExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil {
return err return err
@@ -2375,7 +2431,7 @@ func (b *BlindedBeaconBlockBodyElectra) UnmarshalSSZ(buf []byte) error {
// Field (11) 'BlobKzgCommitments' // Field (11) 'BlobKzgCommitments'
{ {
buf = tail[o11:] buf = tail[o11:o12]
num, err := ssz.DivideInt2(len(buf), 48, 4096) num, err := ssz.DivideInt2(len(buf), 48, 4096)
if err != nil { if err != nil {
return err 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]...) 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 return err
} }
// SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyElectra object // SizeSSZ returns the ssz encoded size in bytes for the BlindedBeaconBlockBodyElectra object
func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) { func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) {
size = 392 size = 396
// Field (3) 'ProposerSlashings' // Field (3) 'ProposerSlashings'
size += len(b.ProposerSlashings) * 416 size += len(b.ProposerSlashings) * 416
@@ -2418,7 +2485,7 @@ func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) {
// Field (9) 'ExecutionPayloadHeader' // Field (9) 'ExecutionPayloadHeader'
if b.ExecutionPayloadHeader == nil { if b.ExecutionPayloadHeader == nil {
b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) b.ExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb)
} }
size += b.ExecutionPayloadHeader.SizeSSZ() size += b.ExecutionPayloadHeader.SizeSSZ()
@@ -2428,6 +2495,12 @@ func (b *BlindedBeaconBlockBodyElectra) SizeSSZ() (size int) {
// Field (11) 'BlobKzgCommitments' // Field (11) 'BlobKzgCommitments'
size += len(b.BlobKzgCommitments) * 48 size += len(b.BlobKzgCommitments) * 48
// Field (12) 'ExecutionRequests'
if b.ExecutionRequests == nil {
b.ExecutionRequests = new(v1.ExecutionRequests)
}
size += b.ExecutionRequests.SizeSSZ()
return return
} }
@@ -2584,6 +2657,11 @@ func (b *BlindedBeaconBlockBodyElectra) HashTreeRootWith(hh *ssz.Hasher) (err er
hh.MerkleizeWithMixin(subIndx, numItems, 4096) hh.MerkleizeWithMixin(subIndx, numItems, 4096)
} }
// Field (12) 'ExecutionRequests'
if err = b.ExecutionRequests.HashTreeRootWith(hh); err != nil {
return
}
hh.Merkleize(indx) hh.Merkleize(indx)
return return
} }
@@ -2764,7 +2842,7 @@ func (b *BeaconStateElectra) MarshalSSZTo(buf []byte) (dst []byte, err error) {
// Offset (24) 'LatestExecutionPayloadHeader' // Offset (24) 'LatestExecutionPayloadHeader'
dst = ssz.WriteOffset(dst, offset) dst = ssz.WriteOffset(dst, offset)
if b.LatestExecutionPayloadHeader == nil { if b.LatestExecutionPayloadHeader == nil {
b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb)
} }
offset += b.LatestExecutionPayloadHeader.SizeSSZ() offset += b.LatestExecutionPayloadHeader.SizeSSZ()
@@ -3250,7 +3328,7 @@ func (b *BeaconStateElectra) UnmarshalSSZ(buf []byte) error {
{ {
buf = tail[o24:o27] buf = tail[o24:o27]
if b.LatestExecutionPayloadHeader == nil { if b.LatestExecutionPayloadHeader == nil {
b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb)
} }
if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil { if err = b.LatestExecutionPayloadHeader.UnmarshalSSZ(buf); err != nil {
return err return err
@@ -3358,7 +3436,7 @@ func (b *BeaconStateElectra) SizeSSZ() (size int) {
// Field (24) 'LatestExecutionPayloadHeader' // Field (24) 'LatestExecutionPayloadHeader'
if b.LatestExecutionPayloadHeader == nil { if b.LatestExecutionPayloadHeader == nil {
b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderElectra) b.LatestExecutionPayloadHeader = new(v1.ExecutionPayloadHeaderDeneb)
} }
size += b.LatestExecutionPayloadHeader.SizeSSZ() size += b.LatestExecutionPayloadHeader.SizeSSZ()

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT. // Code generated by fastssz. DO NOT EDIT.
// Hash: 6fe6b8a92c8bbb2fc95fc59fca0b73d1c787c00ec01137d73193b5b251e40c12 // Hash: 4cb7a5705004491db2ef29a5080a4cc56a1b618de948a86f9e5275858b48e6c4
package eth package eth
import ( import (

View File

@@ -1,5 +1,5 @@
// Code generated by fastssz. DO NOT EDIT. // Code generated by fastssz. DO NOT EDIT.
// Hash: 0858b1e553b943e9cbdba001604002341da98f82976954a2eafa7a97632f485c // Hash: 0afa289ce68dc2913d8000d495c6069832f35b66a6c0cf1bb0d1299fcad7047a
package eth package eth
import ( import (

View File

@@ -7,5 +7,6 @@ import (
) )
func TestMainnet_Electra_EpochProcessing_Slashings(t *testing.T) { func TestMainnet_Electra_EpochProcessing_Slashings(t *testing.T) {
t.Skip("slashing processing missing")
epoch_processing.RunSlashingsTests(t, "mainnet") epoch_processing.RunSlashingsTests(t, "mainnet")
} }

View File

@@ -7,5 +7,6 @@ import (
) )
func TestMinimal_Electra_EpochProcessing_Slashings(t *testing.T) { func TestMinimal_Electra_EpochProcessing_Slashings(t *testing.T) {
t.Skip("slashing processing missing")
epoch_processing.RunSlashingsTests(t, "minimal") epoch_processing.RunSlashingsTests(t, "minimal")
} }

View File

@@ -28,15 +28,11 @@ func RunConsolidationTest(t *testing.T, config string, fork string, block blockW
blk, err := block(consolidationSSZ) blk, err := block(consolidationSSZ)
require.NoError(t, err) require.NoError(t, err)
RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { 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 { if err != nil {
return nil, err return nil, err
} }
eed, ok := ed.(interfaces.ExecutionDataElectra) return s, electra.ProcessConsolidationRequests(ctx, s, er.Consolidations)
if !ok {
t.Fatal("block does not have execution data for electra")
}
return s, electra.ProcessConsolidationRequests(ctx, s, eed.ConsolidationRequests())
}) })
}) })
} }

View File

@@ -27,11 +27,9 @@ func RunDepositRequestsTest(t *testing.T, config string, fork string, block bloc
blk, err := block(depositRequestSSZ) blk, err := block(depositRequestSSZ)
require.NoError(t, err) require.NoError(t, err)
RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) {
e, err := b.Block().Body().Execution() e, err := b.Block().Body().ExecutionRequests()
require.NoError(t, err, "Failed to get execution") require.NoError(t, err, "Failed to get execution requests")
ee, ok := e.(interfaces.ExecutionDataElectra) return electra.ProcessDepositRequests(ctx, s, e.Deposits)
require.Equal(t, true, ok, "Invalid execution payload")
return electra.ProcessDepositRequests(ctx, s, ee.DepositRequests())
}) })
}) })
} }

View File

@@ -31,11 +31,9 @@ func RunWithdrawalRequestTest(t *testing.T, config string, fork string, block bl
require.NoError(t, err) require.NoError(t, err)
RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) { RunBlockOperationTest(t, folderPath, blk, sszToState, func(ctx context.Context, s state.BeaconState, b interfaces.ReadOnlySignedBeaconBlock) (state.BeaconState, error) {
bod := b.Block().Body() bod := b.Block().Body()
e, err := bod.Execution() e, err := bod.ExecutionRequests()
require.NoError(t, err) require.NoError(t, err)
exe, ok := e.(interfaces.ExecutionDataElectra) return electra.ProcessWithdrawalRequests(ctx, s, e.Withdrawals)
require.Equal(t, true, ok)
return electra.ProcessWithdrawalRequests(ctx, s, exe.WithdrawalRequests())
}) })
}) })
} }

View File

@@ -17,8 +17,11 @@ func blockWithConsolidation(ssz []byte) (interfaces.SignedBeaconBlock, error) {
if err := cr.UnmarshalSSZ(ssz); err != nil { if err := cr.UnmarshalSSZ(ssz); err != nil {
return nil, err return nil, err
} }
er := &enginev1.ExecutionRequests{
Consolidations: []*enginev1.ConsolidationRequest{cr},
}
b := util.NewBeaconBlockElectra() b := util.NewBeaconBlockElectra()
b.Block.Body = &ethpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{ConsolidationRequests: []*enginev1.ConsolidationRequest{cr}}} b.Block.Body = &ethpb.BeaconBlockBodyElectra{ExecutionRequests: er}
return blocks.NewSignedBeaconBlock(b) return blocks.NewSignedBeaconBlock(b)
} }

View File

@@ -17,8 +17,11 @@ func blockWithDepositRequest(ssz []byte) (interfaces.SignedBeaconBlock, error) {
if err := dr.UnmarshalSSZ(ssz); err != nil { if err := dr.UnmarshalSSZ(ssz); err != nil {
return nil, err return nil, err
} }
er := &enginev1.ExecutionRequests{
Deposits: []*enginev1.DepositRequest{dr},
}
b := util.NewBeaconBlockElectra() b := util.NewBeaconBlockElectra()
b.Block.Body = &ethpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{DepositRequests: []*enginev1.DepositRequest{dr}}} b.Block.Body = &ethpb.BeaconBlockBodyElectra{ExecutionRequests: er}
return blocks.NewSignedBeaconBlock(b) return blocks.NewSignedBeaconBlock(b)
} }

View File

@@ -13,12 +13,15 @@ import (
) )
func blockWithWithdrawalRequest(ssz []byte) (interfaces.SignedBeaconBlock, error) { func blockWithWithdrawalRequest(ssz []byte) (interfaces.SignedBeaconBlock, error) {
dr := &enginev1.WithdrawalRequest{} wr := &enginev1.WithdrawalRequest{}
if err := dr.UnmarshalSSZ(ssz); err != nil { if err := wr.UnmarshalSSZ(ssz); err != nil {
return nil, err return nil, err
} }
er := &enginev1.ExecutionRequests{
Withdrawals: []*enginev1.WithdrawalRequest{wr},
}
b := util.NewBeaconBlockElectra() b := util.NewBeaconBlockElectra()
b.Block.Body = &ethpb.BeaconBlockBodyElectra{ExecutionPayload: &enginev1.ExecutionPayloadElectra{WithdrawalRequests: []*enginev1.WithdrawalRequest{dr}}} b.Block.Body = &ethpb.BeaconBlockBodyElectra{ExecutionRequests: er}
return blocks.NewSignedBeaconBlock(b) return blocks.NewSignedBeaconBlock(b)
} }

View File

@@ -153,6 +153,8 @@ func UnmarshalledSSZ(t *testing.T, serializedBytes []byte, folderName string) (i
obj = &enginev1.DepositRequest{} obj = &enginev1.DepositRequest{}
case "ConsolidationRequest": case "ConsolidationRequest":
obj = &enginev1.ConsolidationRequest{} obj = &enginev1.ConsolidationRequest{}
case "ExecutionRequests":
obj = &enginev1.ExecutionRequests{}
default: default:
return nil, errors.New("type not found") return nil, errors.New("type not found")
} }

View File

@@ -1406,25 +1406,41 @@ func HydrateBeaconBlockBodyElectra(b *ethpb.BeaconBlockBodyElectra) *ethpb.Beaco
} }
if b.ExecutionPayload == nil { if b.ExecutionPayload == nil {
b.ExecutionPayload = &enginev1.ExecutionPayloadElectra{ b.ExecutionPayload = &enginev1.ExecutionPayloadElectra{
ParentHash: make([]byte, fieldparams.RootLength), ParentHash: make([]byte, fieldparams.RootLength),
FeeRecipient: make([]byte, 20), FeeRecipient: make([]byte, 20),
StateRoot: make([]byte, fieldparams.RootLength), StateRoot: make([]byte, fieldparams.RootLength),
ReceiptsRoot: make([]byte, fieldparams.RootLength), ReceiptsRoot: make([]byte, fieldparams.RootLength),
LogsBloom: make([]byte, 256), LogsBloom: make([]byte, 256),
PrevRandao: make([]byte, fieldparams.RootLength), PrevRandao: make([]byte, fieldparams.RootLength),
ExtraData: make([]byte, 0), ExtraData: make([]byte, 0),
BaseFeePerGas: make([]byte, fieldparams.RootLength), BaseFeePerGas: make([]byte, fieldparams.RootLength),
BlockHash: make([]byte, fieldparams.RootLength), BlockHash: make([]byte, fieldparams.RootLength),
Transactions: make([][]byte, 0), Transactions: make([][]byte, 0),
Withdrawals: make([]*enginev1.Withdrawal, 0), Withdrawals: make([]*enginev1.Withdrawal, 0),
DepositRequests: make([]*enginev1.DepositRequest, 0),
WithdrawalRequests: make([]*enginev1.WithdrawalRequest, 0),
ConsolidationRequests: make([]*enginev1.ConsolidationRequest, 0),
} }
} }
b.ExecutionRequests = HydrateExecutionRequests(b.ExecutionRequests)
return b 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 // HydrateV2BeaconBlockBodyDeneb hydrates a v2 beacon block body with correct field length sizes
// to comply with fssz marshalling and unmarshalling rules. // to comply with fssz marshalling and unmarshalling rules.
func HydrateV2BeaconBlockBodyDeneb(b *v2.BeaconBlockBodyDeneb) *v2.BeaconBlockBodyDeneb { func HydrateV2BeaconBlockBodyDeneb(b *v2.BeaconBlockBodyDeneb) *v2.BeaconBlockBodyDeneb {
@@ -1613,22 +1629,20 @@ func HydrateBlindedBeaconBlockBodyElectra(b *ethpb.BlindedBeaconBlockBodyElectra
} }
if b.ExecutionPayloadHeader == nil { if b.ExecutionPayloadHeader == nil {
b.ExecutionPayloadHeader = &enginev1.ExecutionPayloadHeaderElectra{ b.ExecutionPayloadHeader = &enginev1.ExecutionPayloadHeaderElectra{
ParentHash: make([]byte, 32), ParentHash: make([]byte, 32),
FeeRecipient: make([]byte, 20), FeeRecipient: make([]byte, 20),
StateRoot: make([]byte, fieldparams.RootLength), StateRoot: make([]byte, fieldparams.RootLength),
ReceiptsRoot: make([]byte, fieldparams.RootLength), ReceiptsRoot: make([]byte, fieldparams.RootLength),
LogsBloom: make([]byte, 256), LogsBloom: make([]byte, 256),
PrevRandao: make([]byte, 32), PrevRandao: make([]byte, 32),
ExtraData: make([]byte, 0), ExtraData: make([]byte, 0),
BaseFeePerGas: make([]byte, 32), BaseFeePerGas: make([]byte, 32),
BlockHash: make([]byte, 32), BlockHash: make([]byte, 32),
TransactionsRoot: make([]byte, fieldparams.RootLength), TransactionsRoot: make([]byte, fieldparams.RootLength),
WithdrawalsRoot: make([]byte, fieldparams.RootLength), WithdrawalsRoot: make([]byte, fieldparams.RootLength),
WithdrawalRequestsRoot: make([]byte, fieldparams.RootLength),
DepositRequestsRoot: make([]byte, fieldparams.RootLength),
ConsolidationRequestsRoot: make([]byte, fieldparams.RootLength),
} }
} }
b.ExecutionRequests = HydrateExecutionRequests(b.ExecutionRequests)
return b return b
} }

View File

@@ -97,32 +97,23 @@ func GenerateTestElectraBlockWithSidecar(t *testing.T, parent [32]byte, slot pri
receiptsRoot := bytesutil.PadTo([]byte("receiptsRoot"), fieldparams.RootLength) receiptsRoot := bytesutil.PadTo([]byte("receiptsRoot"), fieldparams.RootLength)
parentHash := bytesutil.PadTo([]byte("parentHash"), fieldparams.RootLength) parentHash := bytesutil.PadTo([]byte("parentHash"), fieldparams.RootLength)
g.payload = &enginev1.ExecutionPayloadElectra{ g.payload = &enginev1.ExecutionPayloadElectra{
ParentHash: parentHash, ParentHash: parentHash,
FeeRecipient: make([]byte, fieldparams.FeeRecipientLength), FeeRecipient: make([]byte, fieldparams.FeeRecipientLength),
StateRoot: stateRoot, StateRoot: stateRoot,
ReceiptsRoot: receiptsRoot, ReceiptsRoot: receiptsRoot,
LogsBloom: logsBloom, LogsBloom: logsBloom,
PrevRandao: blockHash[:], PrevRandao: blockHash[:],
BlockNumber: 0, BlockNumber: 0,
GasLimit: 0, GasLimit: 0,
GasUsed: 0, GasUsed: 0,
Timestamp: 0, Timestamp: 0,
ExtraData: make([]byte, 0), ExtraData: make([]byte, 0),
BaseFeePerGas: bytesutil.PadTo([]byte("baseFeePerGas"), fieldparams.RootLength), BaseFeePerGas: bytesutil.PadTo([]byte("baseFeePerGas"), fieldparams.RootLength),
BlockHash: blockHash[:], BlockHash: blockHash[:],
Transactions: encodedBinaryTxs, Transactions: encodedBinaryTxs,
Withdrawals: make([]*enginev1.Withdrawal, 0), Withdrawals: make([]*enginev1.Withdrawal, 0),
BlobGasUsed: 0, BlobGasUsed: 0,
ExcessBlobGas: 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),
},
},
} }
} }
@@ -177,31 +168,3 @@ func GenerateTestElectraBlockWithSidecar(t *testing.T, parent [32]byte, slot pri
require.NoError(t, err) require.NoError(t, err)
return rob, sidecars 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
}

View File

@@ -160,28 +160,32 @@ func GenerateFullBlockElectra(
return nil, errors.Wrapf(err, "failed generating %d consolidation requests:", conf.NumConsolidationRequests) 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() parentExecution, err := stCopy.LatestExecutionPayloadHeader()
if err != nil { if err != nil {
return nil, err return nil, err
} }
blockHash := indexToHash(uint64(slot)) blockHash := indexToHash(uint64(slot))
newExecutionPayloadElectra := &v1.ExecutionPayloadElectra{ newExecutionPayloadElectra := &v1.ExecutionPayloadElectra{
ParentHash: parentExecution.BlockHash(), ParentHash: parentExecution.BlockHash(),
FeeRecipient: make([]byte, 20), FeeRecipient: make([]byte, 20),
StateRoot: params.BeaconConfig().ZeroHash[:], StateRoot: params.BeaconConfig().ZeroHash[:],
ReceiptsRoot: params.BeaconConfig().ZeroHash[:], ReceiptsRoot: params.BeaconConfig().ZeroHash[:],
LogsBloom: make([]byte, 256), LogsBloom: make([]byte, 256),
PrevRandao: random, PrevRandao: random,
BlockNumber: uint64(slot), BlockNumber: uint64(slot),
ExtraData: params.BeaconConfig().ZeroHash[:], ExtraData: params.BeaconConfig().ZeroHash[:],
BaseFeePerGas: params.BeaconConfig().ZeroHash[:], BaseFeePerGas: params.BeaconConfig().ZeroHash[:],
BlockHash: blockHash[:], BlockHash: blockHash[:],
Timestamp: uint64(timestamp.Unix()), Timestamp: uint64(timestamp.Unix()),
Transactions: newTransactions, Transactions: newTransactions,
Withdrawals: newWithdrawals, Withdrawals: newWithdrawals,
DepositRequests: depositRequests,
WithdrawalRequests: withdrawalRequests,
ConsolidationRequests: consolidationRequests,
} }
var syncCommitteeBits []byte var syncCommitteeBits []byte
currSize := new(ethpb.SyncAggregate).SyncCommitteeBits.Len() currSize := new(ethpb.SyncAggregate).SyncCommitteeBits.Len()
@@ -247,6 +251,7 @@ func GenerateFullBlockElectra(
SyncAggregate: newSyncAggregate, SyncAggregate: newSyncAggregate,
ExecutionPayload: newExecutionPayloadElectra, ExecutionPayload: newExecutionPayloadElectra,
BlsToExecutionChanges: changes, BlsToExecutionChanges: changes,
ExecutionRequests: executionRequests,
}, },
} }

View File

@@ -227,19 +227,21 @@ func buildGenesisBeaconStateElectra(genesisTime uint64, preState state.BeaconSta
SyncCommitteeSignature: make([]byte, 96), SyncCommitteeSignature: make([]byte, 96),
}, },
ExecutionPayload: &enginev1.ExecutionPayloadElectra{ ExecutionPayload: &enginev1.ExecutionPayloadElectra{
ParentHash: make([]byte, 32), ParentHash: make([]byte, 32),
FeeRecipient: make([]byte, 20), FeeRecipient: make([]byte, 20),
StateRoot: make([]byte, 32), StateRoot: make([]byte, 32),
ReceiptsRoot: make([]byte, 32), ReceiptsRoot: make([]byte, 32),
LogsBloom: make([]byte, 256), LogsBloom: make([]byte, 256),
PrevRandao: make([]byte, 32), PrevRandao: make([]byte, 32),
ExtraData: make([]byte, 0), ExtraData: make([]byte, 0),
BaseFeePerGas: make([]byte, 32), BaseFeePerGas: make([]byte, 32),
BlockHash: make([]byte, 32), BlockHash: make([]byte, 32),
Transactions: make([][]byte, 0), Transactions: make([][]byte, 0),
Withdrawals: make([]*enginev1.Withdrawal, 0), },
DepositRequests: make([]*enginev1.DepositRequest, 0), ExecutionRequests: &enginev1.ExecutionRequests{
WithdrawalRequests: make([]*enginev1.WithdrawalRequest, 0), Deposits: make([]*enginev1.DepositRequest, 0),
Withdrawals: make([]*enginev1.WithdrawalRequest, 0),
Consolidations: make([]*enginev1.ConsolidationRequest, 0),
}, },
}).HashTreeRoot() }).HashTreeRoot()
if err != nil { if err != nil {
@@ -272,20 +274,17 @@ func buildGenesisBeaconStateElectra(genesisTime uint64, preState state.BeaconSta
} }
st.LatestExecutionPayloadHeader = &enginev1.ExecutionPayloadHeaderElectra{ st.LatestExecutionPayloadHeader = &enginev1.ExecutionPayloadHeaderElectra{
ParentHash: make([]byte, 32), ParentHash: make([]byte, 32),
FeeRecipient: make([]byte, 20), FeeRecipient: make([]byte, 20),
StateRoot: make([]byte, 32), StateRoot: make([]byte, 32),
ReceiptsRoot: make([]byte, 32), ReceiptsRoot: make([]byte, 32),
LogsBloom: make([]byte, 256), LogsBloom: make([]byte, 256),
PrevRandao: make([]byte, 32), PrevRandao: make([]byte, 32),
ExtraData: make([]byte, 0), ExtraData: make([]byte, 0),
BaseFeePerGas: make([]byte, 32), BaseFeePerGas: make([]byte, 32),
BlockHash: make([]byte, 32), BlockHash: make([]byte, 32),
TransactionsRoot: make([]byte, 32), TransactionsRoot: make([]byte, 32),
WithdrawalsRoot: make([]byte, 32), WithdrawalsRoot: make([]byte, 32),
DepositRequestsRoot: make([]byte, 32),
WithdrawalRequestsRoot: make([]byte, 32),
ConsolidationRequestsRoot: make([]byte, 32),
} }
return state_native.InitializeFromProtoElectra(st) return state_native.InitializeFromProtoElectra(st)

View File

@@ -425,20 +425,17 @@ func NewBeaconStateElectra(options ...func(state *ethpb.BeaconStateElectra) erro
AggregatePubkey: make([]byte, 48), AggregatePubkey: make([]byte, 48),
}, },
LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{ LatestExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderElectra{
ParentHash: make([]byte, 32), ParentHash: make([]byte, 32),
FeeRecipient: make([]byte, 20), FeeRecipient: make([]byte, 20),
StateRoot: make([]byte, 32), StateRoot: make([]byte, 32),
ReceiptsRoot: make([]byte, 32), ReceiptsRoot: make([]byte, 32),
LogsBloom: make([]byte, 256), LogsBloom: make([]byte, 256),
PrevRandao: make([]byte, 32), PrevRandao: make([]byte, 32),
ExtraData: make([]byte, 0), ExtraData: make([]byte, 0),
BaseFeePerGas: make([]byte, 32), BaseFeePerGas: make([]byte, 32),
BlockHash: make([]byte, 32), BlockHash: make([]byte, 32),
TransactionsRoot: make([]byte, 32), TransactionsRoot: make([]byte, 32),
WithdrawalsRoot: make([]byte, 32), WithdrawalsRoot: make([]byte, 32),
DepositRequestsRoot: make([]byte, 32),
WithdrawalRequestsRoot: make([]byte, 32),
ConsolidationRequestsRoot: make([]byte, 32),
}, },
} }