@@ -28,6 +28,7 @@ import (
2828 "github.com/ethereum/go-ethereum/common"
2929 "github.com/ethereum/go-ethereum/common/hexutil"
3030 "github.com/ethereum/go-ethereum/common/math"
31+ "github.com/ethereum/go-ethereum/consensus/misc/eip4844"
3132 "github.com/ethereum/go-ethereum/core"
3233 "github.com/ethereum/go-ethereum/core/rawdb"
3334 "github.com/ethereum/go-ethereum/core/state"
@@ -83,23 +84,25 @@ type stPostState struct {
8384//go:generate go run github.com/fjl/gencodec -type stEnv -field-override stEnvMarshaling -out gen_stenv.go
8485
8586type stEnv struct {
86- Coinbase common.Address `json:"currentCoinbase" gencodec:"required"`
87- Difficulty * big.Int `json:"currentDifficulty" gencodec:"optional"`
88- Random * big.Int `json:"currentRandom" gencodec:"optional"`
89- GasLimit uint64 `json:"currentGasLimit" gencodec:"required"`
90- Number uint64 `json:"currentNumber" gencodec:"required"`
91- Timestamp uint64 `json:"currentTimestamp" gencodec:"required"`
92- BaseFee * big.Int `json:"currentBaseFee" gencodec:"optional"`
87+ Coinbase common.Address `json:"currentCoinbase" gencodec:"required"`
88+ Difficulty * big.Int `json:"currentDifficulty" gencodec:"optional"`
89+ Random * big.Int `json:"currentRandom" gencodec:"optional"`
90+ GasLimit uint64 `json:"currentGasLimit" gencodec:"required"`
91+ Number uint64 `json:"currentNumber" gencodec:"required"`
92+ Timestamp uint64 `json:"currentTimestamp" gencodec:"required"`
93+ BaseFee * big.Int `json:"currentBaseFee" gencodec:"optional"`
94+ ExcessBlobGas * uint64 `json:"currentExcessBlobGas" gencodec:"optional"`
9395}
9496
9597type stEnvMarshaling struct {
96- Coinbase common.UnprefixedAddress
97- Difficulty * math.HexOrDecimal256
98- Random * math.HexOrDecimal256
99- GasLimit math.HexOrDecimal64
100- Number math.HexOrDecimal64
101- Timestamp math.HexOrDecimal64
102- BaseFee * math.HexOrDecimal256
98+ Coinbase common.UnprefixedAddress
99+ Difficulty * math.HexOrDecimal256
100+ Random * math.HexOrDecimal256
101+ GasLimit math.HexOrDecimal64
102+ Number math.HexOrDecimal64
103+ Timestamp math.HexOrDecimal64
104+ BaseFee * math.HexOrDecimal256
105+ ExcessBlobGas * math.HexOrDecimal64
103106}
104107
105108//go:generate go run github.com/fjl/gencodec -type stTransaction -field-override stTransactionMarshaling -out gen_sttransaction.go
@@ -283,6 +286,9 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh
283286 context .Random = & rnd
284287 context .Difficulty = big .NewInt (0 )
285288 }
289+ if config .IsCancun (new (big.Int ), block .Time ()) && t .json .Env .ExcessBlobGas != nil {
290+ context .BlobBaseFee = eip4844 .CalcBlobFee (* t .json .Env .ExcessBlobGas )
291+ }
286292 evm := vm .NewEVM (context , txContext , statedb , config , vmconfig )
287293
288294 // Execute the message.
0 commit comments