Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Building
Browse files Browse the repository at this point in the history
  • Loading branch information
vcastellm committed Aug 2, 2023
1 parent 1c149e7 commit 6c2a377
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions blockchain/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion helper/predeployment/predeployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
6 changes: 3 additions & 3 deletions state/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,18 +404,18 @@ 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)

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 {
Expand Down

0 comments on commit 6c2a377

Please sign in to comment.