gary rong
adf130def8
eth/tracers: move tracing APIs into eth/tracers ( #22161 )
...
This moves the tracing RPC API implementation to package eth/tracers.
By doing so, package eth no longer depends on tracing and the duktape JS engine.
The change also enables tracing using the light client. All tracing methods work with the
light client, but it's a lot slower compared to using a full node.
4 years ago
Péter Szilágyi
42f9f1f073
core/state: convert prefetcher to concurrent per-trie loader
4 years ago
gary rong
5a1b384352
core: persist bad blocks ( #21827 )
...
* core: persist bad blocks
* core, eth, internal: address comments
* core/rawdb: add badblocks to inspector
* core, eth: update
* internal: revert
* core, eth: only save 10 bad blocks
* core/rawdb: address comments
* core/rawdb: fix
* core: address comments
4 years ago
Sina Mahmoodi
9c6b5b904a
eth, eth/tracers: include intrinsic gas in calltracer, expose for all tracers ( #22038 )
...
* eth/tracers: share tx gas price with js tracer
* eth/tracers: use `go generate`
* eth/tracers: try with another version of go-bindata
* eth/tracers: export txGas
* eth, eth/tracers: pass intrinsic gas to js tracers
eth/tracers: include tx gas in tracers usedGas
eth/tracers: fix prestate tracer's sender balance
eth/tracers: rm unnecessary import
eth/tracers: pass intrinsicGas separately to tracer
eth/tracers: fix tests broken by lack of txdata
eth, eth/tracers: minor fix
* eth/tracers: regenerate assets + unexport test-struct + add testcase
* eth/tracers: simplify tests + make table-driven
Co-authored-by: Guillaume Ballet <gballet@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
4 years ago
Martin Holst Swende
e9e86aeacb
eth: fix error in tracing if reexec is set ( #21830 )
...
* eth: fix error in tracing if reexec is set
* eth: change pointer embedding to value-embedding
4 years ago
gary rong
23524f8900
all: disable recording preimage of trie keys ( #21402 )
...
* cmd, core, eth, light, trie: disable recording preimage by default
* core, eth: fix unit tests
* core: fix import
* all: change to nopreimage
* cmd, core, eth, trie: use cache.preimages flag
* cmd: enable preimages for archive node
* cmd/utils, trie: simplify preimage tracking a bit
* core: fix linter
Co-authored-by: Péter Szilágyi <peterke@gmail.com>
4 years ago
Marius van der Wijden
2045a2bba3
core, all: split vm.Context into BlockContext and TxContext ( #21672 )
...
* all: core: split vm.Config into BlockConfig and TxConfig
* core: core/vm: reset EVM between tx in block instead of creating new
* core/vm: added docs
4 years ago
Martin Holst Swende
6487c002f6
all: implement EIP-2929 (gas cost increases for state access opcodes) + yolo-v2 ( #21509 )
...
* core/vm, core/state: implement EIP-2929 + YOLOv2
* core/state, core/vm: fix some review concerns
* core/state, core/vm: address review concerns
* core/vm: address review concerns
* core/vm: better documentation
* core/vm: unify sload cost as fully dynamic
* core/vm: fix typo
* core/vm/runtime: fix compilation flaw
* core/vm/runtime: fix renaming-err leftovers
* core/vm: renaming
* params/config: use correct yolov2 chainid for config
* core, params: use a proper new genesis for yolov2
* core/state/tests: golinter nitpicks
4 years ago
Marius van der Wijden
de971cc845
eth: added trace_call to trace on top of arbitrary blocks ( #21338 )
...
* eth: Added TraceTransactionPending
* eth: Implement Trace_Call, remove traceTxPending
* eth: debug_call -> debug_traceCall, recompute tx environment if pruned
* eth: fix nil panic
* eth: improve block retrieving logic in tracers
* internal/web3ext: add debug_traceCall to console
4 years ago
Marius van der Wijden
16d7eae1c8
eth: updated comments ( #21490 )
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
Marius van der Wijden
02cea2330d
eth: returned revert reason in traceTx ( #21195 )
...
* eth: returned revert reason in traceTx
* eth: return result data
4 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
Péter Szilágyi
542df8898e
core: initial version of state snapshots
5 years ago
cdetrio
49a7ee460e
eth: fix storageRangeAt for empty blocks ( #18076 )
5 years ago
Péter Szilágyi
ac3e7c9b3d
eth: remove redundant chain config fields
6 years ago
Jonas
dba336e612
eth: fix EIP158 account cleanup on chain tracing ( #19341 )
...
Fixes #19337
6 years ago
Matthew Halpern
8af6c9e6a2
eth: extract check for tracing transaction in block file ( #19107 )
...
Simplifies the transaction presense check to use a function to
determine if the transaction is present in the block provided
to trace, which originally had a redundant parenthesis and used
a `exist` flag to dictate control flow.
6 years ago
Martin Holst Swende
05d21438de
eth: make tracers respect pre- EIP 158/161 rule
6 years ago
Martin Holst Swende
9bc0138ded
eth: properly flush files in standardTraceBlockToFile ( #18502 )
6 years ago
Péter Szilágyi
0983d02aa9
eth, internal/web3ext: tiny polishes in tracers
6 years ago
Martin Holst Swende
42a914a84f
cmd/evm, core/vm, eth: implement api methods to do stdjson dump to local filesystem
6 years ago
Péter Szilágyi
434dd5bc00
cmd, core, eth, light, trie: add trie read caching layer
6 years ago
Martin Holst Swende
89a32451ae
core/vm: faster create/create2 ( #17806 )
...
* core/vm/runtim: benchmark create/create2
* core/vm: do less hashing in CREATE2
* core/vm: avoid storing jumpdest analysis for initcode
* core/vm: avoid unneccesary lookups, remove unused fields
* core/vm: go formatting tests
* core/vm: save jumpdest analysis locally
* core/vm: use common.Hash instead of nil, fix review comments
* core/vm: removed type destinations
* core/vm: correct check for empty hash
* eth: more elegant api_tracer
* core/vm: address review concerns
6 years ago
HackyMiner
6975c72981
all: fix various comment typos ( #17591 )
...
* swarm: fixed comment typo
* eth: fixed comment typo
* cmd/puppeth: fixed comment typo
6 years ago
gary rong
c1c003e4ff
consensus, miner: stale block mining support ( #17506 )
...
* consensus, miner: stale block supporting
* consensus, miner: refactor seal signature
* cmd, consensus, eth: add miner noverify flag
* cmd, consensus, miner: polish
6 years ago
Martin Holst Swende
106d196ec4
eth: ensure from<to when tracing chain (credits Chen Nan via bugbounty)
6 years ago
Péter Szilágyi
11bbc66082
eth, trie: fix tracer GC which accidentally pruned the metaroot
6 years ago
Péter Szilágyi
d926bf2c7e
trie: cache collapsed tries node, not rlp blobs ( #16876 )
...
The current trie memory database/cache that we do pruning on stores
trie nodes as binary rlp encoded blobs, and also stores the node
relationships/references for GC purposes. However, most of the trie
nodes (everything apart from a value node) is in essence just a
collection of references.
This PR switches out the RLP encoded trie blobs with the
collapsed-but-not-serialized trie nodes. This permits most of the
references to be recovered from within the node data structure,
avoiding the need to track them a second time (expensive memory wise).
6 years ago
Péter Szilágyi
143c4341d8
core, eth, trie: streaming GC for the trie cache ( #16810 )
...
* core, eth, trie: streaming GC for the trie cache
* trie: track memcache statistics
7 years ago
Péter Szilágyi
6cf0ab38bd
core/rawdb: separate raw database access to own package ( #16666 )
7 years ago
Péter Szilágyi
7a7428a027
core, eth: fix tracer dirty finalization
7 years ago
Péter Szilágyi
55599ee95d
core, trie: intermediate mempool between trie and database ( #15857 )
...
This commit reduces database I/O by not writing every state trie to disk.
7 years ago
Péter Szilágyi
ae71da1b03
eth: fix tracer panic when running without configs + reexec ( #15799 )
7 years ago
Felix Lange
9d48dbf5c2
eth: revert tracer preimage recording ( #15800 )
...
This reverts commits 85a1eda59e
(#15792 ) and c495bca4ad
(#15787 )
because they introduce database writes during tracing.
7 years ago
Felix Lange
85a1eda59e
eth: uncaptialize tracer preimage error message ( #15792 )
...
* eth: uncaptialize tracer preimage error message
* eth: improve very important error message
7 years ago
cdetrio
c495bca4ad
eth: enable preimage recording when tracing ( #15787 )
7 years ago
Péter Szilágyi
5258785c81
cmd, core, eth/tracers: support fancier js tracing ( #15516 )
...
* cmd, core, eth/tracers: support fancier js tracing
* eth, internal/web3ext: rework trace API, concurrency, chain tracing
* eth/tracers: add three more JavaScript tracers
* eth/tracers, vendor: swap ottovm to duktape for tracing
* core, eth, internal: finalize call tracer and needed extras
* eth, tests: prestate tracer, call test suite, rewinding
* vendor: fix windows builds for tracer js engine
* vendor: temporary duktape fix
* eth/tracers: fix up 4byte and evmdis tracer
* vendor: pull in latest duktape with my upstream fixes
* eth: fix some review comments
* eth: rename rewind to reexec to make it more obvious
* core/vm: terminate tracing using defers
7 years ago