mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 21:38:05 -05:00
Compare commits
12 Commits
execution-
...
move-paylo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc3c29b786 | ||
|
|
9d8c1245bc | ||
|
|
f2e3d4ae02 | ||
|
|
27132c2eb3 | ||
|
|
e2b0378de8 | ||
|
|
daae90b27e | ||
|
|
5a88aa6ad1 | ||
|
|
029c3ebb6d | ||
|
|
fdeed7970e | ||
|
|
4c8df7f9f7 | ||
|
|
f8d8e3a89b | ||
|
|
ce730f358c |
@@ -10,6 +10,7 @@ go_library(
|
||||
"conversions_block.go",
|
||||
"conversions_lightclient.go",
|
||||
"conversions_state.go",
|
||||
"conversions_state_epbs.go",
|
||||
"converstions_block_epbs.go",
|
||||
"endpoints_beacon.go",
|
||||
"endpoints_blob.go",
|
||||
@@ -23,6 +24,7 @@ go_library(
|
||||
"endpoints_validator.go",
|
||||
"other.go",
|
||||
"state.go",
|
||||
"state_epbs.go",
|
||||
],
|
||||
importpath = "github.com/prysmaticlabs/prysm/v5/api/server/structs",
|
||||
visibility = ["//visibility:public"],
|
||||
|
||||
205
api/server/structs/conversions_state_epbs.go
Normal file
205
api/server/structs/conversions_state_epbs.go
Normal file
@@ -0,0 +1,205 @@
|
||||
package structs
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/ethereum/go-ethereum/common/hexutil"
|
||||
beaconState "github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
|
||||
)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Fulu
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
func BeaconStateEPBSFromConsensus(st beaconState.BeaconState) (*BeaconStateEPBS, error) {
|
||||
srcBr := st.BlockRoots()
|
||||
br := make([]string, len(srcBr))
|
||||
for i, r := range srcBr {
|
||||
br[i] = hexutil.Encode(r)
|
||||
}
|
||||
srcSr := st.StateRoots()
|
||||
sr := make([]string, len(srcSr))
|
||||
for i, r := range srcSr {
|
||||
sr[i] = hexutil.Encode(r)
|
||||
}
|
||||
srcHr, err := st.HistoricalRoots()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
hr := make([]string, len(srcHr))
|
||||
for i, r := range srcHr {
|
||||
hr[i] = hexutil.Encode(r)
|
||||
}
|
||||
srcVotes := st.Eth1DataVotes()
|
||||
votes := make([]*Eth1Data, len(srcVotes))
|
||||
for i, e := range srcVotes {
|
||||
votes[i] = Eth1DataFromConsensus(e)
|
||||
}
|
||||
srcVals := st.Validators()
|
||||
vals := make([]*Validator, len(srcVals))
|
||||
for i, v := range srcVals {
|
||||
vals[i] = ValidatorFromConsensus(v)
|
||||
}
|
||||
srcBals := st.Balances()
|
||||
bals := make([]string, len(srcBals))
|
||||
for i, b := range srcBals {
|
||||
bals[i] = fmt.Sprintf("%d", b)
|
||||
}
|
||||
srcRm := st.RandaoMixes()
|
||||
rm := make([]string, len(srcRm))
|
||||
for i, m := range srcRm {
|
||||
rm[i] = hexutil.Encode(m)
|
||||
}
|
||||
srcSlashings := st.Slashings()
|
||||
slashings := make([]string, len(srcSlashings))
|
||||
for i, s := range srcSlashings {
|
||||
slashings[i] = fmt.Sprintf("%d", s)
|
||||
}
|
||||
srcPrevPart, err := st.PreviousEpochParticipation()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
prevPart := make([]string, len(srcPrevPart))
|
||||
for i, p := range srcPrevPart {
|
||||
prevPart[i] = fmt.Sprintf("%d", p)
|
||||
}
|
||||
srcCurrPart, err := st.CurrentEpochParticipation()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
currPart := make([]string, len(srcCurrPart))
|
||||
for i, p := range srcCurrPart {
|
||||
currPart[i] = fmt.Sprintf("%d", p)
|
||||
}
|
||||
srcIs, err := st.InactivityScores()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
is := make([]string, len(srcIs))
|
||||
for i, s := range srcIs {
|
||||
is[i] = fmt.Sprintf("%d", s)
|
||||
}
|
||||
currSc, err := st.CurrentSyncCommittee()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
nextSc, err := st.NextSyncCommittee()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
srcPayload, err := st.LatestExecutionPayloadHeaderEPBS()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
payload, err := ExecutionPayloadHeaderEPBSFromConsensus(srcPayload)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
srcHs, err := st.HistoricalSummaries()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
hs := make([]*HistoricalSummary, len(srcHs))
|
||||
for i, s := range srcHs {
|
||||
hs[i] = HistoricalSummaryFromConsensus(s)
|
||||
}
|
||||
nwi, err := st.NextWithdrawalIndex()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
nwvi, err := st.NextWithdrawalValidatorIndex()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
drsi, err := st.DepositRequestsStartIndex()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
dbtc, err := st.DepositBalanceToConsume()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ebtc, err := st.ExitBalanceToConsume()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
eee, err := st.EarliestExitEpoch()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cbtc, err := st.ConsolidationBalanceToConsume()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ece, err := st.EarliestConsolidationEpoch()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pbd, err := st.PendingDeposits()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ppw, err := st.PendingPartialWithdrawals()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
pc, err := st.PendingConsolidations()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
latestBlockHash, err := st.LatestBlockHash()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
latestFullSlot, err := st.LatestFullSlot()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
latestWithdrawalsRoot, err := st.LastWithdrawalsRoot()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &BeaconStateEPBS{
|
||||
GenesisTime: fmt.Sprintf("%d", st.GenesisTime()),
|
||||
GenesisValidatorsRoot: hexutil.Encode(st.GenesisValidatorsRoot()),
|
||||
Slot: fmt.Sprintf("%d", st.Slot()),
|
||||
Fork: ForkFromConsensus(st.Fork()),
|
||||
LatestBlockHeader: BeaconBlockHeaderFromConsensus(st.LatestBlockHeader()),
|
||||
BlockRoots: br,
|
||||
StateRoots: sr,
|
||||
HistoricalRoots: hr,
|
||||
Eth1Data: Eth1DataFromConsensus(st.Eth1Data()),
|
||||
Eth1DataVotes: votes,
|
||||
Eth1DepositIndex: fmt.Sprintf("%d", st.Eth1DepositIndex()),
|
||||
Validators: vals,
|
||||
Balances: bals,
|
||||
RandaoMixes: rm,
|
||||
Slashings: slashings,
|
||||
PreviousEpochParticipation: prevPart,
|
||||
CurrentEpochParticipation: currPart,
|
||||
JustificationBits: hexutil.Encode(st.JustificationBits()),
|
||||
PreviousJustifiedCheckpoint: CheckpointFromConsensus(st.PreviousJustifiedCheckpoint()),
|
||||
CurrentJustifiedCheckpoint: CheckpointFromConsensus(st.CurrentJustifiedCheckpoint()),
|
||||
FinalizedCheckpoint: CheckpointFromConsensus(st.FinalizedCheckpoint()),
|
||||
InactivityScores: is,
|
||||
CurrentSyncCommittee: SyncCommitteeFromConsensus(currSc),
|
||||
NextSyncCommittee: SyncCommitteeFromConsensus(nextSc),
|
||||
LatestExecutionPayloadHeader: payload,
|
||||
NextWithdrawalIndex: fmt.Sprintf("%d", nwi),
|
||||
NextWithdrawalValidatorIndex: fmt.Sprintf("%d", nwvi),
|
||||
HistoricalSummaries: hs,
|
||||
DepositRequestsStartIndex: fmt.Sprintf("%d", drsi),
|
||||
DepositBalanceToConsume: fmt.Sprintf("%d", dbtc),
|
||||
ExitBalanceToConsume: fmt.Sprintf("%d", ebtc),
|
||||
EarliestExitEpoch: fmt.Sprintf("%d", eee),
|
||||
ConsolidationBalanceToConsume: fmt.Sprintf("%d", cbtc),
|
||||
EarliestConsolidationEpoch: fmt.Sprintf("%d", ece),
|
||||
PendingDeposits: PendingDepositsFromConsensus(pbd),
|
||||
PendingPartialWithdrawals: PendingPartialWithdrawalsFromConsensus(ppw),
|
||||
PendingConsolidations: PendingConsolidationsFromConsensus(pc),
|
||||
LatestBlockHash: hexutil.Encode(latestBlockHash),
|
||||
LatestFullSlot: fmt.Sprintf("%d", latestFullSlot),
|
||||
LatestWithdrawalsRoot: hexutil.Encode(latestWithdrawalsRoot),
|
||||
}, nil
|
||||
}
|
||||
@@ -333,7 +333,7 @@ func ExecutionPayloadEnvelopeFromConsensus(b *enginev1.ExecutionPayloadEnvelope)
|
||||
BeaconBlockRoot: hexutil.Encode(b.BeaconBlockRoot),
|
||||
Slot: fmt.Sprintf("%d", b.Slot),
|
||||
BlobKzgCommitments: committments,
|
||||
StateRoot: hexutil.Encode(b.StateRoot),
|
||||
StateRoot: hexutil.Encode(b.BeaconStateRoot),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
44
api/server/structs/state_epbs.go
Normal file
44
api/server/structs/state_epbs.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package structs
|
||||
|
||||
type BeaconStateEPBS struct {
|
||||
GenesisTime string `json:"genesis_time"`
|
||||
GenesisValidatorsRoot string `json:"genesis_validators_root"`
|
||||
Slot string `json:"slot"`
|
||||
Fork *Fork `json:"fork"`
|
||||
LatestBlockHeader *BeaconBlockHeader `json:"latest_block_header"`
|
||||
BlockRoots []string `json:"block_roots"`
|
||||
StateRoots []string `json:"state_roots"`
|
||||
HistoricalRoots []string `json:"historical_roots"`
|
||||
Eth1Data *Eth1Data `json:"eth1_data"`
|
||||
Eth1DataVotes []*Eth1Data `json:"eth1_data_votes"`
|
||||
Eth1DepositIndex string `json:"eth1_deposit_index"`
|
||||
Validators []*Validator `json:"validators"`
|
||||
Balances []string `json:"balances"`
|
||||
RandaoMixes []string `json:"randao_mixes"`
|
||||
Slashings []string `json:"slashings"`
|
||||
PreviousEpochParticipation []string `json:"previous_epoch_participation"`
|
||||
CurrentEpochParticipation []string `json:"current_epoch_participation"`
|
||||
JustificationBits string `json:"justification_bits"`
|
||||
PreviousJustifiedCheckpoint *Checkpoint `json:"previous_justified_checkpoint"`
|
||||
CurrentJustifiedCheckpoint *Checkpoint `json:"current_justified_checkpoint"`
|
||||
FinalizedCheckpoint *Checkpoint `json:"finalized_checkpoint"`
|
||||
InactivityScores []string `json:"inactivity_scores"`
|
||||
CurrentSyncCommittee *SyncCommittee `json:"current_sync_committee"`
|
||||
NextSyncCommittee *SyncCommittee `json:"next_sync_committee"`
|
||||
LatestExecutionPayloadHeader *ExecutionPayloadHeaderEPBS `json:"latest_execution_payload_header"`
|
||||
NextWithdrawalIndex string `json:"next_withdrawal_index"`
|
||||
NextWithdrawalValidatorIndex string `json:"next_withdrawal_validator_index"`
|
||||
HistoricalSummaries []*HistoricalSummary `json:"historical_summaries"`
|
||||
DepositRequestsStartIndex string `json:"deposit_requests_start_index"`
|
||||
DepositBalanceToConsume string `json:"deposit_balance_to_consume"`
|
||||
ExitBalanceToConsume string `json:"exit_balance_to_consume"`
|
||||
EarliestExitEpoch string `json:"earliest_exit_epoch"`
|
||||
ConsolidationBalanceToConsume string `json:"consolidation_balance_to_consume"`
|
||||
EarliestConsolidationEpoch string `json:"earliest_consolidation_epoch"`
|
||||
PendingDeposits []*PendingDeposit `json:"pending_deposits"`
|
||||
PendingPartialWithdrawals []*PendingPartialWithdrawal `json:"pending_partial_withdrawals"`
|
||||
PendingConsolidations []*PendingConsolidation `json:"pending_consolidations"`
|
||||
LatestBlockHash string `json:"latest_block_hash"`
|
||||
LatestFullSlot string `json:"latest_full_slot"`
|
||||
LatestWithdrawalsRoot string `json:"latest_withdrawals_root"`
|
||||
}
|
||||
@@ -52,7 +52,7 @@ type ForkchoiceFetcher interface {
|
||||
RecentBlockSlot(root [32]byte) (primitives.Slot, error)
|
||||
IsCanonical(ctx context.Context, blockRoot [32]byte) (bool, error)
|
||||
GetPTCVote(root [32]byte) primitives.PTCStatus
|
||||
HashForBlockRoot(root [32]byte) [32]byte
|
||||
HashForBlockRoot(context.Context, [32]byte) ([]byte, error)
|
||||
}
|
||||
|
||||
// TimeFetcher retrieves the Ethereum consensus data that's related to time.
|
||||
|
||||
@@ -3,11 +3,13 @@ package blockchain
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
"github.com/prysmaticlabs/prysm/v5/beacon-chain/state"
|
||||
consensus_blocks "github.com/prysmaticlabs/prysm/v5/consensus-types/blocks"
|
||||
"github.com/prysmaticlabs/prysm/v5/consensus-types/forkchoice"
|
||||
"github.com/prysmaticlabs/prysm/v5/consensus-types/interfaces"
|
||||
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
|
||||
"github.com/prysmaticlabs/prysm/v5/runtime/version"
|
||||
)
|
||||
|
||||
// CachedHeadRoot returns the corresponding value from Forkchoice
|
||||
@@ -102,11 +104,31 @@ func (s *Service) ParentRoot(root [32]byte) ([32]byte, error) {
|
||||
return s.cfg.ForkChoiceStore.ParentRoot(root)
|
||||
}
|
||||
|
||||
// HashForBlockRoot wraps a call to the corresponding method in forkchoice
|
||||
func (s *Service) HashForBlockRoot(root [32]byte) [32]byte {
|
||||
// HashForBlockRoot wraps a call to the corresponding method in forkchoice. If the hash is older it will grab it from DB
|
||||
func (s *Service) HashForBlockRoot(ctx context.Context, root [32]byte) ([]byte, error) {
|
||||
s.cfg.ForkChoiceStore.RLock()
|
||||
defer s.cfg.ForkChoiceStore.RUnlock()
|
||||
return s.cfg.ForkChoiceStore.HashForBlockRoot(root)
|
||||
hash := s.cfg.ForkChoiceStore.HashForBlockRoot(root)
|
||||
if hash != [32]byte{} {
|
||||
return hash[:], nil
|
||||
}
|
||||
blk, err := s.cfg.BeaconDB.Block(ctx, root)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to get block from DB and forkchoice")
|
||||
}
|
||||
if blk.Version() < version.EPBS {
|
||||
return nil, errors.New("block version is too old")
|
||||
}
|
||||
sh, err := blk.Block().Body().SignedExecutionPayloadHeader()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to get signed execution payload header")
|
||||
}
|
||||
h, err := sh.Header()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "failed to get execution payload header")
|
||||
}
|
||||
hash = h.BlockHash()
|
||||
return hash[:], nil
|
||||
}
|
||||
|
||||
// GetPTCVote wraps a call to the corresponding method in forkchoice and checks
|
||||
|
||||
@@ -33,7 +33,6 @@ func (s *Service) ReceiveExecutionPayloadEnvelope(ctx context.Context, signed in
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Info("Receiving execution payload envelope")
|
||||
root := envelope.BeaconBlockRoot()
|
||||
s.payloadBeingSynced.set(envelope)
|
||||
defer s.payloadBeingSynced.unset(root)
|
||||
|
||||
@@ -79,7 +79,7 @@ func Test_ReceiveExecutionPayloadEnvelope(t *testing.T) {
|
||||
},
|
||||
BeaconBlockRoot: service.originBlockRoot[:],
|
||||
BlobKzgCommitments: make([][]byte, 0),
|
||||
StateRoot: make([]byte, 32),
|
||||
BeaconStateRoot: make([]byte, 32),
|
||||
ExecutionRequests: &enginev1.ExecutionRequests{},
|
||||
}
|
||||
sp := &enginev1.SignedExecutionPayloadEnvelope{
|
||||
@@ -96,7 +96,7 @@ func Test_ReceiveExecutionPayloadEnvelope(t *testing.T) {
|
||||
require.NoError(t, post.SetLatestBlockHeader(blockHeader))
|
||||
stRoot, err := post.HashTreeRoot(ctx)
|
||||
require.NoError(t, err)
|
||||
p.StateRoot = stRoot[:]
|
||||
p.BeaconStateRoot = stRoot[:]
|
||||
engine := &mockExecution.EngineClient{}
|
||||
service.cfg.ExecutionEngineCaller = engine
|
||||
require.NoError(t, service.ReceiveExecutionPayloadEnvelope(ctx, e, das))
|
||||
|
||||
@@ -39,7 +39,9 @@ import (
|
||||
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
|
||||
"github.com/prysmaticlabs/prysm/v5/encoding/bytesutil"
|
||||
"github.com/prysmaticlabs/prysm/v5/monitoring/tracing/trace"
|
||||
enginev1 "github.com/prysmaticlabs/prysm/v5/proto/engine/v1"
|
||||
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
|
||||
"github.com/prysmaticlabs/prysm/v5/runtime/version"
|
||||
prysmTime "github.com/prysmaticlabs/prysm/v5/time"
|
||||
"github.com/prysmaticlabs/prysm/v5/time/slots"
|
||||
)
|
||||
@@ -316,6 +318,39 @@ func (s *Service) StartFromSavedState(saved state.BeaconState) error {
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not get finalized checkpoint block")
|
||||
}
|
||||
// Hack do deal with the right hash for the genesis block
|
||||
if st.Version() > version.Bellatrix {
|
||||
header, err := st.LatestExecutionPayloadHeader()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not get latest execution payload header")
|
||||
}
|
||||
execution, err := finalizedBlock.Block().Body().Execution()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not get execution")
|
||||
}
|
||||
switch st.Version() {
|
||||
case version.Deneb, version.Electra:
|
||||
bh, ok := execution.Proto().(*enginev1.ExecutionPayloadHeaderDeneb)
|
||||
if !ok {
|
||||
return errors.New("could not convert execution payload header")
|
||||
}
|
||||
bh.BlockHash = header.BlockHash()
|
||||
case version.Capella:
|
||||
bh, ok := execution.Proto().(*enginev1.ExecutionPayloadHeaderCapella)
|
||||
if !ok {
|
||||
return errors.New("could not convert execution payload header")
|
||||
}
|
||||
bh.BlockHash = header.BlockHash()
|
||||
case version.Bellatrix:
|
||||
bh, ok := execution.Proto().(*enginev1.ExecutionPayloadHeader)
|
||||
if !ok {
|
||||
return errors.New("could not convert execution payload header")
|
||||
}
|
||||
bh.BlockHash = header.BlockHash()
|
||||
default:
|
||||
return errors.New("unknown version")
|
||||
}
|
||||
}
|
||||
roblock, err := blocks.NewROBlockWithRoot(finalizedBlock, fRoot)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -732,6 +732,6 @@ func (c *ChainService) GetPTCVote(root [32]byte) primitives.PTCStatus {
|
||||
return c.PayloadStatus
|
||||
}
|
||||
|
||||
func (c *ChainService) HashForBlockRoot(root [32]byte) [32]byte {
|
||||
return root
|
||||
func (c *ChainService) HashForBlockRoot(_ context.Context, root [32]byte) ([]byte, error) {
|
||||
return root[:], nil
|
||||
}
|
||||
|
||||
@@ -101,10 +101,10 @@ func TestCheckPostStateRoot(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
ctx := context.Background()
|
||||
st, _ := util.DeterministicGenesisStateEpbs(t, 64)
|
||||
p.StateRoot = make([]byte, 32)
|
||||
p.BeaconStateRoot = make([]byte, 32)
|
||||
require.ErrorContains(t, "state root mismatch", epbs.CheckPostStateRoot(ctx, st, e))
|
||||
root, err := st.HashTreeRoot(ctx)
|
||||
require.NoError(t, err)
|
||||
p.StateRoot = root[:]
|
||||
p.BeaconStateRoot = root[:]
|
||||
require.NoError(t, epbs.CheckPostStateRoot(ctx, st, e))
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ func (s *Service) ReconstructPayloadEnvelope(ctx context.Context, e *pb.SignedBl
|
||||
BeaconBlockRoot: e.Message.BeaconBlockRoot,
|
||||
Slot: e.Message.Slot,
|
||||
BlobKzgCommitments: e.Message.BlobKzgCommitments,
|
||||
StateRoot: e.Message.StateRoot,
|
||||
BeaconStateRoot: e.Message.BeaconStateRoot,
|
||||
},
|
||||
Signature: e.Signature,
|
||||
}, nil
|
||||
|
||||
@@ -19,7 +19,8 @@ func (s *Service) forkWatcher() {
|
||||
currEpoch == params.BeaconConfig().CapellaForkEpoch ||
|
||||
currEpoch == params.BeaconConfig().DenebForkEpoch ||
|
||||
currEpoch == params.BeaconConfig().ElectraForkEpoch ||
|
||||
currEpoch == params.BeaconConfig().FuluForkEpoch {
|
||||
currEpoch == params.BeaconConfig().FuluForkEpoch ||
|
||||
currEpoch == params.BeaconConfig().EPBSForkEpoch {
|
||||
// If we are in the fork epoch, we update our enr with
|
||||
// the updated fork digest. These repeatedly does
|
||||
// this over the epoch, which might be slightly wasteful
|
||||
|
||||
@@ -33,6 +33,9 @@ var gossipTopicMappings = map[string]func() proto.Message{
|
||||
func GossipTopicMappings(topic string, epoch primitives.Epoch) proto.Message {
|
||||
switch topic {
|
||||
case BlockSubnetTopicFormat:
|
||||
if epoch >= params.BeaconConfig().EPBSForkEpoch {
|
||||
return ðpb.SignedBeaconBlockEpbs{}
|
||||
}
|
||||
if epoch >= params.BeaconConfig().FuluForkEpoch {
|
||||
return ðpb.SignedBeaconBlockFulu{}
|
||||
}
|
||||
@@ -140,5 +143,4 @@ func init() {
|
||||
GossipTypeMapping[reflect.TypeOf(&enginev1.SignedExecutionPayloadEnvelope{})] = SignedExecutionPayloadEnvelopeTopicFormat
|
||||
GossipTypeMapping[reflect.TypeOf(ðpb.PayloadAttestationMessage{})] = PayloadAttestationMessageTopicFormat
|
||||
GossipTypeMapping[reflect.TypeOf(ðpb.SignedBeaconBlockEpbs{})] = BlockSubnetTopicFormat
|
||||
|
||||
}
|
||||
|
||||
@@ -100,6 +100,12 @@ func (s *Server) getBeaconStateV2(ctx context.Context, w http.ResponseWriter, id
|
||||
httputil.HandleError(w, errMsgStateFromConsensus+": "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
case version.EPBS:
|
||||
respSt, err = structs.BeaconStateEPBSFromConsensus(st)
|
||||
if err != nil {
|
||||
httputil.HandleError(w, errMsgStateFromConsensus+": "+err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
default:
|
||||
httputil.HandleError(w, "Unsupported state version", http.StatusInternalServerError)
|
||||
return
|
||||
|
||||
@@ -147,9 +147,12 @@ func logFailedReorgAttempt(slot primitives.Slot, oldHeadRoot, headRoot [32]byte)
|
||||
|
||||
func (vs *Server) getHeadNoReorg(ctx context.Context, slot primitives.Slot, parentRoot [32]byte) (state.BeaconState, error) {
|
||||
// get the head block
|
||||
hash := vs.ForkchoiceFetcher.HashForBlockRoot(parentRoot)
|
||||
hash, err := vs.ForkchoiceFetcher.HashForBlockRoot(ctx, parentRoot)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get head block hash: %v", err)
|
||||
}
|
||||
// try first to build on top of full (TODO, get this info from forkchoice instead)
|
||||
head := transition.NextSlotState(hash[:], slot)
|
||||
head := transition.NextSlotState(hash, slot)
|
||||
if head != nil {
|
||||
return head, nil
|
||||
}
|
||||
@@ -158,7 +161,7 @@ func (vs *Server) getHeadNoReorg(ctx context.Context, slot primitives.Slot, pare
|
||||
if head != nil {
|
||||
return head, nil
|
||||
}
|
||||
head, err := vs.HeadFetcher.HeadState(ctx)
|
||||
head, err = vs.HeadFetcher.HeadState(ctx)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not get head state: %v", err)
|
||||
}
|
||||
@@ -515,7 +518,10 @@ func (vs *Server) computeStateRoot(ctx context.Context, block interfaces.ReadOnl
|
||||
return nil, errors.Wrap(err, "could not get parent slot")
|
||||
}
|
||||
if block.Version() >= version.EPBS && slots.ToEpoch(parentSlot) >= params.BeaconConfig().EPBSForkEpoch {
|
||||
parentHash := vs.ForkchoiceFetcher.HashForBlockRoot(parentRoot)
|
||||
parentHash, err := vs.ForkchoiceFetcher.HashForBlockRoot(ctx, parentRoot)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get parent hash")
|
||||
}
|
||||
signedBid, err := block.Block().Body().SignedExecutionPayloadHeader()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get signed execution payload header")
|
||||
@@ -524,9 +530,10 @@ func (vs *Server) computeStateRoot(ctx context.Context, block interfaces.ReadOnl
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get execution payload header")
|
||||
}
|
||||
if parentHash == bid.ParentBlockHash() {
|
||||
hash := [32]byte(parentHash)
|
||||
if hash == bid.ParentBlockHash() {
|
||||
// It's based on full, use the state by hash
|
||||
parentRoot = parentHash
|
||||
parentRoot = hash
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ func (vs *Server) GetExecutionPayloadEnvelope(ctx context.Context, req *eth.Payl
|
||||
}
|
||||
vs.payloadEnvelope.Slot = req.Slot
|
||||
|
||||
vs.payloadEnvelope.StateRoot = make([]byte, 32)
|
||||
vs.payloadEnvelope.BeaconStateRoot = make([]byte, 32)
|
||||
p, err := blocks.WrappedROExecutionPayloadEnvelope(vs.payloadEnvelope)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "failed to wrap execution payload envelope: %v", err)
|
||||
@@ -63,7 +63,7 @@ func (vs *Server) GetExecutionPayloadEnvelope(ctx context.Context, req *eth.Payl
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "failed to compute post payload state root: %v", err)
|
||||
}
|
||||
vs.payloadEnvelope.StateRoot = stateRoot
|
||||
vs.payloadEnvelope.BeaconStateRoot = stateRoot
|
||||
|
||||
log.WithField("stateRoot", fmt.Sprintf("%#x", stateRoot)).Debugf("Computed state root at execution stage")
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ func TestServer_SubmitSignedExecutionPayloadEnvelope(t *testing.T) {
|
||||
Payload: &enginev1.ExecutionPayloadDeneb{},
|
||||
BeaconBlockRoot: make([]byte, 32),
|
||||
BlobKzgCommitments: [][]byte{},
|
||||
StateRoot: make([]byte, 32),
|
||||
BeaconStateRoot: make([]byte, 32),
|
||||
},
|
||||
Signature: make([]byte, 96),
|
||||
}
|
||||
@@ -94,7 +94,7 @@ func TestProposer_ComputePostPayloadStateRoot(t *testing.T) {
|
||||
Payload: &enginev1.ExecutionPayloadDeneb{},
|
||||
ExecutionRequests: &enginev1.ExecutionRequests{},
|
||||
BlobKzgCommitments: make([][]byte, 0),
|
||||
StateRoot: expectedStateRoot[:],
|
||||
BeaconStateRoot: expectedStateRoot[:],
|
||||
}
|
||||
p.Payload.BlockHash = bh[:]
|
||||
e, err := blocks.WrappedROExecutionPayloadEnvelope(p)
|
||||
|
||||
@@ -14,7 +14,6 @@ go_library(
|
||||
visibility = ["//beacon-chain:__subpackages__"],
|
||||
deps = [
|
||||
"//beacon-chain/db:go_default_library",
|
||||
"//beacon-chain/execution:go_default_library",
|
||||
"//beacon-chain/rpc/core:go_default_library",
|
||||
"//beacon-chain/state:go_default_library",
|
||||
"//config/params:go_default_library",
|
||||
|
||||
@@ -21,6 +21,7 @@ import (
|
||||
|
||||
func (s *Service) validateExecutionPayloadEnvelope(ctx context.Context, pid peer.ID, msg *pubsub.Message) (pubsub.ValidationResult, error) {
|
||||
if pid == s.cfg.p2p.PeerID() {
|
||||
log.Info("Received local execution payload envelope")
|
||||
return pubsub.ValidationAccept, nil
|
||||
}
|
||||
if s.cfg.initialSync.Syncing() {
|
||||
@@ -68,6 +69,10 @@ func (s *Service) validateExecutionPayloadEnvelope(ctx context.Context, pid peer
|
||||
}
|
||||
msg.ValidatorData = signedEnvelope
|
||||
|
||||
log.WithFields(logrus.Fields{
|
||||
"blockRoot": fmt.Sprintf("%#x", signedEnvelope.Message.BeaconBlockRoot),
|
||||
"slot": signedEnvelope.Message.Slot,
|
||||
}).Debug("Received execution payload envelope")
|
||||
return pubsub.ValidationAccept, nil
|
||||
}
|
||||
|
||||
@@ -136,8 +141,12 @@ func (s *Service) latePayloadTasks(ctx context.Context) {
|
||||
if slot < s.cfg.clock.CurrentSlot() {
|
||||
return
|
||||
}
|
||||
hash := s.cfg.chain.HashForBlockRoot(root)
|
||||
if s.cfg.chain.HashInForkchoice(hash) {
|
||||
hash, err := s.cfg.chain.HashForBlockRoot(ctx, root)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("failed to get hash for block root")
|
||||
return
|
||||
}
|
||||
if s.cfg.chain.PayloadBeingSynced(root) || s.cfg.chain.HashInForkchoice([32]byte(hash)) {
|
||||
return
|
||||
}
|
||||
log.WithFields(logrus.Fields{"blockRoot": fmt.Sprintf("%#x", root), "slot": slot}).Debug("requesting late payload")
|
||||
|
||||
@@ -30,7 +30,11 @@ func (s *Service) executionPayloadByRootRPCHandler(ctx context.Context, msg inte
|
||||
return errors.New("no block roots provided")
|
||||
}
|
||||
for _, root := range blockRoots {
|
||||
blindPayload, err := s.cfg.beaconDB.SignedBlindPayloadEnvelope(ctx, root[:])
|
||||
hash, err := s.cfg.chain.HashForBlockRoot(ctx, root)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
blindPayload, err := s.cfg.beaconDB.SignedBlindPayloadEnvelope(ctx, hash)
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -162,6 +162,10 @@ func (s *Service) processPendingPayloads(root [32]byte) {
|
||||
if payload == nil {
|
||||
return
|
||||
}
|
||||
if s.cfg.chain.PayloadBeingSynced(root) || s.cfg.chain.HashInForkchoice([32]byte(payload.Message.Payload.BlockHash)) {
|
||||
s.pendingExecutionPayloads.Remove(root)
|
||||
return
|
||||
}
|
||||
e, err := blocks.WrappedROSignedExecutionPayloadEnvelope(payload)
|
||||
if err != nil {
|
||||
log.WithError(err).Error("failed to create read only signed payload execution envelope")
|
||||
|
||||
@@ -217,7 +217,11 @@ func (s *Service) validateBeaconBlockPubSub(ctx context.Context, pid peer.ID, ms
|
||||
err := errors.Errorf("unknown execution parent for block with slot %d and parent root %#x", blk.Block().Slot(), root)
|
||||
log.WithError(err).WithFields(getBlockFields(blk)).Debug("requesting parent payload")
|
||||
go func() {
|
||||
if err := s.sendBatchPayloadRequest(context.Background(), [][32]byte{[32]byte(root)}, rand.NewGenerator()); err != nil {
|
||||
blockRoot := [32]byte(root)
|
||||
if s.cfg.chain.PayloadBeingSynced(blockRoot) {
|
||||
return
|
||||
}
|
||||
if err := s.sendBatchPayloadRequest(context.Background(), [][32]byte{blockRoot}, rand.NewGenerator()); err != nil {
|
||||
log.WithError(err).Error("failed to send batch payload request")
|
||||
}
|
||||
}()
|
||||
|
||||
@@ -23,7 +23,7 @@ func TestExecutionPayloadEnvelope_VerifyBlockRootSeen(t *testing.T) {
|
||||
Payload: &enginev1.ExecutionPayloadDeneb{},
|
||||
BeaconBlockRoot: beaconBlockRoot[:],
|
||||
BlobKzgCommitments: [][]byte{make([]byte, 48), make([]byte, 48), make([]byte, 48)},
|
||||
StateRoot: make([]byte, 32),
|
||||
BeaconStateRoot: make([]byte, 32),
|
||||
},
|
||||
Signature: make([]byte, 96),
|
||||
})
|
||||
@@ -54,7 +54,7 @@ func TestExecutionPayloadEnvelope_VerifyBlockRootValid(t *testing.T) {
|
||||
Payload: &enginev1.ExecutionPayloadDeneb{},
|
||||
BeaconBlockRoot: beaconBlockRoot[:],
|
||||
BlobKzgCommitments: [][]byte{make([]byte, 48), make([]byte, 48), make([]byte, 48)},
|
||||
StateRoot: make([]byte, 32),
|
||||
BeaconStateRoot: make([]byte, 32),
|
||||
},
|
||||
Signature: make([]byte, 96),
|
||||
})
|
||||
@@ -82,7 +82,7 @@ func TestExecutionPayloadEnvelope_VerifyBuilderValid(t *testing.T) {
|
||||
BuilderIndex: builderIndexWanted,
|
||||
BeaconBlockRoot: make([]byte, 32),
|
||||
BlobKzgCommitments: [][]byte{make([]byte, 48), make([]byte, 48), make([]byte, 48)},
|
||||
StateRoot: make([]byte, 32),
|
||||
BeaconStateRoot: make([]byte, 32),
|
||||
},
|
||||
Signature: make([]byte, 96),
|
||||
})
|
||||
@@ -127,7 +127,7 @@ func TestExecutionPayloadEnvelope_VerifyPayloadHash(t *testing.T) {
|
||||
},
|
||||
BeaconBlockRoot: make([]byte, 32),
|
||||
BlobKzgCommitments: [][]byte{make([]byte, 48), make([]byte, 48), make([]byte, 48)},
|
||||
StateRoot: make([]byte, 32),
|
||||
BeaconStateRoot: make([]byte, 32),
|
||||
},
|
||||
Signature: make([]byte, 96),
|
||||
})
|
||||
@@ -193,7 +193,7 @@ func TestExecutionPayloadEnvelope_VerifySignature(t *testing.T) {
|
||||
BuilderIndex: builderIndexWanted,
|
||||
BeaconBlockRoot: make([]byte, 32),
|
||||
BlobKzgCommitments: [][]byte{make([]byte, 48), make([]byte, 48), make([]byte, 48)},
|
||||
StateRoot: make([]byte, 32),
|
||||
BeaconStateRoot: make([]byte, 32),
|
||||
}
|
||||
|
||||
t.Run("signature valid", func(t *testing.T) {
|
||||
@@ -246,7 +246,7 @@ func TestExecutionPayloadEnvelope_SatisfyRequirement(t *testing.T) {
|
||||
Payload: &enginev1.ExecutionPayloadDeneb{},
|
||||
BeaconBlockRoot: make([]byte, 32),
|
||||
BlobKzgCommitments: [][]byte{make([]byte, 48), make([]byte, 48), make([]byte, 48)},
|
||||
StateRoot: make([]byte, 32),
|
||||
BeaconStateRoot: make([]byte, 32),
|
||||
},
|
||||
Signature: make([]byte, 96),
|
||||
})
|
||||
@@ -263,7 +263,7 @@ func TestExecutionPayloadEnvelope_SatisfyRequirement(t *testing.T) {
|
||||
Payload: &enginev1.ExecutionPayloadDeneb{},
|
||||
BeaconBlockRoot: make([]byte, 32),
|
||||
BlobKzgCommitments: [][]byte{make([]byte, 48), make([]byte, 48), make([]byte, 48)},
|
||||
StateRoot: make([]byte, 32),
|
||||
BeaconStateRoot: make([]byte, 32),
|
||||
},
|
||||
Signature: make([]byte, 96),
|
||||
})
|
||||
|
||||
3
changelog/potuz_fix_forkmaps_log.md
Normal file
3
changelog/potuz_fix_forkmaps_log.md
Normal file
@@ -0,0 +1,3 @@
|
||||
### Ignored
|
||||
|
||||
- Fix the debug log with the config file values at startup.
|
||||
@@ -311,6 +311,17 @@ type BeaconChainConfig struct {
|
||||
|
||||
// Builder
|
||||
MinBuilderBalance uint64 `yaml:"MIN_BUILDER_BALANCE" spec:"true"` // MinBuilderBalance defines the minimal builder balance to accept bid from.
|
||||
|
||||
// Future values to make build happy.
|
||||
EIP7805ForkVersion []byte `yaml:"EIP7805_FORK_VERSION" spec:"true"` // EIP7805ForkVersion is used to represent the fork version for EIP-7805.
|
||||
EIP7805ForkEpoch primitives.Epoch `yaml:"EIP7805_FORK_EPOCH" spec:"true"` // EIP7805ForkEpoch is used to represent the assigned fork epoch for EIP-7805.
|
||||
ReorgHeadWeightThreshold uint64 `yaml:"REORG_HEAD_WEIGHT_THRESHOLD" spec:"true"` // ReorgHeadWeightThreshold is used to represent the threshold for reorg head weight.
|
||||
WhiskEpochsPerShufflingPhase uint64 `yaml:"WHISK_EPOCHS_PER_SHUFFLING_PHASE" spec:"true"` // WhiskEpochsPerShufflingPhase is used to represent the number of epochs per shuffling phase.
|
||||
WhiskProposerSelectionGap uint64 `yaml:"WHISK_PROPOSER_SELECTION_GAP" spec:"true"` // WhiskProposerSelectionGap is used to represent the proposer selection gap.
|
||||
NumberOfCustodyGroups uint64 `yaml:"NUMBER_OF_CUSTODY_GROUPS" spec:"true"` // NumberOfCustodyGroups is used to represent the number of custody groups.
|
||||
MaxBlobsPerBlockFulu int `yaml:"MAX_BLOBS_PER_BLOCK_FULU" spec:"true"` // MaxBlobsPerBlockFulu defines the max blobs that could exist in a block post Fulu hard fork.
|
||||
MaxRequestPayloads uint64 `yaml:"MAX_REQUEST_PAYLOADS" spec:"true"` // MaxRequestPayloads is the maximum number of payloads in a single request.
|
||||
|
||||
}
|
||||
|
||||
// InitializeForkSchedule initializes the schedules forks baked into the config.
|
||||
|
||||
@@ -65,6 +65,8 @@ func UnmarshalConfig(yamlFile []byte, conf *BeaconChainConfig) (*BeaconChainConf
|
||||
}
|
||||
// recompute SqrRootSlotsPerEpoch constant to handle non-standard values of SlotsPerEpoch
|
||||
conf.SqrRootSlotsPerEpoch = primitives.Slot(math.IntegerSquareRoot(uint64(conf.SlotsPerEpoch)))
|
||||
// Recompute the fork schedule
|
||||
conf.InitializeForkSchedule()
|
||||
log.Debugf("Config file values: %+v", conf)
|
||||
return conf, nil
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ func (p *executionPayloadEnvelope) IsNil() bool {
|
||||
if p.p.BlobKzgCommitments == nil {
|
||||
return true
|
||||
}
|
||||
if p.p.StateRoot == nil {
|
||||
if p.p.BeaconStateRoot == nil {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
@@ -132,7 +132,7 @@ func (p *executionPayloadEnvelope) BlobKzgCommitments() [][]byte {
|
||||
|
||||
// StateRoot returns the wrapped value
|
||||
func (p *executionPayloadEnvelope) StateRoot() [field_params.RootLength]byte {
|
||||
return [field_params.RootLength]byte(p.p.StateRoot)
|
||||
return [field_params.RootLength]byte(p.p.BeaconStateRoot)
|
||||
}
|
||||
|
||||
// VersionedHashes returns the Versioned Hashes of the KZG commitments within
|
||||
|
||||
@@ -2,7 +2,6 @@ package primitives
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math"
|
||||
|
||||
fssz "github.com/prysmaticlabs/fastssz"
|
||||
)
|
||||
@@ -14,7 +13,7 @@ var _ fssz.Unmarshaler = (*PTCStatus)(nil)
|
||||
// PTCStatus represents a single payload status. These are the
|
||||
// possible votes that the Payload Timeliness Committee can cast
|
||||
// in ePBS when attesting for an execution payload.
|
||||
type PTCStatus uint64
|
||||
type PTCStatus uint8
|
||||
|
||||
// Defined constants
|
||||
const (
|
||||
@@ -31,9 +30,6 @@ func (s PTCStatus) HashTreeRoot() ([32]byte, error) {
|
||||
|
||||
// HashTreeRootWith --
|
||||
func (s PTCStatus) HashTreeRootWith(hh *fssz.Hasher) error {
|
||||
if s > math.MaxUint8 {
|
||||
return fmt.Errorf("expected uint8 value, received %d", uint64(s))
|
||||
}
|
||||
hh.PutUint8(uint8(s))
|
||||
return nil
|
||||
}
|
||||
@@ -58,9 +54,6 @@ func (s *PTCStatus) MarshalSSZTo(dst []byte) ([]byte, error) {
|
||||
|
||||
// MarshalSSZ --
|
||||
func (s *PTCStatus) MarshalSSZ() ([]byte, error) {
|
||||
if *s > math.MaxUint8 {
|
||||
return nil, fmt.Errorf("expected uint8 value, received %d", uint64(*s))
|
||||
}
|
||||
marshalled := fssz.MarshalUint8([]byte{}, uint8(*s))
|
||||
return marshalled, nil
|
||||
}
|
||||
|
||||
@@ -822,12 +822,12 @@ func (e *ExecutionPayloadEnvelope) MarshalSSZTo(buf []byte) (dst []byte, err err
|
||||
dst = ssz.WriteOffset(dst, offset)
|
||||
offset += len(e.BlobKzgCommitments) * 48
|
||||
|
||||
// Field (6) 'StateRoot'
|
||||
if size := len(e.StateRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32)
|
||||
// Field (6) 'BeaconStateRoot'
|
||||
if size := len(e.BeaconStateRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.BeaconStateRoot", size, 32)
|
||||
return
|
||||
}
|
||||
dst = append(dst, e.StateRoot...)
|
||||
dst = append(dst, e.BeaconStateRoot...)
|
||||
|
||||
// Field (0) 'Payload'
|
||||
if dst, err = e.Payload.MarshalSSZTo(dst); err != nil {
|
||||
@@ -897,11 +897,11 @@ func (e *ExecutionPayloadEnvelope) UnmarshalSSZ(buf []byte) error {
|
||||
return ssz.ErrOffset
|
||||
}
|
||||
|
||||
// Field (6) 'StateRoot'
|
||||
if cap(e.StateRoot) == 0 {
|
||||
e.StateRoot = make([]byte, 0, len(buf[60:92]))
|
||||
// Field (6) 'BeaconStateRoot'
|
||||
if cap(e.BeaconStateRoot) == 0 {
|
||||
e.BeaconStateRoot = make([]byte, 0, len(buf[60:92]))
|
||||
}
|
||||
e.StateRoot = append(e.StateRoot, buf[60:92]...)
|
||||
e.BeaconStateRoot = append(e.BeaconStateRoot, buf[60:92]...)
|
||||
|
||||
// Field (0) 'Payload'
|
||||
{
|
||||
@@ -1016,12 +1016,12 @@ func (e *ExecutionPayloadEnvelope) HashTreeRootWith(hh *ssz.Hasher) (err error)
|
||||
hh.MerkleizeWithMixin(subIndx, numItems, 4096)
|
||||
}
|
||||
|
||||
// Field (6) 'StateRoot'
|
||||
if size := len(e.StateRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.StateRoot", size, 32)
|
||||
// Field (6) 'BeaconStateRoot'
|
||||
if size := len(e.BeaconStateRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.BeaconStateRoot", size, 32)
|
||||
return
|
||||
}
|
||||
hh.PutBytes(e.StateRoot)
|
||||
hh.PutBytes(e.BeaconStateRoot)
|
||||
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
|
||||
@@ -11,7 +11,7 @@ func (s *SignedExecutionPayloadEnvelope) Blind() *SignedBlindPayloadEnvelope {
|
||||
Message: &BlindPayloadEnvelope{
|
||||
ParentHash: s.Message.Payload.ParentHash,
|
||||
FeeRecipient: s.Message.Payload.FeeRecipient,
|
||||
StateRoot: s.Message.StateRoot,
|
||||
StateRoot: s.Message.Payload.StateRoot,
|
||||
ReceiptsRoot: s.Message.Payload.ReceiptsRoot,
|
||||
LogsBloom: s.Message.Payload.LogsBloom,
|
||||
PrevRandao: s.Message.Payload.PrevRandao,
|
||||
@@ -28,7 +28,7 @@ func (s *SignedExecutionPayloadEnvelope) Blind() *SignedBlindPayloadEnvelope {
|
||||
BeaconBlockRoot: s.Message.BeaconBlockRoot,
|
||||
Slot: s.Message.Slot,
|
||||
BlobKzgCommitments: s.Message.BlobKzgCommitments,
|
||||
BeaconStateRoot: s.Message.StateRoot,
|
||||
BeaconStateRoot: s.Message.BeaconStateRoot,
|
||||
},
|
||||
Signature: s.Signature,
|
||||
}
|
||||
|
||||
192
proto/engine/v1/epbs.pb.go
generated
192
proto/engine/v1/epbs.pb.go
generated
@@ -192,7 +192,7 @@ type ExecutionPayloadEnvelope struct {
|
||||
BeaconBlockRoot []byte `protobuf:"bytes,4,opt,name=beacon_block_root,json=beaconBlockRoot,proto3" json:"beacon_block_root,omitempty" ssz-size:"32"`
|
||||
Slot github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot `protobuf:"varint,5,opt,name=slot,proto3" json:"slot,omitempty" cast-type:"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives.Slot"`
|
||||
BlobKzgCommitments [][]byte `protobuf:"bytes,6,rep,name=blob_kzg_commitments,json=blobKzgCommitments,proto3" json:"blob_kzg_commitments,omitempty" ssz-max:"4096" ssz-size:"?,48"`
|
||||
StateRoot []byte `protobuf:"bytes,7,opt,name=state_root,json=stateRoot,proto3" json:"state_root,omitempty" ssz-size:"32"`
|
||||
BeaconStateRoot []byte `protobuf:"bytes,7,opt,name=beacon_state_root,json=beaconStateRoot,proto3" json:"beacon_state_root,omitempty" ssz-size:"32"`
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadEnvelope) Reset() {
|
||||
@@ -269,9 +269,9 @@ func (x *ExecutionPayloadEnvelope) GetBlobKzgCommitments() [][]byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *ExecutionPayloadEnvelope) GetStateRoot() []byte {
|
||||
func (x *ExecutionPayloadEnvelope) GetBeaconStateRoot() []byte {
|
||||
if x != nil {
|
||||
return x.StateRoot
|
||||
return x.BeaconStateRoot
|
||||
}
|
||||
return nil
|
||||
}
|
||||
@@ -637,7 +637,7 @@ var file_proto_engine_v1_epbs_proto_rawDesc = []byte{
|
||||
0x64, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x45, 0x50, 0x42, 0x53, 0x52, 0x07, 0x6d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72,
|
||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52,
|
||||
0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xa5, 0x04, 0x0a, 0x18, 0x45,
|
||||
0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xb2, 0x04, 0x0a, 0x18, 0x45,
|
||||
0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45,
|
||||
0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x43, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f,
|
||||
0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72,
|
||||
@@ -669,99 +669,99 @@ var file_proto_engine_v1_epbs_proto_rawDesc = []byte{
|
||||
0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18,
|
||||
0x06, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92,
|
||||
0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67,
|
||||
0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x73,
|
||||
0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42,
|
||||
0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f,
|
||||
0x6f, 0x74, 0x22, 0x8e, 0x01, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x45, 0x78, 0x65,
|
||||
0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76,
|
||||
0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75,
|
||||
0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63,
|
||||
0x75, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76, 0x65,
|
||||
0x6c, 0x6f, 0x70, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a,
|
||||
0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c,
|
||||
0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74,
|
||||
0x75, 0x72, 0x65, 0x22, 0x86, 0x01, 0x0a, 0x1a, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c,
|
||||
0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x11, 0x62,
|
||||
0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74,
|
||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f,
|
||||
0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x22,
|
||||
0x8e, 0x01, 0x0a, 0x1e, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f,
|
||||
0x70, 0x65, 0x12, 0x46, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x2c, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65,
|
||||
0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70,
|
||||
0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69,
|
||||
0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a,
|
||||
0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
|
||||
0x22, 0x86, 0x01, 0x0a, 0x1a, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x64, 0x42, 0x6c, 0x69, 0x6e, 0x64,
|
||||
0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12,
|
||||
0x42, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69,
|
||||
0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f,
|
||||
0x61, 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39, 0x36, 0x52, 0x09,
|
||||
0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xd2, 0x07, 0x0a, 0x14, 0x42, 0x6c,
|
||||
0x69, 0x6e, 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f,
|
||||
0x70, 0x65, 0x12, 0x42, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x65,
|
||||
0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x61,
|
||||
0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76, 0x65, 0x6c, 0x6f, 0x70, 0x65, 0x52, 0x07, 0x6d,
|
||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x24, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74,
|
||||
0x75, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x39,
|
||||
0x36, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xd2, 0x07, 0x0a,
|
||||
0x14, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x45, 0x6e, 0x76,
|
||||
0x65, 0x6c, 0x6f, 0x70, 0x65, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f,
|
||||
0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02,
|
||||
0x33, 0x32, 0x52, 0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b,
|
||||
0x0a, 0x0d, 0x66, 0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66,
|
||||
0x65, 0x65, 0x52, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73,
|
||||
0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42,
|
||||
0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f,
|
||||
0x6f, 0x74, 0x12, 0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72,
|
||||
0x6f, 0x6f, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33,
|
||||
0x32, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12,
|
||||
0x26, 0x0a, 0x0a, 0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20,
|
||||
0x01, 0x28, 0x0c, 0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f,
|
||||
0x67, 0x73, 0x42, 0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f,
|
||||
0x72, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5,
|
||||
0x18, 0x02, 0x33, 0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f,
|
||||
0x12, 0x21, 0x0a, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72,
|
||||
0x18, 0x07, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d,
|
||||
0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74,
|
||||
0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74,
|
||||
0x12, 0x19, 0x0a, 0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01,
|
||||
0x28, 0x04, 0x52, 0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74,
|
||||
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09,
|
||||
0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74,
|
||||
0x72, 0x61, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92,
|
||||
0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61,
|
||||
0x12, 0x2f, 0x0a, 0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72,
|
||||
0x5f, 0x67, 0x61, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02,
|
||||
0x33, 0x32, 0x52, 0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61,
|
||||
0x73, 0x12, 0x25, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18,
|
||||
0x0d, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62,
|
||||
0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62,
|
||||
0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x52,
|
||||
0x0b, 0x62, 0x6c, 0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f,
|
||||
0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18,
|
||||
0x0f, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f,
|
||||
0x62, 0x47, 0x61, 0x73, 0x12, 0x74, 0x0a, 0x0d, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x5f,
|
||||
0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18,
|
||||
0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73,
|
||||
0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f,
|
||||
0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70,
|
||||
0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61,
|
||||
0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0c, 0x62, 0x75,
|
||||
0x69, 0x6c, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65,
|
||||
0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18,
|
||||
0x11, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62,
|
||||
0x65, 0x61, 0x63, 0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x59,
|
||||
0x0a, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5,
|
||||
0x18, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79,
|
||||
0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d,
|
||||
0x2f, 0x76, 0x35, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79,
|
||||
0x70, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53,
|
||||
0x6c, 0x6f, 0x74, 0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f,
|
||||
0x62, 0x5f, 0x6b, 0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74,
|
||||
0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34,
|
||||
0x38, 0x92, 0xb5, 0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b,
|
||||
0x7a, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x32, 0x0a,
|
||||
0x11, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f,
|
||||
0x6f, 0x74, 0x18, 0x14, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32,
|
||||
0x52, 0x0f, 0x62, 0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f,
|
||||
0x74, 0x42, 0x96, 0x01, 0x0a, 0x16, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65,
|
||||
0x75, 0x6d, 0x2e, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78,
|
||||
0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x50, 0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
|
||||
0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70,
|
||||
0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e,
|
||||
0x67, 0x69, 0x6e, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31,
|
||||
0xaa, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69,
|
||||
0x6e, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d,
|
||||
0x5c, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x33,
|
||||
0x70, 0x65, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x68, 0x61, 0x73,
|
||||
0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52,
|
||||
0x0a, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x48, 0x61, 0x73, 0x68, 0x12, 0x2b, 0x0a, 0x0d, 0x66,
|
||||
0x65, 0x65, 0x5f, 0x72, 0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x32, 0x30, 0x52, 0x0c, 0x66, 0x65, 0x65, 0x52,
|
||||
0x65, 0x63, 0x69, 0x70, 0x69, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74,
|
||||
0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5,
|
||||
0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x73, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x12,
|
||||
0x2b, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x5f, 0x72, 0x6f, 0x6f, 0x74,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0c,
|
||||
0x72, 0x65, 0x63, 0x65, 0x69, 0x70, 0x74, 0x73, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x26, 0x0a, 0x0a,
|
||||
0x6c, 0x6f, 0x67, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c,
|
||||
0x42, 0x07, 0x8a, 0xb5, 0x18, 0x03, 0x32, 0x35, 0x36, 0x52, 0x09, 0x6c, 0x6f, 0x67, 0x73, 0x42,
|
||||
0x6c, 0x6f, 0x6f, 0x6d, 0x12, 0x27, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x76, 0x5f, 0x72, 0x61, 0x6e,
|
||||
0x64, 0x61, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33,
|
||||
0x32, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x76, 0x52, 0x61, 0x6e, 0x64, 0x61, 0x6f, 0x12, 0x21, 0x0a,
|
||||
0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x07, 0x20,
|
||||
0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72,
|
||||
0x12, 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20,
|
||||
0x01, 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a,
|
||||
0x08, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x04, 0x52,
|
||||
0x07, 0x67, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65,
|
||||
0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x74, 0x69, 0x6d,
|
||||
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x25, 0x0a, 0x0a, 0x65, 0x78, 0x74, 0x72, 0x61, 0x5f,
|
||||
0x64, 0x61, 0x74, 0x61, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x92, 0xb5, 0x18, 0x02,
|
||||
0x33, 0x32, 0x52, 0x09, 0x65, 0x78, 0x74, 0x72, 0x61, 0x44, 0x61, 0x74, 0x61, 0x12, 0x2f, 0x0a,
|
||||
0x10, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x67, 0x61,
|
||||
0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52,
|
||||
0x0d, 0x62, 0x61, 0x73, 0x65, 0x46, 0x65, 0x65, 0x50, 0x65, 0x72, 0x47, 0x61, 0x73, 0x12, 0x25,
|
||||
0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x0d, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63,
|
||||
0x6b, 0x48, 0x61, 0x73, 0x68, 0x12, 0x22, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61,
|
||||
0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x62, 0x6c,
|
||||
0x6f, 0x62, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x26, 0x0a, 0x0f, 0x65, 0x78, 0x63,
|
||||
0x65, 0x73, 0x73, 0x5f, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x67, 0x61, 0x73, 0x18, 0x0f, 0x20, 0x01,
|
||||
0x28, 0x04, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x65, 0x73, 0x73, 0x42, 0x6c, 0x6f, 0x62, 0x47, 0x61,
|
||||
0x73, 0x12, 0x74, 0x0a, 0x0d, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x6e, 0x64,
|
||||
0x65, 0x78, 0x18, 0x10, 0x20, 0x01, 0x28, 0x04, 0x42, 0x4f, 0x82, 0xb5, 0x18, 0x4b, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61, 0x74,
|
||||
0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35, 0x2f,
|
||||
0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f,
|
||||
0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64,
|
||||
0x61, 0x74, 0x6f, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x52, 0x0c, 0x62, 0x75, 0x69, 0x6c, 0x64,
|
||||
0x65, 0x72, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65, 0x61, 0x63, 0x6f,
|
||||
0x6e, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18, 0x11, 0x20, 0x01,
|
||||
0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62, 0x65, 0x61, 0x63,
|
||||
0x6f, 0x6e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x6f, 0x6f, 0x74, 0x12, 0x59, 0x0a, 0x04, 0x73,
|
||||
0x6c, 0x6f, 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x04, 0x42, 0x45, 0x82, 0xb5, 0x18, 0x41, 0x67,
|
||||
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x61,
|
||||
0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73, 0x6d, 0x2f, 0x76, 0x35,
|
||||
0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x75, 0x73, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73,
|
||||
0x2f, 0x70, 0x72, 0x69, 0x6d, 0x69, 0x74, 0x69, 0x76, 0x65, 0x73, 0x2e, 0x53, 0x6c, 0x6f, 0x74,
|
||||
0x52, 0x04, 0x73, 0x6c, 0x6f, 0x74, 0x12, 0x42, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x62, 0x5f, 0x6b,
|
||||
0x7a, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x13,
|
||||
0x20, 0x03, 0x28, 0x0c, 0x42, 0x10, 0x8a, 0xb5, 0x18, 0x04, 0x3f, 0x2c, 0x34, 0x38, 0x92, 0xb5,
|
||||
0x18, 0x04, 0x34, 0x30, 0x39, 0x36, 0x52, 0x12, 0x62, 0x6c, 0x6f, 0x62, 0x4b, 0x7a, 0x67, 0x43,
|
||||
0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x11, 0x62, 0x65,
|
||||
0x61, 0x63, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x72, 0x6f, 0x6f, 0x74, 0x18,
|
||||
0x14, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x06, 0x8a, 0xb5, 0x18, 0x02, 0x33, 0x32, 0x52, 0x0f, 0x62,
|
||||
0x65, 0x61, 0x63, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6f, 0x74, 0x42, 0x96,
|
||||
0x01, 0x0a, 0x16, 0x6f, 0x72, 0x67, 0x2e, 0x65, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e,
|
||||
0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x14, 0x45, 0x78, 0x65, 0x63, 0x75,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
|
||||
0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x72,
|
||||
0x79, 0x73, 0x6d, 0x61, 0x74, 0x69, 0x63, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x70, 0x72, 0x79, 0x73,
|
||||
0x6d, 0x2f, 0x76, 0x35, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x65, 0x6e, 0x67, 0x69, 0x6e,
|
||||
0x65, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x76, 0x31, 0xaa, 0x02, 0x12,
|
||||
0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x2e, 0x45, 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x2e,
|
||||
0x56, 0x31, 0xca, 0x02, 0x12, 0x45, 0x74, 0x68, 0x65, 0x72, 0x65, 0x75, 0x6d, 0x5c, 0x45, 0x6e,
|
||||
0x67, 0x69, 0x6e, 0x65, 0x5c, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
@@ -62,7 +62,7 @@ message ExecutionPayloadEnvelope {
|
||||
(ethereum.eth.ext.ssz_size) = "?,48",
|
||||
(ethereum.eth.ext.ssz_max) = "max_blob_commitments.size"
|
||||
];
|
||||
bytes state_root = 7 [ (ethereum.eth.ext.ssz_size) = "32" ];
|
||||
bytes beacon_state_root = 7 [ (ethereum.eth.ext.ssz_size) = "32" ];
|
||||
}
|
||||
|
||||
message SignedExecutionPayloadEnvelope {
|
||||
|
||||
@@ -196,7 +196,6 @@ ssz_epbs_objs = [
|
||||
"BeaconBlockEpbs",
|
||||
"BeaconStateEPBS",
|
||||
"SignedBeaconBlockEpbs",
|
||||
"PayloadAttestationData",
|
||||
"PayloadAttestation",
|
||||
"PayloadAttestationMessage",
|
||||
]
|
||||
|
||||
@@ -234,7 +234,7 @@ func (b *BeaconBlockBodyEpbs) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
|
||||
// Offset (11) 'PayloadAttestations'
|
||||
dst = ssz.WriteOffset(dst, offset)
|
||||
offset += len(b.PayloadAttestations) * 208
|
||||
offset += len(b.PayloadAttestations) * 201
|
||||
|
||||
// Field (3) 'ProposerSlashings'
|
||||
if size := len(b.ProposerSlashings); size > 16 {
|
||||
@@ -535,7 +535,7 @@ func (b *BeaconBlockBodyEpbs) UnmarshalSSZ(buf []byte) error {
|
||||
// Field (11) 'PayloadAttestations'
|
||||
{
|
||||
buf = tail[o11:]
|
||||
num, err := ssz.DivideInt2(len(buf), 208, 4)
|
||||
num, err := ssz.DivideInt2(len(buf), 201, 4)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -544,7 +544,7 @@ func (b *BeaconBlockBodyEpbs) UnmarshalSSZ(buf []byte) error {
|
||||
if b.PayloadAttestations[ii] == nil {
|
||||
b.PayloadAttestations[ii] = new(PayloadAttestation)
|
||||
}
|
||||
if err = b.PayloadAttestations[ii].UnmarshalSSZ(buf[ii*208 : (ii+1)*208]); err != nil {
|
||||
if err = b.PayloadAttestations[ii].UnmarshalSSZ(buf[ii*201 : (ii+1)*201]); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
@@ -581,7 +581,7 @@ func (b *BeaconBlockBodyEpbs) SizeSSZ() (size int) {
|
||||
size += len(b.BlsToExecutionChanges) * 172
|
||||
|
||||
// Field (11) 'PayloadAttestations'
|
||||
size += len(b.PayloadAttestations) * 208
|
||||
size += len(b.PayloadAttestations) * 201
|
||||
|
||||
return
|
||||
}
|
||||
@@ -2029,7 +2029,7 @@ func (p *PayloadAttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error
|
||||
dst = ssz.MarshalUint64(dst, uint64(p.Slot))
|
||||
|
||||
// Field (2) 'PayloadStatus'
|
||||
dst = ssz.MarshalUint64(dst, uint64(p.PayloadStatus))
|
||||
dst = ssz.MarshalUint8(dst, uint64(p.PayloadStatus))
|
||||
|
||||
return
|
||||
}
|
||||
@@ -2038,7 +2038,7 @@ func (p *PayloadAttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error
|
||||
func (p *PayloadAttestationData) UnmarshalSSZ(buf []byte) error {
|
||||
var err error
|
||||
size := uint64(len(buf))
|
||||
if size != 48 {
|
||||
if size != 41 {
|
||||
return ssz.ErrSize
|
||||
}
|
||||
|
||||
@@ -2052,14 +2052,14 @@ func (p *PayloadAttestationData) UnmarshalSSZ(buf []byte) error {
|
||||
p.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[32:40]))
|
||||
|
||||
// Field (2) 'PayloadStatus'
|
||||
p.PayloadStatus = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus(ssz.UnmarshallUint64(buf[40:48]))
|
||||
p.PayloadStatus = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus(ssz.UnmarshallUint8(buf[40:41]))
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestationData object
|
||||
func (p *PayloadAttestationData) SizeSSZ() (size int) {
|
||||
size = 48
|
||||
size = 41
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2083,7 +2083,7 @@ func (p *PayloadAttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
hh.PutUint64(uint64(p.Slot))
|
||||
|
||||
// Field (2) 'PayloadStatus'
|
||||
hh.PutUint64(uint64(p.PayloadStatus))
|
||||
hh.PutUint8(uint64(p.PayloadStatus))
|
||||
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
@@ -2127,7 +2127,7 @@ func (p *PayloadAttestation) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
func (p *PayloadAttestation) UnmarshalSSZ(buf []byte) error {
|
||||
var err error
|
||||
size := uint64(len(buf))
|
||||
if size != 208 {
|
||||
if size != 201 {
|
||||
return ssz.ErrSize
|
||||
}
|
||||
|
||||
@@ -2141,22 +2141,22 @@ func (p *PayloadAttestation) UnmarshalSSZ(buf []byte) error {
|
||||
if p.Data == nil {
|
||||
p.Data = new(PayloadAttestationData)
|
||||
}
|
||||
if err = p.Data.UnmarshalSSZ(buf[64:112]); err != nil {
|
||||
if err = p.Data.UnmarshalSSZ(buf[64:105]); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Field (2) 'Signature'
|
||||
if cap(p.Signature) == 0 {
|
||||
p.Signature = make([]byte, 0, len(buf[112:208]))
|
||||
p.Signature = make([]byte, 0, len(buf[105:201]))
|
||||
}
|
||||
p.Signature = append(p.Signature, buf[112:208]...)
|
||||
p.Signature = append(p.Signature, buf[105:201]...)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestation object
|
||||
func (p *PayloadAttestation) SizeSSZ() (size int) {
|
||||
size = 208
|
||||
size = 201
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2191,95 +2191,3 @@ func (p *PayloadAttestation) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
}
|
||||
|
||||
// MarshalSSZ ssz marshals the PayloadAttestationMessage object
|
||||
func (p *PayloadAttestationMessage) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(p)
|
||||
}
|
||||
|
||||
// MarshalSSZTo ssz marshals the PayloadAttestationMessage object to a target array
|
||||
func (p *PayloadAttestationMessage) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = buf
|
||||
|
||||
// Field (0) 'ValidatorIndex'
|
||||
dst = ssz.MarshalUint64(dst, uint64(p.ValidatorIndex))
|
||||
|
||||
// Field (1) 'Data'
|
||||
if p.Data == nil {
|
||||
p.Data = new(PayloadAttestationData)
|
||||
}
|
||||
if dst, err = p.Data.MarshalSSZTo(dst); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Field (2) 'Signature'
|
||||
if size := len(p.Signature); size != 96 {
|
||||
err = ssz.ErrBytesLengthFn("--.Signature", size, 96)
|
||||
return
|
||||
}
|
||||
dst = append(dst, p.Signature...)
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UnmarshalSSZ ssz unmarshals the PayloadAttestationMessage object
|
||||
func (p *PayloadAttestationMessage) UnmarshalSSZ(buf []byte) error {
|
||||
var err error
|
||||
size := uint64(len(buf))
|
||||
if size != 152 {
|
||||
return ssz.ErrSize
|
||||
}
|
||||
|
||||
// Field (0) 'ValidatorIndex'
|
||||
p.ValidatorIndex = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.ValidatorIndex(ssz.UnmarshallUint64(buf[0:8]))
|
||||
|
||||
// Field (1) 'Data'
|
||||
if p.Data == nil {
|
||||
p.Data = new(PayloadAttestationData)
|
||||
}
|
||||
if err = p.Data.UnmarshalSSZ(buf[8:56]); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Field (2) 'Signature'
|
||||
if cap(p.Signature) == 0 {
|
||||
p.Signature = make([]byte, 0, len(buf[56:152]))
|
||||
}
|
||||
p.Signature = append(p.Signature, buf[56:152]...)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestationMessage object
|
||||
func (p *PayloadAttestationMessage) SizeSSZ() (size int) {
|
||||
size = 152
|
||||
return
|
||||
}
|
||||
|
||||
// HashTreeRoot ssz hashes the PayloadAttestationMessage object
|
||||
func (p *PayloadAttestationMessage) HashTreeRoot() ([32]byte, error) {
|
||||
return ssz.HashWithDefaultHasher(p)
|
||||
}
|
||||
|
||||
// HashTreeRootWith ssz hashes the PayloadAttestationMessage object with a hasher
|
||||
func (p *PayloadAttestationMessage) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
indx := hh.Index()
|
||||
|
||||
// Field (0) 'ValidatorIndex'
|
||||
hh.PutUint64(uint64(p.ValidatorIndex))
|
||||
|
||||
// Field (1) 'Data'
|
||||
if err = p.Data.HashTreeRootWith(hh); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// Field (2) 'Signature'
|
||||
if size := len(p.Signature); size != 96 {
|
||||
err = ssz.ErrBytesLengthFn("--.Signature", size, 96)
|
||||
return
|
||||
}
|
||||
hh.PutBytes(p.Signature)
|
||||
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
}
|
||||
|
||||
86
proto/prysm/v1alpha1/payload_attestation_ssz.go
Normal file
86
proto/prysm/v1alpha1/payload_attestation_ssz.go
Normal file
@@ -0,0 +1,86 @@
|
||||
package eth
|
||||
|
||||
import (
|
||||
ssz "github.com/prysmaticlabs/fastssz"
|
||||
github_com_prysmaticlabs_prysm_v5_consensus_types_primitives "github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
|
||||
)
|
||||
|
||||
// MarshalSSZ ssz marshals the PayloadAttestationData object
|
||||
func (p *PayloadAttestationData) MarshalSSZ() ([]byte, error) {
|
||||
return ssz.MarshalSSZ(p)
|
||||
}
|
||||
|
||||
// MarshalSSZTo ssz marshals the PayloadAttestationData object to a target array
|
||||
func (p *PayloadAttestationData) MarshalSSZTo(buf []byte) (dst []byte, err error) {
|
||||
dst = buf
|
||||
|
||||
// Field (0) 'BeaconBlockRoot'
|
||||
if size := len(p.BeaconBlockRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32)
|
||||
return
|
||||
}
|
||||
dst = append(dst, p.BeaconBlockRoot...)
|
||||
|
||||
// Field (1) 'Slot'
|
||||
dst = ssz.MarshalUint64(dst, uint64(p.Slot))
|
||||
|
||||
// Field (2) 'PayloadStatus'
|
||||
dst = ssz.MarshalUint8(dst, uint8(p.PayloadStatus))
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UnmarshalSSZ ssz unmarshals the PayloadAttestationData object
|
||||
func (p *PayloadAttestationData) UnmarshalSSZ(buf []byte) error {
|
||||
var err error
|
||||
size := uint64(len(buf))
|
||||
if size != 41 {
|
||||
return ssz.ErrSize
|
||||
}
|
||||
|
||||
// Field (0) 'BeaconBlockRoot'
|
||||
if cap(p.BeaconBlockRoot) == 0 {
|
||||
p.BeaconBlockRoot = make([]byte, 0, len(buf[0:32]))
|
||||
}
|
||||
p.BeaconBlockRoot = append(p.BeaconBlockRoot, buf[0:32]...)
|
||||
|
||||
// Field (1) 'Slot'
|
||||
p.Slot = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.Slot(ssz.UnmarshallUint64(buf[32:40]))
|
||||
|
||||
// Field (2) 'PayloadStatus'
|
||||
p.PayloadStatus = github_com_prysmaticlabs_prysm_v5_consensus_types_primitives.PTCStatus(ssz.UnmarshallUint8(buf[40:41]))
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// SizeSSZ returns the ssz encoded size in bytes for the PayloadAttestationData object
|
||||
func (p *PayloadAttestationData) SizeSSZ() (size int) {
|
||||
size = 41
|
||||
return
|
||||
}
|
||||
|
||||
// HashTreeRoot ssz hashes the PayloadAttestationData object
|
||||
func (p *PayloadAttestationData) HashTreeRoot() ([32]byte, error) {
|
||||
return ssz.HashWithDefaultHasher(p)
|
||||
}
|
||||
|
||||
// HashTreeRootWith ssz hashes the PayloadAttestationData object with a hasher
|
||||
func (p *PayloadAttestationData) HashTreeRootWith(hh *ssz.Hasher) (err error) {
|
||||
indx := hh.Index()
|
||||
|
||||
// Field (0) 'BeaconBlockRoot'
|
||||
if size := len(p.BeaconBlockRoot); size != 32 {
|
||||
err = ssz.ErrBytesLengthFn("--.BeaconBlockRoot", size, 32)
|
||||
return
|
||||
}
|
||||
hh.PutBytes(p.BeaconBlockRoot)
|
||||
|
||||
// Field (1) 'Slot'
|
||||
hh.PutUint64(uint64(p.Slot))
|
||||
|
||||
// Field (2) 'PayloadStatus'
|
||||
hh.PutUint8(uint8(p.PayloadStatus))
|
||||
|
||||
hh.Merkleize(indx)
|
||||
return
|
||||
}
|
||||
@@ -377,7 +377,7 @@ func ExecutionPayloadEnvelope(t *testing.T) *enginev1.ExecutionPayloadEnvelope {
|
||||
ExecutionRequests: ExecutionRequests(t), BuilderIndex: primitives.ValidatorIndex(randomUint64(t)),
|
||||
BeaconBlockRoot: randomBytes(32, t),
|
||||
BlobKzgCommitments: [][]byte{randomBytes(48, t), randomBytes(48, t), randomBytes(48, t)},
|
||||
StateRoot: randomBytes(32, t),
|
||||
BeaconStateRoot: randomBytes(32, t),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,8 @@ func ToEpoch(slot primitives.Slot) primitives.Epoch {
|
||||
func ToForkVersion(slot primitives.Slot) int {
|
||||
epoch := ToEpoch(slot)
|
||||
switch {
|
||||
case epoch >= params.BeaconConfig().EPBSForkEpoch:
|
||||
return version.EPBS
|
||||
case epoch >= params.BeaconConfig().FuluForkEpoch:
|
||||
return version.Fulu
|
||||
case epoch >= params.BeaconConfig().ElectraForkEpoch:
|
||||
|
||||
Reference in New Issue
Block a user