@@ -35,6 +35,7 @@ type PayloadAttributes struct {
3535 Random common.Hash `json:"prevRandao" gencodec:"required"`
3636 SuggestedFeeRecipient common.Address `json:"suggestedFeeRecipient" gencodec:"required"`
3737 Withdrawals []* types.Withdrawal `json:"withdrawals"`
38+ BeaconRoot * common.Hash `json:"parentBeaconBlockRoot"`
3839}
3940
4041// JSON type overrides for PayloadAttributes.
@@ -171,7 +172,7 @@ func decodeTransactions(enc [][]byte) ([]*types.Transaction, error) {
171172// and that the blockhash of the constructed block matches the parameters. Nil
172173// Withdrawals value will propagate through the returned block. Empty
173174// Withdrawals value must be passed via non-nil, length 0 value in params.
174- func ExecutableDataToBlock (params ExecutableData , versionedHashes []common.Hash ) (* types.Block , error ) {
175+ func ExecutableDataToBlock (params ExecutableData , versionedHashes []common.Hash , beaconRoot * common. Hash ) (* types.Block , error ) {
175176 txs , err := decodeTransactions (params .Transactions )
176177 if err != nil {
177178 return nil , err
@@ -207,25 +208,25 @@ func ExecutableDataToBlock(params ExecutableData, versionedHashes []common.Hash)
207208 withdrawalsRoot = & h
208209 }
209210 header := & types.Header {
210- ParentHash : params .ParentHash ,
211- UncleHash : types .EmptyUncleHash ,
212- Coinbase : params .FeeRecipient ,
213- Root : params .StateRoot ,
214- TxHash : types .DeriveSha (types .Transactions (txs ), trie .NewStackTrie (nil )),
215- ReceiptHash : params .ReceiptsRoot ,
216- Bloom : types .BytesToBloom (params .LogsBloom ),
217- Difficulty : common .Big0 ,
218- Number : new (big.Int ).SetUint64 (params .Number ),
219- GasLimit : params .GasLimit ,
220- GasUsed : params .GasUsed ,
221- Time : params .Timestamp ,
222- BaseFee : params .BaseFeePerGas ,
223- Extra : params .ExtraData ,
224- MixDigest : params .Random ,
225- WithdrawalsHash : withdrawalsRoot ,
226- ExcessBlobGas : params .ExcessBlobGas ,
227- BlobGasUsed : params .BlobGasUsed ,
228- // TODO BeaconRoot
211+ ParentHash : params .ParentHash ,
212+ UncleHash : types .EmptyUncleHash ,
213+ Coinbase : params .FeeRecipient ,
214+ Root : params .StateRoot ,
215+ TxHash : types .DeriveSha (types .Transactions (txs ), trie .NewStackTrie (nil )),
216+ ReceiptHash : params .ReceiptsRoot ,
217+ Bloom : types .BytesToBloom (params .LogsBloom ),
218+ Difficulty : common .Big0 ,
219+ Number : new (big.Int ).SetUint64 (params .Number ),
220+ GasLimit : params .GasLimit ,
221+ GasUsed : params .GasUsed ,
222+ Time : params .Timestamp ,
223+ BaseFee : params .BaseFeePerGas ,
224+ Extra : params .ExtraData ,
225+ MixDigest : params .Random ,
226+ WithdrawalsHash : withdrawalsRoot ,
227+ ExcessBlobGas : params .ExcessBlobGas ,
228+ BlobGasUsed : params .BlobGasUsed ,
229+ ParentBeaconRoot : beaconRoot ,
229230 }
230231 block := types .NewBlockWithHeader (header ).WithBody (txs , nil /* uncles */ ).WithWithdrawals (params .Withdrawals )
231232 if block .Hash () != params .BlockHash {
@@ -255,7 +256,6 @@ func BlockToExecutableData(block *types.Block, fees *big.Int, sidecars []*types.
255256 Withdrawals : block .Withdrawals (),
256257 BlobGasUsed : block .BlobGasUsed (),
257258 ExcessBlobGas : block .ExcessBlobGas (),
258- // TODO BeaconRoot
259259 }
260260 bundle := BlobsBundleV1 {
261261 Commitments : make ([]hexutil.Bytes , 0 ),
0 commit comments