Commit Graph

20764 Commits

Author SHA1 Message Date
battlmonstr
c1146bda49
p2p: skip TestUDPv4_smallNetConvergence on Linux (#8731) (#8962) 2023-12-12 17:06:48 +07:00
Andrew Ashikhmin
faaf5a0c86
Amend incarnation logic (#8954) 2023-12-12 11:03:41 +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
Jacek Glen
4217f78368
Fix case when there are more than one matching libraries (#8955)
Small fix to the script for the scenario where more than one matching
library can be returned.
For example, the command `/sbin/ldconfig -p | grep libstdc++ | awk '{
print $NF }'` can result in

```
/lib/x86_64-linux-gnu/libstdc++.so.6
/lib32/libstdc++.so.6
```

which then fails the check `if [[ ! -L "$link_path" ]]`
2023-12-12 08:50:37 +01: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
Alex Sharov
7fb8f9db59
log blocks stat after downloading, before indexing (#8947) 2023-12-11 10:05:51 +00:00
Alex Sharov
34d93fbe18
makefile: unquote silkworm build tag - to make it concatenatable (#8948)
`--tags "a,b,nosilkworm",integration` doesn't work
2023-12-11 09:18:07 +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
Alex Sharov
be10b7de29
bor: block snaps 50m (#8941) 2023-12-10 14:52:10 +07:00
3commascapital
07331f900f
Adds access list sorting (#8933)
Because access lists use maps with the `StorageKey` as the key, they are
subject to inconsistent ordering in the results of the `.accessList()`
method.

To get around this, an `accessListSorted` method has been added, and
exposed with the same name. The `equal` method has also been exposed to
allow for equality checks at this level outside of this module.

Co-authored-by: 3commascapital <8562488-3commascapital@users.noreply.gitlab.com>
2023-12-09 17:25:20 +07:00
Alex Sharov
e006db6ed9
evm cli: no logs if --json (#8925) 2023-12-09 13:42:07 +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
battlmonstr
b86bdb7a7e
silkworm: disable in release binaries (#8927)
A short-term safety measure to keep release.yml GH workflow unaffected.
2023-12-08 11:07:19 +01:00
battlmonstr
dac73f4b57
silkworm: check glibcpp compatibility (#8932)
libsilkworm requires libstdc++.so.6.0.30, but Rocky Linux 9.3 has only
libstdc++.so.6.0.29,
and `make erigon` produces an error about the GLIBCXX Version needed
3.4.30 (available 3.4.29).

see:

https://stackoverflow.com/questions/10354636/how-do-you-find-what-version-of-libstdc-library-is-installed-on-your-linux-mac
https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html
2023-12-07 17:53:29 +01:00
Somnath
5987d4ef72
Enable superfluous ws.port flag to fix some Hive RPC tests (#8909)
### Context
**Websocket port flag**
Hive tests for RPC suite depend on the (geth) default 8546 port. So,
opening one more listener for this additional port if `ws.port` was
specified. This flag isn't used in Erigon, as it shares port with http
listener. Normally, one may not specify and it offers no other benefit.
2023-12-07 14:59:22 +04:00
Alex Sharov
f3822b17d4
sepolia: auto-gen snaps to 4.7M (#8898) 2023-12-07 08:24:50 +07:00
Alex Sharov
6960ec3d81
up golang/x deps (#8900) 2023-12-06 18:49:52 +00:00
battlmonstr
d78cbfeceb
silkworm: disable on incompatible Linux versions (#8893)
Silkworm built on Ubuntu 22 depends on glibc 2.34. In order to run on an
older OS, Silkworm needs to be built and linked with an older glibc, but
to build on an older OS we need a compatible compiler. Silkworm requires
gcc 11+ that is not available on Ubuntu 20 or Debian 11.

To simplify the deployment disable Silkworm support on versions before
Ubuntu 22, Debian 12, and glibc prior to 2.34. The check for Ubuntu and
Debian is explicit, because some Ubuntu 16 installations report glibc
2.35 with ldd, but `go build` still uses an older system one and fails.
2023-12-06 16:01:44 +01:00
Mark Holt
624e4d4201
Fix snap initialization from frozen blocks (#8908)
This fixes a bug on syncing from scratch if the start point is in a
frozen block.
2023-12-06 14:28:05 +00:00
Giulio rebuffo
0d2aecf829
Backfill only with flag (#8913)
Caplin snapshots only enabled with caplin.backfill
2023-12-06 14:22:13 +01:00
4rgon4ut
8bfff94941
Update gnosis bootnodes (#8907)
Title seems selfdescribing.

Bootnodes list source:

https://github.com/gnosischain/configs/blob/main/mainnet/bootnodes_execution.yaml
2023-12-06 14:20:25 +01:00
Alex Sharov
754276909b
bor snaps: "erigon snapshots retire" to build bor files (#8912) 2023-12-06 12:12:43 +00: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
7335dccc2c
mdbx: print in logs - real limit (#8910) 2023-12-06 15:46:05 +07:00
Alex Sharov
e11e374f8b
estimate: less ram for indexing (#8911) 2023-12-06 09:20:28 +01:00
battlmonstr
96bb5ddb81
silkworm: macOS Intel library (#8891)
61782fa8d0

435dee4642
2023-12-06 11:02:54 +07:00
ddl
edcd7fcd63
update outdated information (#8906)
1. When running locally, found that these **TODO** json-rpc have been
implemented. Updating these outdated information can make the document
clearer.
```
curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_newBlockFilter","params":[],"id":1}' http://loca
lhost:8545
{"jsonrpc":"2.0","id":1,"result":"0x02000000000000009c49b60f431cabc7"}
```
2. [but it's easy to accomplish] Points to an obsolete message
(9b8cdc0f22/eth/downloader/downloader.go (L673))
2023-12-06 09:23:43 +07:00
ddl
f9f36b59e7
chore:TxPoolGossipDisableFlag usage (#8899)
Spotted this typo when follow the help commond
2023-12-05 12:17:17 +01:00
Alex Sharov
9bea4e3a9c
blockReader: read blockNum == r.FrozenBlocks() from files (#8890)
Example value of `r.FrozenBlocks()`: `499999`
In future PR I will rename this method to something like
`MaxBlockNumInFiles()`
2023-12-05 13:59:21 +07:00
ddl
df9b47478c
fix: Example TOML config file parsing error (#8902)
follow  Example TOML config file will cause parsing error
```
erigon git:(devel) ✗ ./build/bin/erigon --config ./config.toml --chain=sepolia
EROR[12-05|12:07:09.029] failed setting config flags from yaml/toml file err="(1, 1): parsing error: keys cannot contain ` character"
(1, 1): parsing error: keys cannot contain ` character
```
after remove ` character works 
```
✗ ./build/bin/erigon --config ./config.toml --chain=sepolia 
INFO[12-05|12:00:17.619] logging to file system                   log dir=data/logs file prefix=erigon log level=info json=false
INFO[12-05|12:00:17.620] Build info                               git_branch=devel git_tag=v2.54.0-91-g47a6ac16d-dirty git_commit=47a6ac16da6de62e589b655bde7936dcdb0eb073
INFO[12-05|12:00:17.620] Starting Erigon on Sepolia testnet... 
INFO[12-05|12:00:17.622] Maximum peer count                       ETH=100 total=100
INFO[12-05|12:00:17.623] starting HTTP APIs                       APIs=eth,debug,net
INFO[12-05|12:00:17.623] torrent verbosity                        level=WRN
INFO[12-05|12:00:19.967] Set global gas cap                       cap=50000000
INFO[12-05|12:00:19.968] [Downloader] Runnning with               ipv6-enabled=true ipv4-enabled=true download.rate=16mb upload.rate=4mb
INFO[12-05|12:00:19.970] Opening Database                         label=chaindata path=/erigon/data/chaindata
INFO[12-05|12:00:19.974] [db] chaindata                           sizeLimit=12TB pageSize=8192
INFO[12-05|12:00:19.975] Re-Opening DB in exclusive mode to apply migrations 
INFO[12-05|12:00:20.025] [db] chaindata                           sizeLimit=12TB pageSize=8192
INFO[12-05|12:00:20.025] Apply migration                          name=db_schema_version5
INFO[12-05|12:00:20.033] Applied migration                        name=db_schema_version5
INFO[12-05|12:00:20.033] Apply migration                          name=txs_begin_end
INFO[12-05|12:00:20.035] Applied migration                        name=txs_begin_end
INFO[12-05|12:00:20.035] Apply migration                          name=txs_v3
INFO[12-05|12:00:20.036] Applied migration                        name=txs_v3
INFO[12-05|12:00:20.036] Updated DB schema to                     version=6.1.0
INFO[12-05|12:00:20.074] [db] chaindata                           sizeLimit=12TB pageSize=8192
INFO[12-05|12:00:20.084] Writing custom genesis block             hash=0x25a5cc106eea7138acab33231d7160d69cb777ee0c2c553fcddf5138993e6dd9
INFO[12-05|12:00:20.085] Initialised chain configuration          config="{ChainID: 11155111, Homestead: 0, DAO: <nil>, Tangerine Whistle: 0, Spurious Dragon: 0, Byzantium: 0, Constantinople: 0, Petersburg: 0, Istanbul: 0, Muir Glacier: 0, Berlin: 0, London: 0, Arrow Glacier: <nil>, Gray Glacier: <nil>, Terminal Total Difficulty: 17000000000000000, Merge Netsplit: 1735371, Shanghai: 1677557088, Cancun: <nil>, Prague: <nil>, Engine: ethash}" genesis=0x25a5cc106eea7138acab33231d7160d69cb777ee0c2c553fcddf5138993e6dd9
INFO[12-05|12:00:20.095] Initialising Ethereum protocol           network=11155111
```
2023-12-05 12:23:15 +07: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
Anıl
1492cc4de1
fixing typos (#8883)
Correction for "Lets assume":

Incorrect: "Lets assume"
Correct: "Let's assume"
Explanation: In this phrase, the word "Lets" is incorrectly written. The
correct form should be "Let's," which is a contraction of "let us."

Correction for the word "tripple":

Incorrect: "tripple"
Correct: "triple"
Explanation: The word "tripple" is misspelled. The correct spelling is
"triple," which refers to something made up of three parts, or
multiplied by three.
2023-12-05 05:59:13 +07:00
ddl
c5f4c761e0
fix: ethdb-doc (#8886) 2023-12-05 05:58:57 +07:00
Andrew Ashikhmin
6a70aaaaf2
params: begin 2.56 release cycle (#8895) 2023-12-04 14:47:11 +01:00
a
3fcb1e6a93
add config files to gitignore (#8894) 2023-12-04 07:40:04 -06: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
Andrew Ashikhmin
fcb9fce5d0
flags: bump default value of db.size.limit to 12TB (#8889)
As per the
[comment](https://github.com/ledgerwatch/erigon/pull/8869#issuecomment-1836645516)
in PR #8869, 8 TB is actually not enough for Polygon.
2023-12-04 11:56:30 +01:00
a
b376d3cabf
allow disable file logging (#8884)
allows the disabling of file logging using the new flag
`--log.dir.disable`



NOTE: diagnostics tool logs WILL NOT function if this is set.
2023-12-04 11:11:11 +07:00
Alex Sharov
2991a6b645
integration: run_migration must not use Accede mode (#8867) 2023-12-02 18:09:53 +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
Mark Holt
85ade6b49a
FIx outstanding know header==nil errors + reduce bor heimdall logging (#8878)
This PR has fixes for a number of instances in the bor heimdall stage
where nil headers are either ignored or inadvertently processed.

It also has a demotion of milestone related logging messages to debug
for missing blocks because the process is not at the head of the chain +
a general reduction in periodic logging to 30 secs rather than 20 to
reduce the log output on long runs.

In addition there is a refactor of persistValidatorSets to perform
validator set initiation in a seperate function. This is intended to
clarify the operation of persistValidatorSets - which is till performing
2 actions, persisting the snapshot and then using it to check the header
against synthesized validator set in the snapshot.
2023-12-01 17:52:50 +00: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
Stéphane Loeuillet
b5640bb64b
Bump GraphQL version + implement blocks (block range) (#8872) 2023-12-01 10:21:16 +01:00
Andrew Ashikhmin
1ae130198e
debug_trace*: root gas should use tx.gasLimit (#8858)
Cherry pick https://github.com/ethereum/go-ethereum/pull/27029

---------

Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Delweng <delweng@gmail.com>
2023-12-01 10:04:32 +01:00
Alex Sharov
b72c37cd37
lint fix: go mod tidy (#8873) 2023-12-01 15:37:18 +07:00
a
98c57e75c0
[caplin] event source server (#8865)
eventsource is required for the validator api. this implements the
eventsource sink/server handler

the implementation is based off of this document:
https://html.spec.whatwg.org/multipage/server-sent-events.html

note that this is a building block for the full eventsource server.
there still needs to be work done

prysm has their own custom solution based off of protobuf/grpc:
https://hackmd.io/@prysmaticlabs/eventstream-api using that would be not
good

existing eventsource implementations for golang are not good for our
situation. options are:

1. https://github.com/r3labs/sse - has most stars - this is the best
contender, since it uses []byte and not string, but it allocates and
copies extra times in the server (because of use of fprintf) and makes
an incorrect assumption about Last-Event-ID needing to be a number (i
can't find this in the specification).
2. https://github.com/antage/eventsource -requires full buffers, copies
many times, does not provide abstraction for headers. relatively
unmaintained
3. https://github.com/donovanhide/eventsource - missing functionality
around sending ids, requires full buffers, etc
4. https://github.com/bernerdschaefer/eventsource - 10 years old,
unmaintained.

additionally, implemetations other than r3labs/sse are very incorrect
because they do not split up the data field correctly when newlines are
sent. (parsers by specification will fail to encode messages sent by
most of these implementations that have newlines, as i understand it).
the implementation by r3labs/sse is also incorrect because it does not
respect \r

finally, all these implementations have very heavy implementation of the
server, which we do not need since we will use fixed sequence ids.
r3labs/sse for instance hijacks the entire handler and ties that to the
server, losing a lot of flexiblity in how we implement our server
 
for the beacon api, we need to stream: 

```head, block, attestation, voluntary_exit, bls_to_execution_change, finalized_checkpoint, chain_reorg, contribution_and_proof, light_client_finality_update, light_client_optimistic_update, payload_attributes```
 
some of these are rather big json payloads, and the ability to simultaneously stream them from io.Readers instead of making a full copy of the payload every time we wish to rebroadcast it will save a lot of heap size for  both resource constrained environments and serving at scale.  

the protocol itself is relatively simple, there are just a few gotchas
2023-11-30 22:21:51 +01:00
battlmonstr
ebdfbd8e54
silkworm: disable on arm64 Linux (#8870)
see
c5729e30cf
2023-11-30 22:49:00 +07:00