@@ -35,6 +35,7 @@ type PayloadAttributes struct {
35
35
Random common.Hash `json:"prevRandao" gencodec:"required"`
36
36
SuggestedFeeRecipient common.Address `json:"suggestedFeeRecipient" gencodec:"required"`
37
37
Withdrawals []* types.Withdrawal `json:"withdrawals"`
38
+ BeaconRoot * common.Hash `json:"parentBeaconBlockRoot"`
38
39
}
39
40
40
41
// JSON type overrides for PayloadAttributes.
@@ -171,7 +172,7 @@ func decodeTransactions(enc [][]byte) ([]*types.Transaction, error) {
171
172
// and that the blockhash of the constructed block matches the parameters. Nil
172
173
// Withdrawals value will propagate through the returned block. Empty
173
174
// 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 ) {
175
176
txs , err := decodeTransactions (params .Transactions )
176
177
if err != nil {
177
178
return nil , err
@@ -207,25 +208,25 @@ func ExecutableDataToBlock(params ExecutableData, versionedHashes []common.Hash)
207
208
withdrawalsRoot = & h
208
209
}
209
210
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 ,
229
230
}
230
231
block := types .NewBlockWithHeader (header ).WithBody (txs , nil /* uncles */ ).WithWithdrawals (params .Withdrawals )
231
232
if block .Hash () != params .BlockHash {
@@ -255,7 +256,6 @@ func BlockToExecutableData(block *types.Block, fees *big.Int, sidecars []*types.
255
256
Withdrawals : block .Withdrawals (),
256
257
BlobGasUsed : block .BlobGasUsed (),
257
258
ExcessBlobGas : block .ExcessBlobGas (),
258
- // TODO BeaconRoot
259
259
}
260
260
bundle := BlobsBundleV1 {
261
261
Commitments : make ([]hexutil.Bytes , 0 ),
0 commit comments