From 6c2a377e1a4ff62128b1d19861f7afaae33c6a2e Mon Sep 17 00:00:00 2001 From: Victor Castell Date: Wed, 2 Aug 2023 18:17:34 +0200 Subject: [PATCH] Building --- blockchain/blockchain.go | 4 ++-- helper/predeployment/predeployment.go | 2 +- state/executor.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/blockchain/blockchain.go b/blockchain/blockchain.go index b7a7ad442e..d08020b304 100644 --- a/blockchain/blockchain.go +++ b/blockchain/blockchain.go @@ -1387,11 +1387,11 @@ func (b *Blockchain) Close() error { // CalculateBaseFee calculates the basefee of the header. func (b *Blockchain) CalculateBaseFee(parent *types.Header) uint64 { - if !b.config.Params.Forks.IsActive(chain.London, parent.Number) { + if !b.config.Chain.Params.Forks.IsActive(chain.London, parent.Number) { return chain.GenesisBaseFee } - parentGasTarget := parent.GasLimit / b.config.Genesis.BaseFeeEM + parentGasTarget := parent.GasLimit / b.config.Chain.Genesis.BaseFeeEM // If the parent gasUsed is the same as the target, the baseFee remains unchanged. if parent.GasUsed == parentGasTarget { diff --git a/helper/predeployment/predeployment.go b/helper/predeployment/predeployment.go index 44f9bccbbd..890e12ace1 100644 --- a/helper/predeployment/predeployment.go +++ b/helper/predeployment/predeployment.go @@ -153,7 +153,7 @@ func getPredeployAccount(address types.Address, input, deployedBytecode []byte) // the state needs to be walked to collect all touched all storage slots storageMap := getModifiedStorageMap(radix, address) - _, _, err := transition.Commit() + _, _, _, err := transition.Commit() if err != nil { return nil, fmt.Errorf("failed to commit the state changes: %w", err) } diff --git a/state/executor.go b/state/executor.go index 0ac8574c84..d1348a392a 100644 --- a/state/executor.go +++ b/state/executor.go @@ -404,10 +404,10 @@ func (t *Transition) Write(txn *types.Transaction) error { } // Commit commits the final result -func (t *Transition) Commit() (Snapshot, *types.Trace, types.Hash) { +func (t *Transition) Commit() (Snapshot, *types.Trace, types.Hash, error) { objs, err := t.state.Commit(t.config.EIP155) if err != nil { - return nil, nil, types.Hash{} + return nil, nil, types.Hash{}, err } s2, snapTrace, root := t.snap.Commit(objs) @@ -415,7 +415,7 @@ func (t *Transition) Commit() (Snapshot, *types.Trace, types.Hash) { t.trace.AccountTrie = snapTrace.AccountTrie t.trace.StorageTrie = snapTrace.StorageTrie - return s2, t.trace, types.BytesToHash(root) + return s2, t.trace, types.BytesToHash(root), nil } func (t *Transition) subGasPool(amount uint64) error {