Commit Graph

17248 Commits

Author SHA1 Message Date
ledgerwatch
f364eff389
Native tracers step 7 - restructure js tracer files (#6415)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-23 18:10:37 +00:00
Giulio rebuffo
f655e337d1
Added signed block abstraction (Phase0 & Altair & Bellatrix block support) (#6422) 2022-12-23 18:39:44 +01:00
Andrew Ashikhmin
4931f113c2
Add override.shanghaiTime flag (#6414)
and remove `--override.terminaltotaldifficulty` &
`--override.mergeNetsplitBlock`
2022-12-23 17:06:56 +01:00
Alex Sharov
d7404bc391
e3: correct bsc snapshots (#6411) 2022-12-23 13:06:48 +07:00
ledgerwatch
a49e287618
Native tracers step 6: Rename Tracer to EVMLogger, reduce args CaptureExit (#6410)
Getting closer to Geth's tracer interfaces

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-23 05:43:08 +00:00
Giulio rebuffo
5fd3536ef0
Erigon-cl database schema (#6399) 2022-12-22 19:59:24 +01:00
ledgerwatch
8433afd99a
Native tracers step 5 - tests for debug_traceBlock and trace_block before transformations (#6405)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-22 10:13:38 +00:00
Alex Sharov
599695d001
RemoteBlockReader.TxnByIdxInBlock() (#6404) 2022-12-22 12:54:07 +07:00
Alex Sharov
d9b6c84f57
kv_remote: c.Count() (#6403) 2022-12-22 12:44:05 +07:00
Alex Sharov
2145cd9357
nil-ptr check in notifications (#6401) 2022-12-22 11:41:44 +07:00
Alex Sharov
130ab85bea
e3: kv/temporal prototype 3 (#6395) 2022-12-22 09:37:32 +07:00
Giulio rebuffo
c619413871
better performance for Sentinel block downloader (80 blk/sec) (#6398) 2022-12-21 19:47:29 +01:00
Andrew Ashikhmin
49bb63661f
core/vm: derive maxStack from numPop & numPush (#6397) 2022-12-21 14:55:00 +01:00
Andrew Ashikhmin
dc248c5ea4
core/vm: Move interpreter.ReadOnly check into the opcode implementations (#6396)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/23970

Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-12-21 12:44:01 +01:00
Andrew Ashikhmin
5582435a95
core/vm: Simplify error handling in interpreter loop (#6394)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/23952

Co-authored-by: Paweł Bylica <chfast@gmail.com>
2022-12-21 11:57:53 +01:00
Ariel Tempelhof
870b5baa19
Finalize state after each call in callMany (#6381)
In `debug_traceCallMany` and `eth_callMany` the `IntraBlockState` is not
being finalized after each replayed transaction and after each call.
This can cause several problems:

- False gas consumption calculation. Specifically in `SSTORE` dynamic
gas calculation being affected by "warm" and "cold" storage slots, and
by "original" value comparison.
- Ability to call contracts that were `SELFDESTRUCT`ed in the replayed
transactions or during previous calls, as the self-destruction has not
been finalized.

see https://github.com/ledgerwatch/erigon/issues/6373 as an example.

This pull request adds a call to `FinalizeTx` after each `ApplyMessage`
and `TraceTx`
2022-12-21 16:32:36 +07:00
Andrew Ashikhmin
0986342690
core/vm: remove unused NewEVMInterpreterByVM (#6393) 2022-12-21 09:51:00 +01:00
Alex Sharov
c32d88f729
simplify StageLoopStep (#6390) 2022-12-21 14:39:19 +07:00
Alex Sharov
0e1e1f50ab
clang15 warning fix (#6392)
for
https://github.com/ledgerwatch/erigon/issues/6113#issuecomment-1359526277
2022-12-21 14:38:48 +07:00
Alex Sharov
65f3af30eb
use one state reader type (#6380) 2022-12-21 11:27:14 +07:00
Giulio rebuffo
173d11c43c
removed retry logic from Erigon-CL (#6389) 2022-12-20 22:11:08 +01:00
Alex Sharov
0ce84e41e1
integration: warmup staeg (#6388) 2022-12-20 22:59:23 +07:00
Andrew Ashikhmin
06df4333b2
core/vm: avoid memory expansion check for trivial ops (#6383)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/24048

Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-12-20 16:47:51 +01:00
Alex Sharov
2711e3a712
e3: verified mainnet snapshots (#6387) 2022-12-20 22:32:30 +07:00
alex.sharov
dd9f117a0c save 2022-12-20 22:27:11 +07:00
Alex Sharov
999e651a88
integration: warmup (#6386) 2022-12-20 21:56:32 +07:00
Alex Sharov
1fdc7fadfb
integration: warmup (#6384) 2022-12-20 21:51:15 +07:00
Max Revitt
4bdb35f94c
Withdrawals part 2 (#6180)
Continuation of PR #6009. Storage and retrieval of withdrawals.

- [x] storage of withdrawals on writeblock
- [x] composite key (block number | block hash)
- [x] value ([]withdrawal)
- [x] retrieval of withdrawals with block
- [x] tests around storing/retrieving withdrawals
- [x] tested in hive
- [x] commits tidied


## Hive Failures
- [x] Withdrawals Fork on Block 2
- [x] Withdrawals Fork on Block 3
- [ ] Sync after 2 blocks - Withdrawals on Block 1 - Single Withdrawal
Account - No Transactions ( Syncing client rejected valid chain)
- [ ] Sync after 2 blocks - Withdrawals on Block 1 - Single Withdrawal
Account (Timeout while waiting for secondary client to sync)
- [ ] Sync after 2 blocks - Withdrawals on Genesis - Single Withdrawal
Account (Timeout while waiting for secondary client to sync)
- [ ] Sync after 2 blocks - Withdrawals on Block 2 - Single Withdrawal
Account - No Transactions (Syncing client rejected valid chain)
- [ ] Sync after 2 blocks - Withdrawals on Block 2 - Single Withdrawal
Account (Timeout while waiting for secondary client to sync)
- [ ] Sync after 128 blocks - Withdrawals on Block 2 - Multiple
Withdrawal Accounts (Unexpected error on BalanceAt: Post
"http://172.17.0.4:8545/": context deadline exceeded, expected=<None>)
- [ ] Withdrawals Fork on Block 1 - 8 Block Re-Org, Sync (Expected no
error on EngineNewPayloadV2: error=Post "http://172.17.0.4:8551/":
context deadline exceeded)
- [ ] Withdrawals Fork on Block 8 - 10 Block Re-Org Sync (Expected no
error on EngineNewPayloadV2: error=Post "http://172.17.0.4:8551/":
context deadline exceeded)
- [ ] Withdrawals Fork on Canonical Block 8 / Side Block 7 - 10 Block
Re-Org Sync (Expected no error on EngineNewPayloadV2: error=Post
"http://172.17.0.4:8551/": context deadline exceeded)
- [ ] Withdrawals Fork on Canonical Block 8 / Side Block 9 - 10 Block
Re-Org Sync (Expected no error on EngineNewPayloadV2: error=Post
"http://172.17.0.4:8551/": context deadline exceeded)
2022-12-20 09:09:04 +00:00
Andrew Ashikhmin
31d30df59f
core/vm: fill gaps in jump table with opUndefined (#6372)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/24031

Co-authored-by: Paweł Bylica <chfast@gmail.com>
2022-12-20 08:18:24 +01:00
Willian Mitsuda
0b9eec66d0
Fix otterscan tx tracing for delegatecall (#6368)
This fixes Otterscan tx tracer, which broke on the following
refactoring:
60cb4e2bbb

It used to receive value == -1 for delegatecall, now it is receiving
nil, so we safeguard against it now.
2022-12-20 13:29:12 +07:00
Alex Sharov
7f1a680442
fix go vet warning (#6378) 2022-12-20 10:05:54 +07:00
Alex Sharov
cce0f251b4
e3: kv/temporal prototype 2 (#6377) 2022-12-20 09:28:10 +07:00
Giulio rebuffo
bae56ff119
Backfilling is now smooth and does not get stuck (#6374) 2022-12-19 22:40:34 +01:00
Andrew Ashikhmin
e5f818c832
core/vm: remove unused 'unofficial' opcodes (#6371)
Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-12-19 14:47:29 +01:00
Mike Neuder
3e7c1502b7
Implement ProcessBlockHeader (#6365)
This is described in
https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#block-header

Part of https://github.com/ledgerwatch/erigon/issues/5965
2022-12-19 14:24:39 +01:00
Andrew Ashikhmin
a00a4000a4
core/vm: simplify op lookup in contract (#6370)
Cherry-pick https://github.com/ethereum/go-ethereum/pull/23974

Co-authored-by: Andrei Maiboroda <andrei@ethereum.org>
2022-12-19 14:10:45 +01:00
Alex Sharov
dfa6505f93
e3: kv/temporal prototype (#6367) 2022-12-19 15:38:54 +07:00
alex.sharov
27de232afb better memdb use in tests 2022-12-19 10:56:57 +07:00
Alex Sharov
185141b184
e3: reconst MakeSteps - to check that files are indexed (#6366) 2022-12-19 10:27:39 +07:00
ledgerwatch
97c9a9108d
Native tracers - step 4 (#6363)
Remove `callType` argument from `CaptureStart`, and change `callType
vm.CallType` to `typ vm.OpCode` in `CaptureEnter` and move to the first
position (as it is in geth)

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-19 03:12:08 +00:00
Giulio rebuffo
ed2c79d2ca
fixed backfilling algo (#6364) 2022-12-18 23:28:30 +01:00
Giulio rebuffo
e640cea7d0
no CPU implosion when using sentinel (#6361) 2022-12-18 18:57:30 +01:00
ledgerwatch
0761671607
Native tracers step 3 (#6362)
Remove `env` argument from all Capture functions except for
`CaptureStart`

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-18 17:06:40 +00:00
Mike Neuder
66654dc4b1
Implement GetBeaconProposerIndex (#6352)
This is described in
https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#get_beacon_proposer_index.

Part of https://github.com/ledgerwatch/erigon/issues/5965

I compared with the Prysm tests to confirm the implementation is
correct:
2e49fdb3d2/beacon-chain/core/helpers/validators_test.go (L151-L204).
2022-12-18 17:39:43 +01:00
ledgerwatch
b8c6a4d263
Native tracers - step 2 (#6360)
Splitting function `CaptureStart` into `CaptureStart` (when depth == 0)
and `CaptureEnter` (when depth > 0), while removing argument `depth`.
Same with splitting `CaptureEnd` into `CaptureEnd` and `CaptureExit`

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-18 16:11:31 +00:00
Alex Sharov
7c42ecf66e
e3: better print_stages (#6357) 2022-12-18 12:12:11 +07:00
ledgerwatch
3999c46046
Native tracers - step 1 (#6356)
In this first step, the new functions `CaptureTxStart` and
`CaptureTxEnd` are introduced to all tracers

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-18 04:36:57 +00:00
alex.sharov
c5d720591a save 2022-12-18 11:10:40 +07:00
Alex Sharov
4ef39ea43c
unify logs a bit (#6354) 2022-12-18 09:23:11 +07:00
hexoscott
d4623ec9d7
mining updates around txpool yielding (#6342)
Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
2022-12-18 08:45:03 +07:00