Commit Graph

65 Commits

Author SHA1 Message Date
Andrew Ashikhmin
20999401b2
release: downloader: prohibit_new_downloads.lock check missed download (#9300)
Cherry pick PR #9295

---------

Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
2024-01-24 12:41:31 +01:00
ddl
a1eee5eb8b
fix udpOrHttpTrackers amount (#9245)
seems we just choose the first 8 trackers in
https://github.com/ledgerwatch/trackerslist/blob/master/trackers_best.txt.
2024-01-17 14:21:39 +07:00
Mark Holt
b05ffc909d
Fixes for Bor Block Production Synchronization (#9162)
This PR contains 3 fixes for interaction between the Bor mining loop and
the TX pool which where causing the regular creation of blocks with zero
transactions.

* Mining/Tx pool block synchronization
The synchronization of the tx pool between the sync loop and the mining
loop has been changed so that both are triggered by the same event and
synchronized via a sync.Cond rather than a polling loop with a hard
coded loop limit. This means that mining now waits for the pool to be
updated from the previous block before it starts the mining process.
* Txpool Startup consolidated into its MainLoop
Previously the tx pool start process was dynamically triggered at
various points in the code. This has all now been moved to the start of
the main loop. This is necessary to avoid a timing hole which can leave
the mining loop hanging waiting for a previously block broadcast which
it missed due to its delay start.
* Mining listens for block broadcast to avoid duplicate mining
operations
The mining loop for bor has a recommit timer in case blocks re not
produced on time. However in the case of sprint transitions where the
seal publication is delayed this can lead to duplicate block production.
This is suppressed by introducing a `waiting` state which is exited upon
the block being broadcast from the sealing operation.
2024-01-10 17:12:15 +00:00
Alex Sharov
2cbe8b7fe7
downloader: --verify --verify.files --verify.failfast support (#9156) 2024-01-08 16:01:02 +07:00
Giulio rebuffo
46ecf030f5
Added GET /eth/v1/beacon/rewards/blocks/{block_id} and POST /eth/v1/beacon/rewards/sync_committee/{block_id} (#9102)
* Changed slightly archive format (again)
* Added all of the remaining rewards endpoints
2023-12-30 20:51:28 +01:00
Mark Holt
79ed8cad35
E2 snapshot uploading (#9056)
This change introduces additional processes to manage snapshot uploading
for E2 snapshots:

## erigon snapshots upload

The `snapshots uploader` command starts a version of erigon customized
for uploading snapshot files to
a remote location.  

It breaks the stage execution process after the senders stage and then
uses the snapshot stage to send
uploaded headers, bodies and (in the case of polygon) bor spans and
events to snapshot files. Because
this process avoids execution in run signifigantly faster than a
standard erigon configuration.

The uploader uses rclone to send seedable (100K or 500K blocks) to a
remote storage location specified
in the rclone config file.

The **uploader** is configured to minimize disk usage by doing the
following:

* It removes snapshots once they are loaded
* It aggressively prunes the database once entities are transferred to
snapshots

in addition to this it has the following performance related features:

* maximizes the workers allocated to snapshot processing to improve
throughput
* Can be started from scratch by downloading the latest snapshots from
the remote location to seed processing

## snapshots command

Is a stand alone command for managing remote snapshots it has the
following sub commands

* **cmp** - compare snapshots
* **copy** - copy snapshots
* **verify** - verify snapshots
* **manifest** - manage the manifest file in the root of remote snapshot
locations
* **torrent** - manage snapshot torrent files
2023-12-27 22:05:09 +00:00
Alex Sharov
bc50bd50a4
make 500K files also seedable (because they actually are) (#9077) 2023-12-25 10:07:31 +07:00
Dmytro
a36071e7ff
dvovk/snapidx (#9049) 2023-12-22 11:25:55 +00:00
Alex Sharov
657aafd5b7
allow erigon download .torrent from webseed by default (#9052) 2023-12-22 11:42:35 +07:00
ledgerwatch
3b10ba95d5
Fix creation of torrent files (#9048)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-12-21 12:42:07 +00:00
Alex Sharov
9eb9151be4
atomic CRUD for .torrent files (#9043) 2023-12-21 05:15:32 +00:00
Alex Sharov
1499fbb582
reduce mutex-contention in downloader.ReCalcStats (#9044) 2023-12-21 04:00:03 +00:00
Alex Sharov
56c5f656d0
downloader: handle race between adding magnet link and files from webseed (#9045) 2023-12-21 03:59:26 +00:00
Alex Sharov
7107cfed0f
snaps: stop merge to 500K and enjoy immutability (#9034) 2023-12-21 08:04:46 +07:00
Alex Sharov
1ae3f41189
db migration: if stage_snapshots > 0, then create prohibit_new_downloads.lock file (#9036)
it will protect existing nodes from downloading `v2` files - even if
they do upgrade
2023-12-20 18:04:43 +07:00
Alex Sharov
47c5f16a8d
downloader: don't log complete files info (#9013) 2023-12-18 09:28:20 +01:00
Alex Sharov
9ccd8a1f91
snapshots: --metrics must not affect logs about peers rate (#8990) 2023-12-15 08:05:54 +01:00
Dmytro
3b68d57c28
collect statistics even for download completed or not started files (#8956)
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
2023-12-14 07:53:54 +01:00
ledgerwatch
58dabdc601
Fixup bittorrent/webseed download logs after refactoring (#8976)
After a refactoring, the detailed bittorrent vs webseeds log has
disappeared
2023-12-13 17:40:20 +01:00
Alex Sharov
d41d523050
Downloader: add ProhibitNewDownloads() (#8939)
"whitelisting" mechanism (list of files - stored in DB) - which
protecting us from downloading new files after upgrade/downgrade was
broken. And seems it became over-complicated with time.
I replacing it by 1 persistent flag inside downloader:
"prohibit_new_downloads.lock"
Erigon will turn downloader into this mode after
downloading/verification of first snapshots.


```
//Corner cases:
	// - Erigon generated file X with hash H1. User upgraded Erigon. New version has preverified file X with hash H2. Must ignore H2 (don't send to Downloader)
	// - Erigon "download once": means restart/upgrade/downgrade must not download files (and will be fast)
	// - After "download once" - Erigon will produce and seed new files
```

------
`downloader --seedbox` is never "prohibit new downloads"
2023-12-12 16:05:56 +07:00
Dmytro
4696769d25
dvovk/snapshotsstats (#8935)
Updated collecting snapshots, renamed keys
2023-12-08 21:07:59 +07:00
Dmytro
c91ca2db85
dvovk/sync file level (#8931) 2023-12-08 12:08:38 +01:00
Alex Sharov
ad48ecdcbb
downloader: download rates per peer with webseeds (#8879) 2023-12-01 13:39:43 +00:00
Alex Sharov
421118378a
fix LoadFromFile empty error (#8877) 2023-12-01 18:50:06 +07:00
Alex Sharov
0fbcd5b5d8
downloader: use manifest.txt for public bucket (#8863)
use manifest.txt instead of webseed.toml in public buckets
2023-11-30 16:58:23 +07:00
Alex Sharov
8cfafa446a
add command "downloader torrent_cat" (#8824) 2023-11-27 08:49:19 +07:00
Alex Sharov
748359cf72
webseed: .torrent file validation must check - fileName and hash (#8820)
because files with different name can have same hash: BitTorrent is
content-addressable.
2023-11-24 18:46:17 +07:00
Giulio rebuffo
073dbe25ac
Added duties/proposer to beacon api (#8777) 2023-11-19 22:03:14 +01:00
Alex Sharov
9a9db2d90b
downloader: whitelist only .seg.torrent files. (#8729) 2023-11-15 11:23:57 +07:00
Giulio rebuffo
8d8368091c
Add full support to beacon snapshots (#8665)
This PR adds beacon blocks snapshots for the following chains:

* Mainnet snapshots
* Sepolia snapshots
2023-11-13 14:10:57 +01:00
Alex Sharov
bba91e90ec
downloader: demote webseed request errors (#8662) 2023-11-06 14:47:57 +01:00
Alex Sharov
329d18ef6f
snapshots: reduce merge limit of blocks to 100K (#8614)
Reason: 
- produce and seed snapshots earlier on chain tip. reduce depnedency on
"good peers with history" at p2p-network.
Some networks have no much archive peers, also ConsensusLayer clients
are not-good(not-incentivised) at serving history.
- avoiding having too much files:
more files(shards) - means "more metadata", "more lookups for
non-indexed queries", "more dictionaries", "more bittorrent
connections", ...
less files - means small files will be removed after merge (no peers for
this files).


ToDo:
[x] Recent 500K - merge up to 100K 
[x] Older than 500K - merge up to 500K 
[x] Start seeding 100k files
[x] Stop seeding 100k files after merge (right before delete)

In next PR: 
[] Old version of Erigon must be able download recent hashes. To achieve
it - at first start erigon will download preverified hashes .toml from
s3 - if it's newer that what we have (build-in) - use it.
2023-11-01 23:22:35 +07:00
Alex Sharov
8e54a965ca
webseed: don't download .torrent files (#8629) 2023-11-01 15:50:35 +07:00
Alex Sharov
c23e5a1abf
downloader: preparations for reducing blocks merge limit (#8612) 2023-10-30 13:46:35 +07:00
Alex Sharov
b311da959f
downloader: webseed better error messages (#8611) 2023-10-30 12:13:45 +07:00
Andrew Ashikhmin
8231cdaede
downloader: less webseed logs (#8586) (#8607)
Merge PR #8586 into `devel`

Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
2023-10-29 10:37:50 +01:00
Giulio rebuffo
0e5af0a69c
Added beacon snapshots download (#8601) 2023-10-28 17:41:50 +02:00
Alex Sharov
3d3c0bec18
downloader: log.Trace non-important log messages instead of skipping it (#8574) 2023-10-25 11:35:22 +07:00
Giulio rebuffo
995009ac7b
Added cli too for Snapshots Generations for Caplin (#8543) 2023-10-22 19:21:37 +02:00
Alex Sharov
783b2f39d6
downloader: fix e2 bucket name (#8521) 2023-10-20 13:54:38 +07:00
Alex Sharov
12d33d516c
downloader: supress some "EOF" logs (#8519) 2023-10-19 11:29:35 +07:00
Alex Sharov
f998e18219
downloader: default webseed token for e2 (#8512) 2023-10-19 08:17:49 +07:00
Giulio rebuffo
82f1e9f342
Skip blockhashes stage (#8497) 2023-10-18 16:39:11 +02:00
Alex Sharov
6edaee1853
downloader: less webseed logs (#8510) 2023-10-18 15:27:41 +07:00
Alex Sharov
33d5399436
downloader: support token (#8507) 2023-10-18 14:24:09 +07:00
Alex Sharov
ab04de6d9f
mdbx: don't mix modes (#8490)
db must not use "Durable" and "SyncPeriod" in same time

txpool and downloader must be: Durable
nodedb:  SafeNoSync+SyncPeriod

because txpool and downloader already can call sync when they need
(txpool after regular flush, downloader after piece download+validation
completion).
2023-10-16 16:21:44 +07:00
Alex Sharov
9db82fee5b
downloader: don't loose debug logs (#8473) 2023-10-14 17:11:39 +07:00
Alex Sharov
7d357b4327
better webseed support (#8466) 2023-10-13 18:03:52 +07:00
Alex Sharov
6d9a4f4d94
rpcdaemon: must not create db - because doesn't know right parameters (#8445) 2023-10-12 14:11:46 +07:00
Alex Sharov
fe263ae02e
downloader: smaller ratelimit birst (#8435) 2023-10-11 16:18:21 +07:00