all: expose block number information to statedb (#27753)

* core/state: clean up

* all: add block number infomration to statedb

* core, trie: rename blockNumber to block
This commit is contained in:
rjl493456442
2023-07-24 13:22:09 +03:00
committed by GitHub
parent a46f4173cd
commit 88f3d61468
28 changed files with 113 additions and 111 deletions
+1 -1
View File
@@ -176,7 +176,7 @@ func (f *fuzzer) fuzz() int {
panic(err)
}
if nodes != nil {
dbA.Update(rootA, types.EmptyRootHash, trienode.NewWithNodeSet(nodes), nil)
dbA.Update(rootA, types.EmptyRootHash, 0, trienode.NewWithNodeSet(nodes), nil)
}
// Flush memdb -> disk (sponge)
dbA.Commit(rootA, false)
+1 -1
View File
@@ -170,7 +170,7 @@ func runRandTest(rt randTest) error {
return err
}
if nodes != nil {
if err := triedb.Update(hash, origin, trienode.NewWithNodeSet(nodes), nil); err != nil {
if err := triedb.Update(hash, origin, 0, trienode.NewWithNodeSet(nodes), nil); err != nil {
return err
}
}
+2 -2
View File
@@ -283,7 +283,7 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh
// the coinbase gets no txfee, so isn't created, and thus needs to be touched
statedb.AddBalance(block.Coinbase(), new(big.Int))
// Commit block
root, _ := statedb.Commit(config.IsEIP158(block.Number()))
root, _ := statedb.Commit(block.NumberU64(), config.IsEIP158(block.Number()))
return snaps, statedb, root, err
}
@@ -303,7 +303,7 @@ func MakePreState(db ethdb.Database, accounts core.GenesisAlloc, snapshotter boo
}
}
// Commit and re-open to start with a clean state.
root, _ := statedb.Commit(false)
root, _ := statedb.Commit(0, false)
var snaps *snapshot.Tree
if snapshotter {