@@ -28,6 +28,7 @@ import (
28
28
"github.com/ethereum/go-ethereum/common"
29
29
"github.com/ethereum/go-ethereum/common/hexutil"
30
30
"github.com/ethereum/go-ethereum/common/math"
31
+ "github.com/ethereum/go-ethereum/consensus/misc/eip4844"
31
32
"github.com/ethereum/go-ethereum/core"
32
33
"github.com/ethereum/go-ethereum/core/rawdb"
33
34
"github.com/ethereum/go-ethereum/core/state"
@@ -83,23 +84,25 @@ type stPostState struct {
83
84
//go:generate go run github.com/fjl/gencodec -type stEnv -field-override stEnvMarshaling -out gen_stenv.go
84
85
85
86
type 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"`
93
95
}
94
96
95
97
type 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
103
106
}
104
107
105
108
//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
283
286
context .Random = & rnd
284
287
context .Difficulty = big .NewInt (0 )
285
288
}
289
+ if config .IsCancun (new (big.Int ), block .Time ()) && t .json .Env .ExcessBlobGas != nil {
290
+ context .BlobBaseFee = eip4844 .CalcBlobFee (* t .json .Env .ExcessBlobGas )
291
+ }
286
292
evm := vm .NewEVM (context , txContext , statedb , config , vmconfig )
287
293
288
294
// Execute the message.
0 commit comments