* core: use TryGetAccount to read where TryUpdateAccount has been used to write
* Gary's review feedback
* implement Gary's suggestion
* fix bug + rename NewSecure into NewStateTrie
* trie: add backwards-compatibility aliases for SecureTrie
* Update database.go
* make the linter happy
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
This changes the journal logic to mark the state object dirty immediately when it
is reset.
We're mostly adding this change to appease the fuzzer. Marking it dirty immediately
makes no difference in practice because accounts will always be modified by EVM
right after creation.
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
fixes bug which caused the zero-address to be ignored during an iterative state-dump.
---------
Co-authored-by: Park Changwan <pcw109550@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
This changes the StorageTrie method to return an error when the trie
is not available. It used to return an 'empty trie' in this case, but that's
not possible anymore under PBSS.
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
Trie tracer is an auxiliary tool to capture all deleted nodes
which can't be captured by trie.Committer. The deleted nodes
can be removed from the disk later.
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>
This PR creates a global hasher pool that can be used by all packages.
It also removes a bunch of the package local pools.
It also updates a few locations to use available hashers or the global
hashing pool to reduce allocations all over the codebase.
This change should reduce global allocation count by ~1%
---------
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
* Include 0x0000 address into the dump if it is present
* core/state: go fmt
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
This new API allows reading accounts and their content by address range.
Co-authored-by: Wenbiao Zheng <delweng@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
When a database failure occurs, bubble it up a into statedb, and report it in suitable places, such as during a 'bad block' report.
Co-authored-by: rjl493456442 <garyrong0905@gmail.com>