@@ -58,7 +58,7 @@ func (b *BlockGen) SetCoinbase(addr common.Address) {
5858 panic ("coinbase can only be set once" )
5959 }
6060 b .header .Coinbase = addr
61- b .gasPool = new (GasPool ).AddGas (b .header .GasLimit )
61+ b .gasPool = new (GasPool ).AddGas (b .header .GasLimit ). AddDataGas ( params . MaxDataGasPerBlock )
6262}
6363
6464// SetExtra sets the extra data field of the generated block.
@@ -78,11 +78,6 @@ func (b *BlockGen) SetDifficulty(diff *big.Int) {
7878 b .header .Difficulty = diff
7979}
8080
81- // SetExcessDataGas sets the excess_data_gas field of the generated block.
82- func (b * BlockGen ) SetExcessDataGas (excessDataGas * big.Int ) {
83- b .header .SetExcessDataGas (excessDataGas )
84- }
85-
8681// AddTx adds a transaction to the generated block. If no coinbase has
8782// been set, the block's coinbase is set to the zero address.
8883//
@@ -108,7 +103,7 @@ func (b *BlockGen) AddTxWithChain(bc *BlockChain, tx *types.Transaction) {
108103 b .SetCoinbase (common.Address {})
109104 }
110105 b .statedb .Prepare (tx .Hash (), len (b .txs ))
111- receipt , err := ApplyTransaction (b .config , bc , & b .header .Coinbase , b .gasPool , b .statedb , b .header , tx , & b .header .GasUsed , vm.Config {})
106+ receipt , err := ApplyTransaction (b .config , bc , & b .header .Coinbase , b .gasPool , b .statedb , b .header , b . parent . Header (). ExcessDataGas , tx , & b .header .GasUsed , vm.Config {})
112107 if err != nil {
113108 panic (err )
114109 }
@@ -140,15 +135,6 @@ func (b *BlockGen) BaseFee() *big.Int {
140135 return new (big.Int ).Set (b .header .BaseFee )
141136}
142137
143- // ExcessDataGas returns the EIP-4844 excess_data_gas of the block being generated.
144- func (b * BlockGen ) ExcessDataGas () * big.Int {
145- v := new (big.Int )
146- if b .header .ExcessDataGas != nil {
147- v .Set (b .header .ExcessDataGas )
148- }
149- return v
150- }
151-
152138// AddUncheckedReceipt forcefully adds a receipts to the block without a
153139// backing transaction.
154140//
0 commit comments