Commit graph

1423 commits

Author SHA1 Message Date
Sina Mahmoodi
01bb908790 core,eth: cancel evm on nativecalltracer stop 2021-11-04 21:01:41 +01:00
Martin Holst Swende
a83925989f
Merge branch 'master' into drop-in-plugin 2021-11-04 19:02:14 +01:00
Martin Holst Swende
2af565b18b
eth/tracers/testing: lint nitpicks 2021-11-04 18:56:41 +01:00
Martin Holst Swende
3bbeb94c1c
eth: make traceChain avoid OOM on long-running tracing (#23736)
This PR changes long-running chain tracing, so that it at some points releases the memory trie db, and switch over to a fresh disk-backed trie.
2021-11-04 18:54:00 +01:00
Sina Mahmoodi
de953f5714 eth/tracers: minor comment fix 2021-11-04 17:42:35 +01:00
Martin Holst Swende
4e2de461d7
eth/tracers, core/vm: rename vm.Tracer to vm.EVMLogger for clarity 2021-11-03 20:58:50 +01:00
Martin Holst Swende
2a69a3707e
eth/tracers: make jstracer non-exported, avoid cast 2021-11-03 20:54:48 +01:00
Sina Mahmoodi
91a7c094b5 eth/tracers: more renamings 2021-11-03 17:26:10 +01:00
Sina Mahmoodi
89bac76e0c
renamings
Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-11-03 17:03:55 +01:00
Sina Mahmoodi
60f5734e26 eth/tracers: add native noop tracer 2021-11-02 19:52:46 +01:00
Sina Mahmoodi
c242c82e07 eth/tracers: impl stop 2021-11-02 17:16:57 +01:00
Sina Mahmoodi
a9c2051d3f eth/tracers: minor fix 2021-11-02 16:49:25 +01:00
Martin Holst Swende
551bd6e721
eth/tracers: invoke enter/exit on 0-value calls to inex accounts (#23828) 2021-11-01 19:06:33 +01:00
XuDon9 Liu AKA Rapper Of CN background diablo & revelations, a man optimistic, negative, silent, active, Taoism
410e731bea
optimize the judge of invalide notification.number (#22658)
Don't bother fetching genesis

Co-authored-by: wuff1996 <33193253+wuff1996@users.noreply.github.com>
2021-10-31 19:38:48 +01:00
Martin Holst Swende
31870a59ff
eth/filters, p2p/simulations: fix benchmarks (#23806)
Some benchmarks in eth/filters were not good: they weren't reproducible, relying on geth chaindata to be present.

Another one was rejected because the receipt was lacking a backing transcation.

The p2p simulation benchmark had a lot of the warnings below, due to the framework calling both
Stop() and Close(). Apparently, the simulated adapter is the only implementation which has a Close(),
and there is no need to call both Stop and Close on it.
2021-10-29 14:37:00 +02:00
Martin Holst Swende
32150f8aa9
cmd/geth, cmd/evm, params: implement Arrow Glacier (EIP 4345) (#23810)
This PR adds support for ArrowGlacier, as defined by

    https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/arrow-glacier.md
    https://eips.ethereum.org/EIPS/eip-4345

> Starting with FORK_BLOCK_NUMBER the client will calculate the difficulty based on a fake block number suggesting to the client that the difficulty bomb is adjusting 10,700,000 blocks later than the actual block number.

This also adds support for evm t8n to return the calculated difficulty, so it can be used to construct test.
2021-10-28 22:18:14 +02:00
Martin Holst Swende
360e3ba352
eth/tracers: move tracecall tests to subpackage 2021-10-28 11:47:53 +02:00
Martin Holst Swende
5db19c5922
eth/tracers: rework the model a bit 2021-10-26 14:51:26 +02:00
Sina Mahmoodi
0946623acc eth/tracers: add license 2021-10-26 12:27:26 +02:00
Preston Van Loon
b97f57882c
eth/fetcher: remove superfluous nilness-check (#23739)
* eth/fetcher: fix nilness check https://github.com/ethereum/go-ethereum/issues/23738

* eth/fetcher: Use errors.Is. PR feedback from @holiman.
2021-10-18 22:34:20 +02:00
jwasinger
011fe3eb5e
core: remove unused error from TxPool.Pending (#23720) 2021-10-13 23:00:45 +02:00
Iskander (Alex) Sharipov
778ff94794
all: fix some go-critic linter warnings (#23709)
This doesn't fix all go-critic warnings, just the most serious ones.

Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-10-13 17:31:02 +02:00
Sina Mahmoodi
18c4c17ba5 eth/tracers: clean-up and comments 2021-10-13 17:14:06 +02:00
Sina Mahmoodi
a2b0d3d48e eth/tracers: make callFrame private 2021-10-13 16:59:05 +02:00
Sina Mahmoodi
aff90d3f88 eth/tracers: rm extra make 2021-10-13 15:07:39 +02:00
Sina Mahmoodi
d9371f300f
eth/tracers: rm extra make
Co-authored-by: Martin Holst Swende <martin@swende.se>
2021-10-13 15:06:31 +02:00
Sina Mahmoodi
ca5427ade0 eth/tracers: fix 2021-10-13 15:03:38 +02:00
Sina Mahmoodi
7b105349c5 eth/tracers: test native call tracer 2021-10-13 14:57:05 +02:00
Sina Mahmoodi
75c6affab4 eth/tracers: fix benchTracer 2021-10-13 13:32:37 +02:00
Sina Mahmoodi
4ea0d15966 eth/tracers: fix 2021-10-12 12:52:11 +02:00
Sina Mahmoodi
bf165bba68 eth/tracers: minor fix 2021-10-12 12:48:23 +02:00
Sina Mahmoodi
340c773201 eth/tracers: fix call tracer json result 2021-10-12 12:43:34 +02:00
noam-alchemy
633e7ef478
eth,rpc: allow for flag configured timeouts for eth_call (#23645)
* eth,rpc: allow for flag configured timeouts for eth_call

* lint: account for package-local import order

* cr: rename `rpc.calltimeout` to `rpc.evmtimeout`
2021-10-12 10:46:04 +02:00
Martin Holst Swende
6289137827
consensus/clique, core: API cleanup (#23100)
This removes some code:

- The clique engine calculated the snapshot twice when verifying headers/blocks.

- The method GetBlockHashesFromHash in Header/Block/Lightchain was only used by tests. It
  is now removed from the API.
  
- The method GetTdByHash internally looked up the number before calling GetTd(hash, num).
  In many cases, callers already had the number, and used this method just because it has a
  shorter name. I have removed the method to make the API surface smaller.
2021-10-11 23:16:46 +02:00
Sina Mahmoodi
c9c1dc9d5c eth/tracers: add native call tracer 2021-10-11 18:20:45 +02:00
Marius van der Wijden
53b1420ede
params: changed CatalystBlock to TerminalTotalDifficulty (#23700)
* params: changed CatalystBlock to TerminalTotalDifficulty

* eth/catalyst: comment out unused code
2021-10-11 18:58:11 +03:00
Sina Mahmoodi
57c993b6cb eth/tracers: add GetResult to tracer interface 2021-10-11 17:13:54 +02:00
Sina Mahmoodi
af67e1def6 eth/tracers: add basic native loader 2021-10-11 17:09:41 +02:00
aaronbuchwald
bcbd700367
eth/gasprice: avoid modifying TestChainConfig (#23204)
Co-authored-by: Felix Lange <fjl@twurst.com>
2021-10-11 01:52:30 +02:00
Marius van der Wijden
ee120ef865
miner: fix data race during shutdown (#23435)
This fixes a data race on worker.current by moving the call to StopPrefetcher
into the main loop.

The commit also contains fixes for two other races in unit tests of unrelated packages.
2021-10-08 20:12:52 +02:00
Martin Holst Swende
28d30b51f8
eth: close miner on exit (instead of just stopping) (#21992)
This ensures that all miner goroutines have exited before stopping the blockchain. 

Co-authored-by: Felix Lange <fjl@twurst.com>
2021-10-08 18:36:58 +02:00
Sina Mahmoodi
48496e0675
internal/ethapi: use correct signer when serving old blocks (#23683)
Fixes #23681

After the fix I get the address 0x6d6d02e83c4ced98204e20126acf27e9d87b8af2 for the
tx mentioned in the ticket, which agrees with etherscan.
2021-10-07 15:51:14 +02:00
Martin Holst Swende
307156cc46
eth/api: add rpc method to obtain which states are accessible (#23646)
This PR adds a method to the debug namespace, to iterate over the blocks and check where we have the roots on disk.
2021-10-05 08:13:00 +02:00
Ferran Borreguero
0dbb3b1601
eth/protocols/eth: replace array with counter in txn broadcaster (#23656) 2021-10-04 16:10:51 +02:00
Miro
5a0e1d88f4
eth/filters: fix TestPendingLogsSubscription (#23619)
The test did not synchronize with per-case goroutines, and thus didn't notice
that some tests were just hanging. This change adds missing synchronization
and fixes the broken tests.
2021-10-04 14:09:51 +02:00
Sina Mahmoodi
b522f5e091
eth/tracers: fix callTracer fault handling (#23667)
* eth/tracers: fix calltracer fault handling

* eth/tracers: fix calltracer indentation
2021-10-01 13:03:24 +02:00
Martin Holst Swende
3a6fe69f23
eth/protocols/snap, trie: better error-handling (#23657) 2021-09-29 15:19:40 +02:00
Ferran Borreguero
a541fbea18
eth/protocols/eth: simplify peer known block/txs caches (#23649)
* Simplify peer known block/txns cache

* Address minor changes

* Add more minor comments

* Minor changes from review
2021-09-28 13:44:07 +02:00
Martin Holst Swende
3531ca2246
eth/tracers: avoid unsyncronized mutations on trie database (#23632)
This PR fixes an issue in traceChain, where the statedb Commit operation was performed asynchronously with dereference-operations agains the underlying trie.Database instance. Due to how the reference counting works within the trie database (where parent count is recursively updated when new parents are added), doing dereferencing in the middle of Commit can cause the refcount to become wrong, leading to an inconsistent state. 

This was fixed by doing Commit/Deref from the same routine.
2021-09-28 13:06:19 +02:00
Sina Mahmoodi
783e97ef1f
core/rawdb: avoid unnecessary receipt processing for log filtering (#23147)
* core/types: rm extranous check in test

* core/rawdb: add lightweight types for block logs

* core/rawdb,eth: use lightweight accessor for log filtering

* core/rawdb: add bench for decoding into rlpLogs
2021-09-28 12:54:49 +02:00