Commit Graph

35 Commits

Author SHA1 Message Date
Dmytro
ff92b701c3
dvovk/updsync (#9134)
refactored data structure for sync statistics
2024-01-08 10:43:04 +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
Giulio rebuffo
eaf0348bd0
[Grindmas] Added tests to Beacon API, also fixed stuff. (#9074)
* Testing Beacon API
* Fixed sentinel code (a little bit)
* Fixed sentinel tests
* Added historical state support
* Fixed state-related endpoints (i was drunk when writing them)
2023-12-25 02:34:13 +01:00
Giulio rebuffo
a4d7b6d33f
Switched Caplin snapshot format to ZSTD blinded blocks (#9058)
* Chunked format -> blinded
* LZ4 -> ZSTD
* Implemented parent block root support for history download
* Rationale: Allows to optimize GC collection easily on state
reconstruction and it allows to read fast attestations in historical
states reader
2023-12-23 15:56:35 +01:00
Alex Sharov
657aafd5b7
allow erigon download .torrent from webseed by default (#9052) 2023-12-22 11:42:35 +07:00
Giulio rebuffo
0e18866ed9
Added fill-up with pre-existing API (#9042) 2023-12-21 17:49:40 +01:00
Alex Sharov
7107cfed0f
snaps: stop merge to 500K and enjoy immutability (#9034) 2023-12-21 08:04:46 +07: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
Giulio rebuffo
24987878e4
Resumable beacon state reconstruction (#8918)
* Most of the PR changed files are extra and slightly more complicated
unit tests.
* Fixed Eth1DataVotes not inheriting genesis
* Fixed Attestations simulation using wrong slot when reconstructing
partecipation
* Fixed Copy() operation on BeaconState on Eth1DataVotes
* Used correct ListSSZ type for Eth1DataVotes and HistoricalSummaries
* Fixed wrong []uint64 deltas on empty slots
2023-12-11 14:07:57 +01:00
Giulio rebuffo
c477281362
Caplin: Parallel historical states reconstruction (#8817)
What does this PR do:
* Optional Backfilling and Caplin Archive Node
* Create antiquary for historical states
* Fixed gaps of chain gap related to the Head of the chain and anchor of
the chain.
* Added basic reader object to Read the Historical state
2023-12-06 10:48:36 +01:00
Alex Sharov
49890b38b7
caplin: to use 1 worker for snapshots compression (#8892)
Erigon by default must use as minimum resources as possible to build
snapshots. But cli commands - can go opposite and maximize.
2023-12-04 18:55:40 +07:00
Giulio rebuffo
274f84598c
Automation tool to automatically upload caplin's snapshot files to R2 (#8747)
Upload beacon snapshots to R2 every week by default
2023-11-16 20:59:43 +01:00
Giulio rebuffo
51af060450
Added --beacon.api flags to enable experimental beacon api. (#8727)
Make it so that erigon can the enable beacon api.
2023-11-15 15:07:16 +01: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
Giulio rebuffo
e67db34145
Caplin: Bumbed down snapshots from 500 to 100k (#8657) 2023-11-06 15:41:19 +01:00
Giulio rebuffo
513fd50fa5
Compress snapshots for Caplin with lz4 level=1 (#8609) 2023-10-30 13:48:14 +01:00
Alex Sharov
c23e5a1abf
downloader: preparations for reducing blocks merge limit (#8612) 2023-10-30 13:46:35 +07:00
Giulio rebuffo
0e5af0a69c
Added beacon snapshots download (#8601) 2023-10-28 17:41:50 +02:00
Giulio rebuffo
d7448fdb3f
Added functional beacon snapshots reader and generator to Caplin (#8570)
This PR adds beacon blocks snapshots and beacon blocks snapshot
generator to Caplin, plus a snapshot verifier CLI
2023-10-24 21:32:29 +02:00
Giulio rebuffo
995009ac7b
Added cli too for Snapshots Generations for Caplin (#8543) 2023-10-22 19:21:37 +02:00
Giulio rebuffo
8f29ca7405
Same range parallel downloader (#8554)
will do a more advanced version later
2023-10-22 17:30:27 +02:00
a
436493350e
Sentinel refactor (#8296)
1. changes sentinel to use an http-like interface

2. moves hexutil, crypto/blake2b, metrics packages to erigon-lib
2023-10-22 01:17:18 +02:00
Giulio rebuffo
684ca4c030
keep caplin data (#8518) 2023-10-19 00:53:03 +02:00
Giulio rebuffo
343479988c
Caplin <-> MDBX (#8470) 2023-10-18 23:10:53 +02:00
Giulio rebuffo
c1961eff2b
Added the option to directly write blocks on io.Writer. (#8215) 2023-09-17 13:15:06 +02:00
Giulio rebuffo
c552f993ac
Removed Partial blocks and reduced pruneDepth to 1000 (#8198) 2023-09-14 22:14:05 +02:00
Giulio rebuffo
2f8687fe08
Smart SQL transactions (#8185) 2023-09-14 02:56:29 +02:00
Giulio rebuffo
22bd173ab3
Updating Libs (#8147)
* BLS
* Sqlite
2023-09-06 23:20:26 +02:00
Giulio rebuffo
93cdbae2e5
Caplin<->Erigon: Added Range methods (#8087) 2023-08-29 02:37:30 +02:00
Giulio rebuffo
8291aa2497
Caplin: Storing Execution Headers in Caplin (#8080)
This PR stores Execution Headers in Caplin when running without storing
fullblocks
2023-08-26 00:41:57 +02:00
Giulio rebuffo
bd81e15981
Caplin: Implemented SQL beacon indexer (#8043) 2023-08-22 01:24:26 +02:00
Giulio rebuffo
cab6d30322
Caplin's Persistence data format (#8028) 2023-08-16 23:03:25 +02:00
a
521f0df55b
Historical block downloader (#8016) 2023-08-16 04:32:40 +02:00
Giulio rebuffo
e3a59ed902
Better caplin logging and logic (#7992) 2023-08-10 22:34:58 +02:00
a
60a200fd46
[caplin] basic persistence layer (#7918) 2023-07-25 22:24:52 +02:00