Commit Graph

1141 Commits

Author SHA1 Message Date
a
06de4aeb91
filterlogs deadlock fix (#6429)
Refactors filters.go such that map+locks are now in their own class 

Move logic for safely canceling & draining channel to its own class

changed subscriptions to ask for size of buffer and construct its own
channel

marked as draft b/c need to do live testing.
2023-01-02 11:42:40 +07:00
Alex Sharov
4a9c871628
a bit rename 22 to v3 (#6476) 2022-12-30 21:53:42 +07:00
Alex Sharov
b0af04f2df
bsc: incrementally calc and store all old snapshots. slower initial stage_snapshots, but faster restart during initial sync (#6457) 2022-12-30 12:44:54 +07:00
Alex Sharov
c04668d0ff
e3: agg cancel background jobs (#6463) 2022-12-29 15:04:07 +07:00
alex.sharov
9efb8e838b save 2022-12-29 10:09:09 +07:00
Andrew Ashikhmin
0fdd60a0d1
Execution Spec Tests & HashCheck() (#6444)
Run tests from a new repo
https://github.com/ethereum/execution-spec-tests.

Also introduce `HashCheck()` function that checks correctness of block's
uncle, transaction, and withdrawals hashes.
2022-12-28 17:01:40 +01:00
Andrew Ashikhmin
714888b016
HashBuilder: fix top node shorter than 32 bytes (#6456)
Prior to withdrawals, it was extremely unlikely to have short (RLP < 32)
top trie nodes outside test scenarios.
2022-12-28 11:58:37 +01:00
Alex Sharov
05f715ca51
E3: chain rules fix (#6448) 2022-12-27 13:14:24 +07:00
Alex Sharov
fa6f6038e7
kv: tx.Prefix method (#6441) 2022-12-26 17:58:21 +07:00
ledgerwatch
387b4d7f35
Native tracers step 10 - remove duplicate SelfDestruct capture, clean up (#6440)
Moved some of the tracers to `eth/tracers/logger` to make it more
similar to go-ethereum.

Removed Erigon-specific `Capture-` functions

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-26 04:56:39 +00:00
ledgerwatch
24040f3044
Native tracers step 9 - add native tracers (#6434)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2022-12-25 07:28:41 +00:00
Alex Sharov
4e26f53a75
e3: return error from inline-apply (#6427) 2022-12-24 17:30:26 +07:00
Alex Sharov
ade933be6b
kv_remote: server to support thread-safe multi-streams per 1 tx (#6402) 2022-12-24 13:11:15 +07:00
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
Andrew Ashikhmin
4931f113c2
Add override.shanghaiTime flag (#6414)
and remove `--override.terminaltotaldifficulty` &
`--override.mergeNetsplitBlock`
2022-12-23 17:06:56 +01: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
Alex Sharov
599695d001
RemoteBlockReader.TxnByIdxInBlock() (#6404) 2022-12-22 12:54:07 +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
Alex Sharov
c32d88f729
simplify StageLoopStep (#6390) 2022-12-21 14:39:19 +07:00
Alex Sharov
65f3af30eb
use one state reader type (#6380) 2022-12-21 11:27:14 +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
Alex Sharov
dfa6505f93
e3: kv/temporal prototype (#6367) 2022-12-19 15:38:54 +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
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
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
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
d45bddc5ad
StagedSync: break dependency to CurrentHeader. Always run non-initial cycle in 1 RwTx (#6348)
cc: @AlexeyAkhunov
2022-12-18 07:59:31 +07:00
Andrew Ashikhmin
0fc2022a0e
Extend fork ID to timestamp-based forks (#6324)
Starting from
[Shanghai](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/shanghai.md),
forks are based on timestamps rather than block heights (see PR #6238).
This PR extends [EIP-2124](https://eips.ethereum.org/EIPS/eip-2124) Fork
ID to include timestamp-based blocks. See also
https://github.com/ethereum/go-ethereum/pull/25878.

Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
2022-12-16 12:08:54 +01:00
ledgerwatch
0a5fa7463d
gas estimation to use a fresh intrablock state (#6326)
Co-authored-by: Scott Fairclough <scott@hexosoft.co.uk>
2022-12-15 12:25:42 +00:00
ledgerwatch
71fb4ccc8e
Workaround for gnosis chain POS downloader (#6315)
Workaround for https://github.com/ledgerwatch/erigon/issues/6308

Very inefficient, because it get 1 single header from the request of 192
headers, so moves quite slowly

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-15 11:13:28 +00:00
Enrique Jose Avila Asapche
e5ddccf212
Disable ipv6 flag (#6295)
This was a great idea #6261 
Added two new flags to turn off downloader ipv6 and/or ipv4 usage
2022-12-15 16:40:59 +07:00
Alex Sharov
863e1ed07b
e3: handle "kill -9" during merge, auto-hide history .ef file if not corresponding .v file (#6304) 2022-12-15 13:49:06 +07:00
alex.sharov
62125a0dc1 save 2022-12-14 21:41:54 +07:00
Igor Mandrigin
786610df3f
Fix debug_traceTransaction on Gnosis Chain (#6311)
Support 0-gas service transactions in tracing module.
2022-12-14 14:35:28 +01:00
ledgerwatch
47692bb334
Prevent empty responses to skeleton requests (#6305)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-14 12:02:23 +00:00
Alex Sharov
99a3ab88f2
e3: cli command to retire/prune history (#6300) 2022-12-14 10:01:11 +07:00
alex.sharov
b9e54fa2e1 save 2022-12-14 09:53:38 +07:00
Alex Sharov
ce9203d80d
e3: more aggressive prune #780 (#6299) 2022-12-14 09:50:48 +07:00
Andrew Ashikhmin
1e206e375b
Set default for externalcl based on whether embedded CL is supported (#6294)
Embedded CL is not supported for Gnosis Chain, so it makes sense to set
`externalcl` to true by default for it.

Also, this PR sets `terminalTotalDifficultyPassed` for Gnosis Chain &
Chiado (see https://docs.gnosischain.com/updates/20221210-merge).
2022-12-13 14:51:13 +01:00
ledgerwatch
5616ec2529
Disable validator set check in historical due to BEP-131, restore Ske… (#6290)
…letons

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-12 20:46:20 +00:00
awskii
a124bcf6ac
added --p2p.allowed-port flag (#6263)
Regarding https://github.com/ledgerwatch/erigon/issues/6260

added flag `--p2p.allowed-ports=<porta>,<portb>` to restrict which ports
to use for sentries for different protocol versions.

Default for this flag is `30303, 30304` (first port is inherited from
`--port` flag defaults.
If `--port` is changed and it's new value is not presented in allowed
port list, provided port will be allowed as well as list provided via
`--p2p.allowed-ports`

Port picking is straightforward, we create sentry gRPC server for
protocol over first allowed port that is not already taken.
If there are no allowed ports left, erigon exits with hint.
2022-12-12 13:25:47 +00:00
ledgerwatch
1c3c486d00
Avoid using peers returning empty responses, not sending skeleton requests (#6281)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-11 23:03:10 +00:00
Andrew Ashikhmin
ecefc53dd0
Remove Ropsten & Fermion (#6262)
See https://blog.ethereum.org/2022/11/30/ropsten-shutdown-announcement
2022-12-10 22:55:31 +00:00
ledgerwatch
0a31f5ac2a
Workaround for the code history of BSC system contracts (#6274)
Works around a flaw in the upgrade logic of the system contracts. Since
they are updated directly, without first being self-destructed and then
re-created, the usual incarnation logic does not get activated, and all
historical records of the code of these contracts are retrieved as the
most recent version. This problem will not exist in erigon3, but until
then, a workaround will be used to access code of such contracts through
a special structure, `SystemContractCodeLookup`

Fixes https://github.com/ledgerwatch/erigon/issues/5865

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2022-12-10 22:41:04 +00:00
Alex Sharov
5c05ff4c2a
Exec new blocks in TxnNoSync. Prune after sending notifications in TxnSync (#6222)
Change from: 
```
begin(TxNoSync)
exec new block, index nee data
do limited pruning 
commit()
send notifications about new data arrival to other apps, they may start reading new data at this time (by new read transactions) 
```
Change to: 
```
begin(TxNoSync)
exec new block, index nee data
commit() // no fsync here
send notifications about new data arrival to other apps, they may start reading new data at this time (by new read transactions) 
begin()
do pruning 
commit() // fsync here
```

it allows notify earlier. Fsync (of all changes) on modern drives is
fast, but on cloud-drives it’s about 1sec in worst cases.
2022-12-09 19:48:56 +07:00
Andrew Ashikhmin
7eab12d90d
Shanghai & Cancun forks should be based on timestamp (#6238) 2022-12-07 18:45:44 +01:00
Andrew Ashikhmin
767f5f7edd
Demote "[Downloader] posAnchor" log to debug (#6234)
The message floods the log.
2022-12-07 12:47:03 +01:00
Alex Sharov
c555c03bb3
e3: use ibs.Reset() in rpc-daemon (#6207) 2022-12-05 12:42:08 +07:00
Håvard Anda Estensen
1398703bc5
Use hex package to convert bytes to string (#6205) 2022-12-05 09:06:16 +07:00