Skip to content

Commit

Permalink
add withdrawalRequests to execution payload (#10369)
Browse files Browse the repository at this point in the history
  • Loading branch information
racytech authored May 16, 2024
1 parent 9839edc commit e3b4bd1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
11 changes: 11 additions & 0 deletions core/types/withdrawal_requests.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package types

import libcommon "github.com/ledgerwatch/erigon-lib/common"

type WithdrawalRequest struct {
SourceAddress libcommon.Address
ValidatorPubkey [pLen]byte // bls
Amount uint64
}

type WithdrawalRequests []*WithdrawalRequest
37 changes: 19 additions & 18 deletions turbo/engineapi/engine_types/jsonrpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,25 @@ import (

// ExecutionPayload represents an execution payload (aka block)
type ExecutionPayload struct {
ParentHash common.Hash `json:"parentHash" gencodec:"required"`
FeeRecipient common.Address `json:"feeRecipient" gencodec:"required"`
StateRoot common.Hash `json:"stateRoot" gencodec:"required"`
ReceiptsRoot common.Hash `json:"receiptsRoot" gencodec:"required"`
LogsBloom hexutility.Bytes `json:"logsBloom" gencodec:"required"`
PrevRandao common.Hash `json:"prevRandao" gencodec:"required"`
BlockNumber hexutil.Uint64 `json:"blockNumber" gencodec:"required"`
GasLimit hexutil.Uint64 `json:"gasLimit" gencodec:"required"`
GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
Timestamp hexutil.Uint64 `json:"timestamp" gencodec:"required"`
ExtraData hexutility.Bytes `json:"extraData" gencodec:"required"`
BaseFeePerGas *hexutil.Big `json:"baseFeePerGas" gencodec:"required"`
BlockHash common.Hash `json:"blockHash" gencodec:"required"`
Transactions []hexutility.Bytes `json:"transactions" gencodec:"required"`
Withdrawals []*types.Withdrawal `json:"withdrawals"`
BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"`
ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"`
DepositRequests types.Deposits `json:"depositRequests"` // do not forget to add it into erigon-lib/gointerfaces/types if needed
ParentHash common.Hash `json:"parentHash" gencodec:"required"`
FeeRecipient common.Address `json:"feeRecipient" gencodec:"required"`
StateRoot common.Hash `json:"stateRoot" gencodec:"required"`
ReceiptsRoot common.Hash `json:"receiptsRoot" gencodec:"required"`
LogsBloom hexutility.Bytes `json:"logsBloom" gencodec:"required"`
PrevRandao common.Hash `json:"prevRandao" gencodec:"required"`
BlockNumber hexutil.Uint64 `json:"blockNumber" gencodec:"required"`
GasLimit hexutil.Uint64 `json:"gasLimit" gencodec:"required"`
GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
Timestamp hexutil.Uint64 `json:"timestamp" gencodec:"required"`
ExtraData hexutility.Bytes `json:"extraData" gencodec:"required"`
BaseFeePerGas *hexutil.Big `json:"baseFeePerGas" gencodec:"required"`
BlockHash common.Hash `json:"blockHash" gencodec:"required"`
Transactions []hexutility.Bytes `json:"transactions" gencodec:"required"`
Withdrawals []*types.Withdrawal `json:"withdrawals"`
BlobGasUsed *hexutil.Uint64 `json:"blobGasUsed"`
ExcessBlobGas *hexutil.Uint64 `json:"excessBlobGas"`
DepositRequests types.Deposits `json:"depositRequests"` // do not forget to add it into erigon-lib/gointerfaces/types if needed
WithdrawalRequests types.WithdrawalRequests `json:"withdrawalRequests"`
}

// PayloadAttributes represent the attributes required to start assembling a payload
Expand Down

0 comments on commit e3b4bd1

Please sign in to comment.