Commit Graph

309 Commits

Author SHA1 Message Date
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
ddl
3d9cb0494f
fix: cl/beacon genesisResponse name (#8923) 2023-12-11 10:08:00 +07:00
a
036446777c
max blocks in gossipsource (#8944) 2023-12-10 07:40:04 -06:00
Giulio rebuffo
0d2aecf829
Backfill only with flag (#8913)
Caplin snapshots only enabled with caplin.backfill
2023-12-06 14:22:13 +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
a
47a6ac16da
[beacon handler] framework (#8851)
adds a two indexes to the validators cache

creates beaconhttp package with many utilities for beacon http endpoint
(future support for ssz is baked in)

started on some validator endpoints
2023-12-05 00:13:52 +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
Bayram Guvanjov
e7e1bf444c
Caplin: Add a request limiter (#8868)
This PR is to add the request rate limiter. 

The solution is to count the request number for each peer for each
minute, if the peer exceeds the limit, block the requests for a
specified time.

Current limits:
- Request limited to `5000` requests per minute for each handler.
- Penalty blockage time `1-minute`
2023-12-01 20:11:18 +01:00
milen
9b74cf0384
metrics: use prometheus histogram and summary interfaces (#8808) 2023-11-24 17:50:57 +00:00
Giulio rebuffo
57bcbaa21f
Adds flags to enable/disable backfilling and enable full historical beacon node (#8813)
* Correct naming of hash func in Eth2
* Customizable mode of operation for Caplin
2023-11-22 13:24:35 +01:00
Giulio rebuffo
a2433455f9
Keep few beacon block headers in mdbx (#8809)
Now keep few beacon block headers in mdbx
2023-11-22 01:45:15 +01:00
Giulio rebuffo
073dbe25ac
Added duties/proposer to beacon api (#8777) 2023-11-19 22:03:14 +01:00
Giulio rebuffo
7d28151a11
Added data model for public keys validator (#8774)
We store public keys contiguosly and batch update them on forkchoice
2023-11-18 19:03:56 +01:00
Giulio rebuffo
b72b5b95c5
working debug/state/ for early states (#8767)
Added jsonification to beacon state
2023-11-18 03:08:19 +01:00
Andrew Ashikhmin
d4cd712da0
Revisit getPayloadBodiesByHash (#8758)
Revisit PR #8750
2023-11-17 13:04:02 +01:00
Mark Holt
f3ce5f8a36
Bor proofgen tests (#8751)
Added initial proof generation tests for polygon reverse flow for devnet

Blocks tested, receipts need trie proof clarification
2023-11-17 10:41:45 +00: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
Mark Holt
509a7af26a
Discovery zero refresh timer (#8661)
This fixes an issue where the mumbai testnet node struggle to find
peers. Before this fix in general test peer numbers are typically around
20 in total between eth66, eth67 and eth68. For new peers some can
struggle to find even a single peer after days of operation.

These are the numbers after 12 hours or running on a node which
previously could not find any peers: eth66=13, eth67=76, eth68=91.

The root cause of this issue is the following:

- A significant number of mumbai peers around the boot node return
network ids which are different from those currently available in the
DHT
- The available nodes are all consequently busy and return 'too many
peers' for long periods

These issues case a significant number of discovery timeouts, some of
the queries will never receive a response.

This causes the discovery read loop to enter a channel deadlock - which
means that no responses are processed, nor timeouts fired. This causes
the discovery process in the node to stop. From then on it just
re-requests handshakes from a relatively small number of peers.

This check in fixes this situation with the following changes:

- Remove the deadlock by running the timer in a separate go-routine so
it can run independently of the main request processing.
- Allow the discovery process matcher to match on port if no id match
can be established on initial ping. This allows subsequent node
validation to proceed and if the node proves to be valid via the
remainder of the look-up and handshake process it us used as a valid
peer.
- Completely unsolicited responses, i.e. those which come from a
completely unknown ip:port combination continue to be ignored.
-
2023-11-07 08:48:58 +00:00
Giulio rebuffo
e08b031f74
Updated go.sum and go.mod for snapshots (#8664) 2023-11-06 23:39:44 +01:00
Giulio rebuffo
4b580dcc2f
update caplin snapshots hashes (#8663)
This PR also adds snippets to download caplin snapshots
2023-11-06 21:05:07 +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
Dmytro
9adf31b8eb
bytes transfet separated by capability and category (#8568)
Co-authored-by: Mark Holt <mark@distributed.vision>
2023-10-27 22:30:28 +03: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
a
0a8bda751e
mbps (#8564) 2023-10-23 21:23:54 +02:00
Dmytro
ec59be2261
Dvovk/sentinel and sentry peers data collect (#8533) 2023-10-23 17:33:08 +03: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
0ac11d0c94
Remove useless printlns (#8542) 2023-10-21 23:44:56 +02:00
Giulio rebuffo
3f30b96199
Forkchoice states saved on disk (#8546) 2023-10-21 23:10:58 +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
Alex Sharov
3ac9f493b6
move chainname and snapcfg packages to erigon-lib (#8508) 2023-10-18 13:37:39 +07:00
Giulio rebuffo
9e42b705ce
Caplin: under the hood block downloading (#8459) 2023-10-16 15:35:26 +02:00
Giulio rebuffo
a7e63da066
CI Job for Consensus specs (#8483)
Consensus Specification Tests takes less than 8 minutes so I think they
can be in a PR's own CI for whenever it is ready. for reference it is
less than make test
2023-10-15 19:47:53 +02:00
Giulio rebuffo
bf2ef04c46
Optimized the checkpoint state layout (#8482) 2023-10-15 18:05:13 +02:00
Giulio rebuffo
1da6dc25f3
Caplin: Resetting cache head hash when new slot is avaiable (#8477) 2023-10-14 20:53:16 +02:00
Giulio rebuffo
54ce971084
Added separate Withdrawal data type to Caplin (#8474)
Reason: JSON formatting
2023-10-14 17:59:52 +02:00
Giulio rebuffo
2294c8c66c
EthereumExecutionService in MockSentry (#8373)
Now we use the ethereum execution service directly:

* Changed sig of InsertChain
* Use of the service in case of PoS
2023-10-05 18:30:19 +02:00
Giulio rebuffo
a62796ab4d
Added block snapshot format (attempt for Caplin) (#8357)
Added block snapshot format
2023-10-03 23:50:43 +02:00
Giulio rebuffo
10746eb376
Added BLS_TO_EXECUTION_CHANGES pool (#8332)
Adds BLS_TO_EXECUTION_CHANGES
2023-10-01 17:16:55 +02:00
Giulio rebuffo
72ba18bd36
Beacon: Added basic operations pool (#8309)
Added operation pools for beacon chain. operations are the equivalent of
txs for eth2

Added operation pools for:

* Attester Slashings
* Proposer Slashings
* VoluntaryExits
* BLSExecutionToChange
* Postponed to later: Attestations (or maybe not)
2023-09-29 23:42:07 +02:00
Giulio rebuffo
d555fc450d
Fixed ungraceful shutdown (#8307) 2023-09-27 19:09:36 +02:00
Giulio rebuffo
d62ef03cad
Added states/fork and states/root to beacon API (#8293)
Added /eth/v1/beacon/states/{state_id}/root and
/eth/v1/beacon/states/{state_id}/fork
2023-09-27 11:15:51 +02:00
a
7a833e5dc5
can't change size of btree during ascend (#8295) 2023-09-27 09:42:20 +07:00
Giulio rebuffo
75c42d15f5
Beacon API: added support octect-stream (#8282)
Added support for ssz response
2023-09-24 20:08:05 +02:00
Giulio rebuffo
a95914df26
Added blocks API and attestations API (#8279) 2023-09-24 01:44:26 +02:00
Giulio rebuffo
13720af42c
Caplin: Implemented internal tree for ValidatorSet (#8234) 2023-09-22 12:16:19 +02:00
Giulio rebuffo
2aa060f454
Fixed forkchoice nil exception (#8223) 2023-09-17 17:06:44 +02:00
Giulio rebuffo
0b307e7aca
Fixed accidental chain gap (#8222)
A chain gap can occur when peers may not give us enough info
2023-09-17 16:25:17 +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
346b278a3b
Caplin: Improved logging (#8169) 2023-09-10 22:10:21 +02:00
alex.sharov
6c1cf0a9b0 save 2023-09-10 15:49:13 +07:00
Alex Sharov
2318138c6c
Downloader: don't fail when see unusual file, skip it (backward/forward compatibility) (#8170) 2023-09-10 15:46:30 +07:00
Giulio rebuffo
6c22b77451
Added /config route to the beacon api (#8168) 2023-09-09 15:33:23 +02:00
Giulio rebuffo
5951db2e22
Added /blocks/{block_id}/root api method (#8164) 2023-09-09 00:33:24 +02:00
Giulio rebuffo
b92f6d9814
Finished jsonification of solid package (#8163) 2023-09-08 23:02:34 +02:00
Giulio rebuffo
4733f7fb52
Added json tags to beacon block (#8162) 2023-09-08 22:26:02 +02:00
Giulio rebuffo
22bd173ab3
Updating Libs (#8147)
* BLS
* Sqlite
2023-09-06 23:20:26 +02:00
Giulio rebuffo
841327e212
BeaconAPI: Implemented /Spec (#8131) 2023-09-05 22:37:18 +02:00
Giulio rebuffo
1cfb1eb1e7
Caplin: fixed canonical tracking (#8120) 2023-09-03 13:40:10 +02:00
Mark Holt
8ea0096d56
moved metrics sub packages types to metrics (#8119)
This is a non functional change which consolidates the various packages
under metrics into the top level package now that the dead code is
removed.

It is a precursor to the removal of Victoria metrics after which all
erigon metrics code will be contained in this single package.
2023-09-03 08:09:27 +07:00
Giulio rebuffo
78d05cb367
Fix devel lint and demote logs (#8114) 2023-09-01 21:49:57 +02:00
Giulio rebuffo
825be2ac11
Beacon API: added /headers methods (#8112) 2023-09-01 15:29:17 +02:00
alex.sharov
e53df00849 split grafana board to: user-facing and dev-facing (internals) 2023-09-01 12:09:30 +07:00
Mark Holt
a4cfbe0d56
Heimdall metrics + Metrics HTTP server rationalization (#8094)
This is an update of:

https://github.com/ledgerwatch/erigon/pull/7846

which uses a local fork of victoria metrics to include the changes that
https://github.com/anshalshukla added to the original for we where
using.

It also includes code to address the duplicate metrics issue identified
here:

https://github.com/ledgerwatch/erigon/issues/8053

It has one more associated fix which is to correctly add a metadata
label to counters, these where previously labelled as gauges.

e.g. 

```
# TYPE p2p_peers counter
p2p_peers 0
```
rather than

```
# TYPE p2p_peers gauge
p2p_peers 0
```

---------

Co-authored-by: Anshal Shukla <53994948+anshalshukla@users.noreply.github.com>
Co-authored-by: Anshal Shukla <shukla.anshal85@gmail.com>
2023-08-31 09:04:27 +01:00
Giulio rebuffo
e7dbc69571
Middleware for Caplin Beacon API (#8103) 2023-08-31 01:18:12 +02:00
Giulio rebuffo
901edf9181
Accessors to Caplin indexed database (#8093) 2023-08-29 16:47:16 +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
d223adf114
Better migrations and chain segmentation recovery (#8079) 2023-08-25 17:45:00 +02:00
Giulio rebuffo
41185e2518
Added Online pruning to Caplin (#8058)
Basically, pruning is specified by the user, by default, 1 million (in
the PR set to 100 for pruning purposes). the pruning for the database is
stored inside the db
2023-08-25 14:58:35 +02:00
Giulio rebuffo
db4533acd0
fixed small inconsistency with sqlite3 (#8054) 2023-08-23 22:44:22 +02:00
Giulio rebuffo
bd81e15981
Caplin: Implemented SQL beacon indexer (#8043) 2023-08-22 01:24:26 +02:00
Alex Sharov
863a706858
caplin: use tmpdir inside datadir (#8041) 2023-08-20 15:26:34 +02:00
Giulio rebuffo
6d2a9aed2f
Fixed startup panic (#8040) 2023-08-18 22:16:30 +02:00
Giulio rebuffo
38db2ed2e7
[Caplin Phase 2]: Initial working implementation (#8033)
caplin just using execution.proto
2023-08-18 15:43:22 +02:00
Giulio rebuffo
cab6d30322
Caplin's Persistence data format (#8028) 2023-08-16 23:03:25 +02:00
Giulio rebuffo
c8db11f150
Sentinel: improvements to block download (#8023) 2023-08-16 17:02:30 +02:00
a
521f0df55b
Historical block downloader (#8016) 2023-08-16 04:32:40 +02:00
Giulio rebuffo
114dd684eb
Caplin Optimization: Efficient Processing of Epoch and Reuse of checkpoint states (#8020) 2023-08-15 12:45:48 +02:00
Giulio rebuffo
98db1e97b5
Better caplin logging (#8009) 2023-08-12 22:29:30 +02:00
Giulio rebuffo
de5706dbc6
Direct sentinel instead of over the network sentinel (#8006) 2023-08-12 01:54:45 +02:00
Giulio rebuffo
e3a59ed902
Better caplin logging and logic (#7992) 2023-08-10 22:34:58 +02:00
a
db5b348673
Caplin block persistence (#7941)
Co-authored-by: Giulio <giulio.rebuffo@gmail.com>
2023-08-09 01:21:19 +02:00
Andrew Ashikhmin
d69b20bc4e
Support engine_forkchoiceUpdatedV3 with ParentBeaconBlockRoot (EIP-4788) (#7969)
Prerequisites: https://github.com/ledgerwatch/interfaces/pull/187 &
https://github.com/ledgerwatch/erigon-lib/pull/1069. Also implement
https://github.com/ethereum/execution-apis/pull/426.
2023-08-06 11:54:14 +02:00
Andrew Ashikhmin
e1f1c081fc
Remove failing TestGnosisForkDigest (#7959)
I'm not sure what caused this failure (for instance, CI for PR #7888 was
green), but currently we have the following test failure in `devel`:
```
--- FAIL: TestGnosisForkDigest (0.00s)
    fork_test.go:79: 
            Error Trace:    github.com/ledgerwatch/erigon/cl/fork/fork_test.go:79
            Error:          Not equal: 
                            expected: [4]uint8{0x82, 0x4b, 0xe4, 0x31}
                            actual  : [4]uint8{0x21, 0xa6, 0xf8, 0x36} 
```
2023-08-02 14:07:34 +02:00
Somnath Banerjee
d91f4263dc
EIP-4788: Beacon block root and stateful precompile (#7888) 2023-08-01 16:01:26 +05:30
Giulio rebuffo
443757edbd
Consensus separation for Engine API (Working on Sepolia) (#7945)
This makes the experimental consensus separation functional on sepolia.
2023-07-30 23:35:55 +02:00
racytech
af884204cb
eip-4844: hive tests: RLP decode order and newPayloadV3 to expect versionedHashes (#7943) 2023-07-30 15:49:31 +02:00
Andrew Ashikhmin
7d35c6b737
EIP-4844: Rename "data gas" to "blob gas" (#7937)
See https://github.com/ethereum/EIPs/pull/7354 &
https://github.com/ethereum/consensus-specs/pull/3461. Prerequisite:
https://github.com/ledgerwatch/erigon-lib/pull/1058
2023-07-28 12:12:05 +02:00
a
dc47f43f4d
[caplin] block persistence experimentation (#7935) 2023-07-28 00:55:14 +02:00
Giulio rebuffo
b4ecd7f524
Consensus Separation: Separated GetPayload using an execution service (#7933)
Miracoulously, hive tests pass first try. YIPPIE.

Also for the future, I added `--experimental.modular` which enables a
secondary engine API for consensus separation.

Now block building is responsibility of the execution module.
2023-07-27 14:37:49 +02:00
a
60a200fd46
[caplin] basic persistence layer (#7918) 2023-07-25 22:24:52 +02:00
Giulio rebuffo
f5f833fd70
Proper Error handling in direct communication with engine (#7929) 2023-07-25 14:15:50 +02:00