@@ -76,25 +76,26 @@ type ommer struct {
7676
7777//go:generate go run github.com/fjl/gencodec -type stEnv -field-override stEnvMarshaling -out gen_stenv.go
7878type stEnv struct {
79- Coinbase common.Address `json:"currentCoinbase" gencodec:"required"`
80- Difficulty * big.Int `json:"currentDifficulty"`
81- Random * big.Int `json:"currentRandom"`
82- ParentDifficulty * big.Int `json:"parentDifficulty"`
83- ParentBaseFee * big.Int `json:"parentBaseFee,omitempty"`
84- ParentGasUsed uint64 `json:"parentGasUsed,omitempty"`
85- ParentGasLimit uint64 `json:"parentGasLimit,omitempty"`
86- MinBaseFee * big.Int `json:"minBaseFee,omitempty"`
87- GasLimit uint64 `json:"currentGasLimit" gencodec:"required"`
88- Number uint64 `json:"currentNumber" gencodec:"required"`
89- Timestamp uint64 `json:"currentTimestamp" gencodec:"required"`
90- ParentTimestamp uint64 `json:"parentTimestamp,omitempty"`
91- BlockHashes map [math.HexOrDecimal64 ]common.Hash `json:"blockHashes,omitempty"`
92- Ommers []ommer `json:"ommers,omitempty"`
93- BaseFee * big.Int `json:"currentBaseFee,omitempty"`
94- ParentUncleHash common.Hash `json:"parentUncleHash"`
95- ExcessBlobGas * uint64 `json:"excessBlobGas,omitempty"`
96- ParentExcessBlobGas * uint64 `json:"parentExcessBlobGas,omitempty"`
97- ParentBlobGasUsed * uint64 `json:"parentBlobGasUsed,omitempty"`
79+ Coinbase common.Address `json:"currentCoinbase" gencodec:"required"`
80+ Difficulty * big.Int `json:"currentDifficulty"`
81+ Random * big.Int `json:"currentRandom"`
82+ ParentDifficulty * big.Int `json:"parentDifficulty"`
83+ ParentBaseFee * big.Int `json:"parentBaseFee,omitempty"`
84+ ParentGasUsed uint64 `json:"parentGasUsed,omitempty"`
85+ ParentGasLimit uint64 `json:"parentGasLimit,omitempty"`
86+ MinBaseFee * big.Int `json:"minBaseFee,omitempty"`
87+ GasLimit uint64 `json:"currentGasLimit" gencodec:"required"`
88+ Number uint64 `json:"currentNumber" gencodec:"required"`
89+ Timestamp uint64 `json:"currentTimestamp" gencodec:"required"`
90+ ParentTimestamp uint64 `json:"parentTimestamp,omitempty"`
91+ BlockHashes map [math.HexOrDecimal64 ]common.Hash `json:"blockHashes,omitempty"`
92+ Ommers []ommer `json:"ommers,omitempty"`
93+ BaseFee * big.Int `json:"currentBaseFee,omitempty"`
94+ ParentUncleHash common.Hash `json:"parentUncleHash"`
95+ ExcessBlobGas * uint64 `json:"excessBlobGas,omitempty"`
96+ ParentExcessBlobGas * uint64 `json:"parentExcessBlobGas,omitempty"`
97+ ParentBlobGasUsed * uint64 `json:"parentBlobGasUsed,omitempty"`
98+ ParentBeaconBlockRoot * common.Hash `json:"parentBeaconBlockRoot"`
9899}
99100
100101type stEnvMarshaling struct {
@@ -191,6 +192,10 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
191192 // chainConfig.DAOForkBlock.Cmp(new(big.Int).SetUint64(pre.Env.Number)) == 0 {
192193 // misc.ApplyDAOHardFork(statedb)
193194 // }
195+ if beaconRoot := pre .Env .ParentBeaconBlockRoot ; beaconRoot != nil {
196+ evm := vm .NewEVM (vmContext , vm.TxContext {}, statedb , chainConfig , vmConfig )
197+ core .ProcessBeaconBlockRoot (* beaconRoot , evm , statedb )
198+ }
194199 var blobGasUsed uint64
195200 for i , tx := range txs {
196201 if tx .Type () == types .BlobTxType && vmContext .ExcessBlobGas == nil {
0 commit comments