@@ -115,6 +115,9 @@ type Header struct {
115
115
// Included for Ethereum compatibility in Scroll SDK
116
116
ParentBeaconRoot * common.Hash `json:"parentBeaconBlockRoot" rlp:"optional"`
117
117
118
+ // RequestsHash was added by EIP-7685 and is ignored in legacy headers.
119
+ RequestsHash * common.Hash `json:"requestsHash" rlp:"optional"`
120
+
118
121
// Hacky: used internally to mark the header as requested by the downloader at the deliver queue.
119
122
// Note: This is only used internally to mark a previously requested block, it is not included
120
123
// in db, on the network wire protocol, or in RPC responses.
@@ -314,6 +317,26 @@ func CopyHeader(h *Header) *Header {
314
317
cpy .BlockSignature = make ([]byte , len (h .BlockSignature ))
315
318
copy (cpy .BlockSignature , h .BlockSignature )
316
319
}
320
+ if h .WithdrawalsHash != nil {
321
+ cpy .WithdrawalsHash = new (common.Hash )
322
+ * cpy .WithdrawalsHash = * h .WithdrawalsHash
323
+ }
324
+ if h .ExcessBlobGas != nil {
325
+ cpy .ExcessBlobGas = new (uint64 )
326
+ * cpy .ExcessBlobGas = * h .ExcessBlobGas
327
+ }
328
+ if h .BlobGasUsed != nil {
329
+ cpy .BlobGasUsed = new (uint64 )
330
+ * cpy .BlobGasUsed = * h .BlobGasUsed
331
+ }
332
+ if h .ParentBeaconRoot != nil {
333
+ cpy .ParentBeaconRoot = new (common.Hash )
334
+ * cpy .ParentBeaconRoot = * h .ParentBeaconRoot
335
+ }
336
+ if h .RequestsHash != nil {
337
+ cpy .RequestsHash = new (common.Hash )
338
+ * cpy .RequestsHash = * h .RequestsHash
339
+ }
317
340
return & cpy
318
341
}
319
342
@@ -377,6 +400,27 @@ func (b *Block) BaseFee() *big.Int {
377
400
return new (big.Int ).Set (b .header .BaseFee )
378
401
}
379
402
403
+ func (b * Block ) BeaconRoot () * common.Hash { return b .header .ParentBeaconRoot }
404
+ func (b * Block ) RequestsHash () * common.Hash { return b .header .RequestsHash }
405
+
406
+ func (b * Block ) ExcessBlobGas () * uint64 {
407
+ var excessBlobGas * uint64
408
+ if b .header .ExcessBlobGas != nil {
409
+ excessBlobGas = new (uint64 )
410
+ * excessBlobGas = * b .header .ExcessBlobGas
411
+ }
412
+ return excessBlobGas
413
+ }
414
+
415
+ func (b * Block ) BlobGasUsed () * uint64 {
416
+ var blobGasUsed * uint64
417
+ if b .header .BlobGasUsed != nil {
418
+ blobGasUsed = new (uint64 )
419
+ * blobGasUsed = * b .header .BlobGasUsed
420
+ }
421
+ return blobGasUsed
422
+ }
423
+
380
424
func (b * Block ) Header () * Header { return CopyHeader (b .header ) }
381
425
382
426
// Body returns the non-header content of the block.
0 commit comments