Péter Szilágyi
a15d71a255
core/state/snapshot: stop generator if it hits missing trie nodes ( #21649 )
...
* core/state/snapshot: exit Geth if generator hits missing trie nodes
* core/state/snapshot: error instead of hard die on generator fault
* core/state/snapshot: don't enable logging on the tests
4 years ago
Péter Szilágyi
eeaf191633
core, eth, trie: prepare trie sync for path based operation
4 years ago
Péter Szilágyi
d8da0b3d81
core/state, eth, trie: stabilize memory use, fix memory leak
4 years ago
Péter Szilágyi
3ee91b9f2e
core/state/snapshot: reduce disk layer depth during generation
4 years ago
gary rong
87c0ba9213
core, eth, les, trie: add a prefix to contract code ( #21080 )
4 years ago
Giuseppe Bertone
2ff464b29d
core/state: fixed some comments ( #21450 )
4 years ago
gary rong
93da0cf8a1
cmd, core, eth, light, trie: dump clean cache periodically ( #20391 )
...
* cmd, core, eth, light, trie: dump clean cache periodically
* eth: update config
* trie: minor fix
* core, trie: address comments
* eth: remove useless
* trie: print clean cache dump start too
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
4 years ago
Martin Holst Swende
295693759e
core/vm: less allocations for various call variants ( #21222 )
...
* core/vm/runtime/tests: add more benchmarks
* core/vm: initial work on improving alloc count for calls to precompiles
name old time/op new time/op delta
SimpleLoop/identity-precompile-10M-6 117ms ±75% 43ms ± 1% -63.09% (p=0.008 n=5+5)
SimpleLoop/loop-10M-6 79.6ms ± 4% 70.5ms ± 1% -11.42% (p=0.008 n=5+5)
name old alloc/op new alloc/op delta
SimpleLoop/identity-precompile-10M-6 24.4MB ± 0% 4.9MB ± 0% -79.94% (p=0.008 n=5+5)
SimpleLoop/loop-10M-6 13.2kB ± 0% 13.2kB ± 0% ~ (p=0.357 n=5+5)
name old allocs/op new allocs/op delta
SimpleLoop/identity-precompile-10M-6 382k ± 0% 153k ± 0% -59.99% (p=0.000 n=5+4)
SimpleLoop/loop-10M-6 40.0 ± 0% 40.0 ± 0% ~ (all equal)
* core/vm: don't allocate big.int for touch
name old time/op new time/op delta
SimpleLoop/identity-precompile-10M-6 43.3ms ± 1% 42.4ms ± 7% ~ (p=0.151 n=5+5)
SimpleLoop/loop-10M-6 70.5ms ± 1% 76.7ms ± 1% +8.67% (p=0.008 n=5+5)
name old alloc/op new alloc/op delta
SimpleLoop/identity-precompile-10M-6 4.90MB ± 0% 2.46MB ± 0% -49.83% (p=0.008 n=5+5)
SimpleLoop/loop-10M-6 13.2kB ± 0% 13.2kB ± 1% ~ (p=0.571 n=5+5)
name old allocs/op new allocs/op delta
SimpleLoop/identity-precompile-10M-6 153k ± 0% 76k ± 0% -49.98% (p=0.029 n=4+4)
SimpleLoop/loop-10M-6 40.0 ± 0% 40.0 ± 0% ~ (all equal)
* core/vm: reduce allocs in staticcall
name old time/op new time/op delta
SimpleLoop/identity-precompile-10M-6 42.4ms ± 7% 37.5ms ± 6% -11.68% (p=0.008 n=5+5)
SimpleLoop/loop-10M-6 76.7ms ± 1% 69.1ms ± 1% -9.82% (p=0.008 n=5+5)
name old alloc/op new alloc/op delta
SimpleLoop/identity-precompile-10M-6 2.46MB ± 0% 0.02MB ± 0% -99.35% (p=0.008 n=5+5)
SimpleLoop/loop-10M-6 13.2kB ± 1% 13.2kB ± 0% ~ (p=0.143 n=5+5)
name old allocs/op new allocs/op delta
SimpleLoop/identity-precompile-10M-6 76.4k ± 0% 0.1k ± 0% ~ (p=0.079 n=4+5)
SimpleLoop/loop-10M-6 40.0 ± 0% 40.0 ± 0% ~ (all equal)
* trie: better use of hasher keccakState
* core/state/statedb: reduce allocations in getDeletedStateObject
* core/vm: reduce allocations in all call derivates
* core/vm: reduce allocations in call variants
- Make returnstack `uint32`
- Use a `sync.Pool` of `stack`s
* core/vm: fix tests
* core/vm: goimports
* core/vm: tracer fix + staticcall gas fix
* core/vm: add back snapshot to staticcall
* core/vm: review concerns + make returnstack pooled + enable returndata in traces
* core/vm: fix some test tracer method signatures
* core/vm: run gencodec, minor comment polish
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
4 years ago
gary rong
6eef141aef
les: historical data garbage collection ( #19570 )
...
This change introduces garbage collection for the light client. Historical
chain data is deleted periodically. If you want to disable the GC, use
the --light.nopruning flag.
4 years ago
Martin Holst Swende
e376d2fb31
cmd/evm: add state transition tool for testing ( #20958 )
...
This PR implements the EVM state transition tool, which is intended
to be the replacement for our retesteth client implementation.
Documentation is present in the cmd/evm/README.md file.
Co-authored-by: Felix Lange <fjl@twurst.com>
4 years ago
Péter Szilágyi
80e887d7bf
core/state: avoid escape analysis fault when accessing cached state
4 years ago
Martin Michlmayr
4f2784b38f
all: fix typos in comments ( #21118 )
5 years ago
Péter Szilágyi
0b2edf05bb
core/state: make GetCodeSize mirror GetCode implementation wise
5 years ago
Martin Holst Swende
82f9ed49fa
core/state: avoid statedb.dbErr due to emptyCode ( #21051 )
...
* core/state: more verbose stateb errors
* core/state: fix flaw
* core/state: fixed lint
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
5 years ago
Martin Holst Swende
b0b65d017f
core/state: abort commit if read errors have occurred ( #21039 )
...
This finally adds the error check that the documentation of StateDB.dbErr
promises to do. dbErr was added in 9e5f03b6c
(June 2017), and the check was
already missing in that commit. We somehow survived without it for three years.
5 years ago
Martin Holst Swende
1152f45849
core/state: include zero-address in state dump if present ( #21038 )
...
* Include 0x0000 address into the dump if it is present
* core/state: go fmt
Co-authored-by: Alexey Akhunov <akhounov@gmail.com>
5 years ago
gary rong
85944c2561
core/state/snapshot: fix typo ( #21037 )
5 years ago
Péter Szilágyi
90af6dae6e
core/state/snapshot: don't create storage list for non-existing accounts
5 years ago
Péter Szilágyi
da59147014
core/state/snapshot: release iterator after verification
5 years ago
gary rong
2337aa64eb
core/state/snapshot: fix trie generator reporter ( #21004 )
5 years ago
Péter Szilágyi
4b6f6ffe23
core/state/snapshot: fix journal nil deserialziation
5 years ago
gary rong
26d271dfbb
core/state/snapshot: implement storage iterator ( #20971 )
...
* core/state/snapshot: implement storage iterator
* core/state/snapshot, tests: implement helper function
* core/state/snapshot: fix storage issue
If an account is deleted in the tx_1 but recreated in the tx_2,
the it can happen that in this diff layer, both destructedSet
and storageData records this account. In this case, the storage
iterator should be able to iterate the slots belong to new account
but disable further iteration in deeper layers(belong to old account)
* core/state/snapshot: address peter and martin's comment
* core/state: address comments
* core/state/snapshot: fix test
5 years ago
gary rong
8a2e8faadd
core/state/snapshot: fix binary iterator ( #20970 )
5 years ago
gary rong
b9df7ecdc3
all: seperate consensus error and evm internal error ( #20830 )
...
* all: seperate consensus error and evm internal error
There are actually two types of error will be returned when
a tranaction/message call is executed: (a) consensus error
(b) evm internal error. The former should be converted to
a consensus issue, e.g. The sender doesn't enough asset to
purchase the gas it specifies. The latter is allowed since
evm itself is a blackbox and internal error is allowed to happen.
This PR emphasizes the difference by introducing a executionResult
structure. The evm error is embedded inside. So if any error
returned, it indicates consensus issue happens.
And also this PR improve the `EstimateGas` API to return the concrete
revert reason if the transaction always fails
* all: polish
* accounts/abi/bind/backends: add tests
* accounts/abi/bind/backends, internal: cleanup error message
* all: address comments
* core: fix lint
* accounts, core, eth, internal: address comments
* accounts, internal: resolve revert reason if possible
* accounts, internal: address comments
5 years ago
Martin Holst Swende
c036fe35a8
core/state/snapshot: make difflayer account iterator seek operation inclusive
5 years ago
Boqin Qin
7599999dcd
snapshot: add Unlock before return ( #20948 )
...
* Forget Unlock in snapshot
* Remove Unlock before panic
5 years ago
Martin Holst Swende
6402c42b67
all: simplify and fix database iteration with prefix/start ( #20808 )
...
* core/state/snapshot: start fixing disk iterator seek
* ethdb, rawdb, leveldb, memorydb: implement iterators with prefix and start
* les, core/state/snapshot: iterator fixes
* all: remove two iterator methods
* all: rename Iteratee.NewIteratorWith -> NewIterator
* ethdb: fix review concerns
5 years ago
Wenbiao Zheng
03fe9de2cb
eth: add debug_accountRange API ( #19645 )
...
This new API allows reading accounts and their content by address range.
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Felix Lange <fjl@twurst.com>
5 years ago
Martin Holst Swende
76eed9e50d
snapshotter/tests: verify snapdb post-state against trie ( #20812 )
...
* core/state/snapshot: basic trie-to-hash implementation
* tests: validate snapshot after test
* core/state/snapshot: fix review concerns
5 years ago
Martin Holst Swende
074efe6c8d
core: fix two snapshot iterator flaws, decollide snap storage prefix
...
* core/state/snapshot/iterator: fix two disk iterator flaws
* core/rawdb: change SnapshotStoragePrefix to avoid prefix collision with preimagePrefix
5 years ago
Péter Szilágyi
fab0ee3bfa
core/state/snapshot: fix various iteration issues due to destruct set
5 years ago
Martin Holst Swende
eff7cfbb03
core/state/snapshot: handle deleted accounts in fast iterator
5 years ago
Péter Szilágyi
328de180a7
core/state: fix resurrection state clearing and access
5 years ago
Péter Szilágyi
dcb22a9f99
core/state: fix account root hash update point
5 years ago
Péter Szilágyi
a4cf279494
core/state: extend snapshotter to handle account resurrections
5 years ago
Péter Szilágyi
6e05ccd845
core/state/snapshot, tests: sync snap gen + snaps in consensus tests
5 years ago
Péter Szilágyi
92ec07d63b
core/state: fix an account resurrection issue
5 years ago
Péter Szilágyi
06d4470b41
core: fix broken tests due to API changes + linter
5 years ago
Martin Holst Swende
19099421dc
core/state/snapshot: faster account iteration, CLI integration
5 years ago
Péter Szilágyi
6ddb92a089
core/state/snapshot: full featured account iteration
5 years ago
Martin Holst Swende
e570835356
core/state/snapshot: implement iterator priority for fast direct data lookup
5 years ago
Péter Szilágyi
e567675473
core/state/snapshot: move iterator out into its own files
5 years ago
Martin Holst Swende
7e38996301
core/state/snapshot: implement snapshot layer iteration
5 years ago
Péter Szilágyi
22c494d399
core/state/snapshot: bloom, metrics and prefetcher fixes
5 years ago
Martin Holst Swende
3ad4335acc
core/state/snapshot: node behavioural difference on bloom content
5 years ago
Péter Szilágyi
fd39f722a3
core: journal the snapshot inside leveldb, not a flat file
5 years ago
Martin Holst Swende
d5d7c0c24b
core/state/snapshot: fix difflayer origin-initalization after flatten
5 years ago
Péter Szilágyi
351a5903b0
core/rawdb, core/state/snapshot: runtime snapshot generation
5 years ago
Martin Holst Swende
f300c0df01
core/state/snapshot: replace bigcache with fastcache
5 years ago
Péter Szilágyi
d754091a87
core/state/snapshot: unlink snapshots from blocks, quad->linear cleanup
5 years ago