Commit Graph

20728 Commits

Author SHA1 Message Date
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
Andrew Ashikhmin
333e0e5666
flags: bump default value of db.size.limit to 8TB (#8869)
3TB is not enough for Polygon
2023-11-30 21:08:26 +07:00
battlmonstr
bc0b727fc0
silkworm: use silkworm-go bindings (#8829) 2023-11-30 12:45:02 +01: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
5ff9ce802b
prnt_stages: to show value of --snapshots flag (#8862) 2023-11-30 16:16:53 +07:00
Guido Vranken
015f6eb4c5
Call Tracer.CaptureState before memory expansion (#8860)
This aligns the tracing behavior with Geth, Besu and Nimbus.
2023-11-30 11:33:11 +07:00
Anshal Shukla
8d1758ceea
Add support for amoy testnet (#8674)
Co-authored-by: Mark Holt <mark@distributed.vision>
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
2023-11-30 08:19:52 +07:00
Alex Sharov
473e0414ef
estimate: at-lest 1 worker (#8859) 2023-11-29 16:29:15 +00:00
Alex Sharov
2e0f9b0411
"erigon snapshots diff": setup logger (#8834) 2023-11-29 16:27:58 +00:00
Alex Sharov
427f2637d2
mdbx: hard-limit of small db's dirty_space (#8850)
it didn't cause problems yet. but it seems a good idea in-general.
2023-11-29 15:09:55 +01:00
kaliubuntu0206
e91dc9f1bf
Update mingw cmake version for windows (#8856)
From comment
https://github.com/ledgerwatch/erigon/issues/8623#issuecomment-1831473288
2023-11-29 19:10:49 +07:00
a
71d7e2c957
fix (#8852)
- dont return nil for config :)
2023-11-29 12:18:38 +07:00
a
a2673c62c5
[caplin/sentinel] config reorganizations (#8844) 2023-11-28 22:45:58 -06:00
Alex Sharov
3e8a028cbb
evm: remove interpreter interface - step3 (#8842) 2023-11-29 09:29:16 +07:00
Dmytro
a63b89334b
added logging for slow RPC requests (#8818)
Changed distribution of httpcfg.HttpCfg to be pointer.
Added new flags:
rpc.slow.log - which is false by default, this flag need to enable
logging slow RPC requests
rpc.slow.log.threshold - which is 100 by default, this flag specify slow
threshold in milliseconds
Updated rpc handler to log slow requests:
- added map[request id] {method, timestamp}
- put every request details to map above
- delete request details from map above
- added time interval check for elements in map and if time difference
is more than given threshold print request id and the method
- app will print slow requests in next cases:
1. As soon as request take more than given threshold
2. Every 20 seconds if request still in process
3. After request finished and it took more than give threshold

---------

Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
2023-11-28 16:11:39 +07:00
Alex Sharov
8cfafa446a
add command "downloader torrent_cat" (#8824) 2023-11-27 08:49:19 +07:00
Alex Sharov
fd6f529c73
devnet: prevent tx-leak on panic (#8803) 2023-11-25 09:12:55 +07:00
Alex Sharov
9cfed88082
integration run_migrations: open in non-accede exclusive mode - to create new tables (#8821)
sometimes need tool to apply migrations - without starting erigon (if
erigon is buggy, or to prevent snapshots downloading, etc...)
2023-11-25 09:12:44 +07:00
milen
9b74cf0384
metrics: use prometheus histogram and summary interfaces (#8808) 2023-11-24 17:50:57 +00:00
milen
230b013096
metrics: separate usage of prometheus counter and gauge interfaces (#8793) 2023-11-24 16:15:12 +01: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
Alex Sharov
3db9467c94
increase peer tasks queue size (#8825)
Current value: 16 was added by me 1 year ago and didn't mean anything.
Never seen this field holding much data, probably can increase.

Currently I see logs like (and 10x like this): 
[DBUG] [11-24|06:59:38.353] slow peer or too many requests, dropping its old requests name=erigon/v2.54.0-aeec5...
2023-11-24 12:42:08 +01:00
Pratik Patil
59909a7efe
Added TxDependency Metadata to ExtraData in Block Header in Bor for Block-STM (#8037)
This PR adds support to store the transaction dependency (generated by
the block producer) in the block header for bor. This transaction
dependency will then be used by the parallel processor
([Block-STM](https://github.com/ledgerwatch/erigon/pull/7812/)).

I have created another
[PR](https://github.com/ledgerwatch/erigon-lib/pull/1064) in the
erigon-lib repo which adds the `IsParallelUniverse()` function.
2023-11-24 10:26:33 +00:00
milen
28fff1b35e
metrics: remove VictoriaMetrics/metrics lib (#8766)
# Background

Erigon currently uses a combination of Victoria Metrics and Prometheus
client for providing metrics.

We want to rationalize this and use only the Prometheus client library,
but we want to maintain the simplified Victoria Metrics methods for
constructing metrics.

This task is currently partly complete and needs to be finished to a
stage where we can remove the Victoria Metrics module from the Erigon
code base.

# Summary of changes

- Remove `UsePrometheusClient` boolean flag
- Remove `VictoriaMetrics` client lib and related code (simplifies
registry and prometheus http handler initialisation since now we have
only 1 registry and can use default `promhttp.Handler`)
2023-11-23 20:31:38 +00:00
Alex Sharov
fdc75df6b5
Bor: increase client timeout from 5 to 10sec (to cover remote server case) (#8801)
I using `https://heimdall-api-testnet.polygon.technology/` and seems
5sec timeout is not enough sometime - even that remote service working
well (node syncing well)

most of timeouts comes from same endpoint: 
```
 [bor.heimdall] request canceled          reason="context deadline exceeded" path=/milestone/lastNoAck attempt=2
```
2023-11-23 16:32:30 +00:00
Alex Sharov
34b9a70b02
bor: add more context to error - to understand where it happened (#8811) 2023-11-23 16:31:45 +00:00
ledgerwatch
19451ac610
Return difficulty check into bor header validation (#8815) 2023-11-23 16:30:58 +00:00
Alex Sharov
23f23bc971
disable disc tests on Mac (#8822)
TestUDPv4_smallNetConvergence tests are often timeout on mac - disabling
this tests on mac CI
2023-11-23 16:00:42 +07:00
Alex Sharov
55e05c440f
--txpool.gossip.disable (#8800)
Co-authored-by: cby3149 <cby3149@gmail.com>
2023-11-23 12:00:41 +07:00
Alex Sharov
e390b0e182
ots: stop at ctx.Done() (#8790) 2023-11-23 08:49:33 +07: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
Alex Sharov
30c05cc7a9
cl: disable spec-integration CI on mac - until flaky test fix (#8812)
See Issue #8789
2023-11-22 12:13:30 +01:00
Alex Sharov
43b8cbbdeb
bor: don't hide ctx.Err() (#8792)
log `ctx.Err()` - it can be canceled by many reasons: timeout, etc...
2023-11-22 09:27:50 +07: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
battlmonstr
4abe1d59d8
silkworm: internal refactorings (#8675) 2023-11-21 15:22:56 +01:00
Dario Gagliano
0aa06af226
Add benchOtsGetBlockTransactions (#8672) 2023-11-21 15:53:10 +07:00
milen
aa55d9534a
temp fix for erigon-ext-test (#8797)
Fixes
https://github.com/ledgerwatch/erigon/actions/runs/6930037092/job/18850944152
2023-11-21 09:31:03 +07:00