Commit Graph

557 Commits

Author SHA1 Message Date
Alex Sharov
03e62dce1a
e3: to fix integration tests (#6649) 2023-01-21 11:02:01 +07:00
ledgerwatch
092c75f83e
More fixes to bodies download (#6642)
This time incorrect handling of the empty bodies (which should be
requested)

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-20 19:20:22 +00:00
ledgerwatch
f2111b4132
Another fix for body download (#6633)
When body gets evicted from the cache, its corresponding entry in
`requestMap` is also removed but was never re-instated when re-request
happens

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-19 23:05:38 +00:00
ledgerwatch
31151f96cb
Reduce body cache size when taking item out (#6615)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-01-18 07:00:06 +00:00
Devon Bear
00c73f0c20
clean: VMInterpreter and Fix Linter (#6611) 2023-01-18 06:44:21 +00:00
ledgerwatch
44b834e77a
Further fixes for body downloader (#6610)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-17 22:03:28 +00:00
ledgerwatch
19ce8d2a8f
stage_headers: use block time instead of "topSeenHeight" to determine when it is in sync (#6602)
This is more reliable criterion because it is harder to spoof
continuously by malicious peers

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-17 17:28:02 +00:00
ledgerwatch
a6f75bddf1
Bump version (#6605)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-17 14:58:07 +00:00
Alex Sharov
9a6e463cd3
remove objectdb from tests (#6603) 2023-01-17 21:09:43 +07:00
ledgerwatch
0bea0437bf
Deal with the situation when body cache is too small (#6601)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-17 12:52:07 +00:00
ledgerwatch
c149b3e400
Fix lint (#6600) 2023-01-17 12:19:41 +00:00
Alex Sharov
2719d7ceff
e3: to fix integration tests (#6599) 2023-01-17 18:22:18 +07:00
hexoscott
75a3f08e9d
txpool changes for eip-3860 (#6499)
pass in new values to the txpool on creation to handle shanghai changes.
2023-01-17 11:07:57 +00:00
Alex Sharov
d317722aef
e3: storageRangeAt (#6580) 2023-01-17 14:16:36 +07:00
Alex Sharov
5ad4eb936a
split backend.go:new to 2 funcs (#6595)
Split backend.go:New method to 2. 1st will create db and basic
configuration. 2nd will create instances of stagedsync, txpool, etc...
based on this configuration.
2023-01-17 13:20:31 +07:00
alex.sharov
4f54144c7d compile tests 2023-01-17 09:47:28 +07:00
ledgerwatch
cfb0d99cfa
Improvements for body downloader (#6589)
1. Replacing temporary MBDX table with limited-size btree
2. Always scan block numbers from the start to prioritise low-number
blocks
3. Other fixes and simplifications

Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-16 22:09:28 +00:00
hexoscott
7dcbfbc283
reference hash, address, and chain config from lib (#6536) 2023-01-13 18:12:18 +00:00
ledgerwatch
e9d0ee5ce1
Less aggressive peer handling for BSC/Bor, add warning for bad headers (#6571)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-12 17:17:27 +00:00
Andrew Ashikhmin
58b3016c80
Switch validateAndStorePayload to Body.RawBody() (#6568)
Ensure that withdrawals are not lost in `validateAndStorePayload`.
2023-01-12 14:58:36 +01:00
alex.sharov
abff625dcb fix test 2023-01-11 12:04:22 +07:00
Alex Sharov
919fc390be
randomized mock db path (#6541) 2023-01-10 13:52:05 +07:00
Andrew Ashikhmin
1968fda27f
[Clean-up] Switch protocol to types.(Raw)Body (#6537)
Reduce code duplication.
2023-01-09 14:39:49 +00:00
ledgerwatch
7243db8dbf
Simplify code around topSeenHeight (#6529)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-09 06:42:26 +00:00
Andrew Ashikhmin
b251e31fdc
(*PrefetchedBlocks) Pop -> Get (#6519)
After PR #6515 `(*PrefetchedBlocks) Pop` doesn't remove the block from
the LRU cache anymore, so `Get` is a better name.
2023-01-06 17:33:30 +01:00
Andrew Ashikhmin
4f536abe46
Unify forkSegment with HeaderAndBody (#6517)
Small refactoring after PR #6515.
2023-01-06 15:12:07 +01:00
ledgerwatch
2941e754e9
Fix hive tests and reorganise the fix for body download problem (#6515)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
2023-01-06 12:43:46 +00:00
Alex Sharov
4c3bb1cca5
kv_temporal: DomainGet (#6511) 2023-01-06 14:27:54 +07:00
Andrew Ashikhmin
0b8f4aea2f
Withdrawals in body downloader (#6496) 2023-01-04 10:09:44 +01: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
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
Alex Sharov
ade933be6b
kv_remote: server to support thread-safe multi-streams per 1 tx (#6402) 2022-12-24 13:11:15 +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
dfa6505f93
e3: kv/temporal prototype (#6367) 2022-12-19 15:38:54 +07: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
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
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
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
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
767f5f7edd
Demote "[Downloader] posAnchor" log to debug (#6234)
The message floods the log.
2022-12-07 12:47:03 +01:00
Håvard Anda Estensen
31ec791d5a
Avoiding leaking the popped item (#6193)
Set the deleted item to its zero val so it can be garbage collected.
2022-12-04 11:17:02 +07:00
Håvard Anda Estensen
099fb7c627
Grow string builders (#6192)
Strings builders have a buffer (slice) that can be pre-allocated
2022-12-04 10:51:20 +07:00