Commit Graph

207 Commits

Author SHA1 Message Date
Shane Bammel
93c50d59a5 Allow for increased Shanghai time with PulseChain 2024-02-14 13:10:46 -06:00
Shane Bammel
43ef4304ee Add network config for Testnet-V4 2024-02-14 13:10:46 -06:00
Shane Bammel
4ea8213c42 Add v3 suffix to pulsechain-testnet 2024-02-14 13:10:46 -06:00
bretep
ed87d4b665 Switch testnet snapshots to PulseChain from Mainnet 2024-02-14 13:10:46 -06:00
Shane Bammel
bbe15afcde Add pulsechain-devnet poc config 2024-02-14 13:10:45 -06:00
Shane Bammel
75db06fa1d Add support for PulseChain
Thanks @bretep for the original integration.
2024-02-14 13:10:45 -06:00
Andrew Ashikhmin
ffb6b83c09
(release) RpcDaemon doesn't see recently retired blocks (#9336)
Cherry pick PR #9318

---------

Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
2024-01-29 13:49:47 +01:00
Andrew Ashikhmin
9f1cd651f0
(release) txpool: fix initial blockGasLimit and setBlobFee() (#9303)
Cherry pick PR #9301
2024-01-24 13:33:28 +01:00
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
battlmonstr
1914b52de0
mdbx: race conditions in MdbxKV.Close (#8409) (#9244)
In the previous code WaitGroup db.wg.Add(), Wait() and db.closed were
not treated in sync. In particular, it was theoretically possible to
first check closed, then set closed and Wait, and then call wg.Add()
while waiting (leading to WaitGroup panic).
In theory it was also possible that db.env.BeginTxn() is called on a
closed or nil db.env, because db.wg.Add() was called only after BeginTxn
(db.wg.Wait() could already return).

WaitGroup is replaced with a Cond variable.
Now it is not possible to increase the active transactions count on a
closed database. It is also not possible to call BeginTxn on a closed
database.
2024-01-17 15:28:37 +01:00
Somnath
5e5d8490b1
Move blob cache check in txpool (#9250)
This should help with less frequent lock/unlock. Following from an
earlier "TODO"
2024-01-17 17:46:02 +04:00
Andrew Ashikhmin
b38e17e393
Implement PIP-33: Napoli Hardfork (#8975)
Initial support of the upcoming Napoli hard fork on Polygon – see
[PIP-33](https://forum.polygon.technology/t/pip-33-napoli-upgrade). Per
[PIP-31](https://github.com/maticnetwork/Polygon-Improvement-Proposals/blob/main/PIPs/PIP-31.md),
it parallels the
[Cancun](https://github.com/ethereum/execution-specs/blob/master/network-upgrades/mainnet-upgrades/cancun.md)
upgrade of Ethereum, but does not include
[EIP-4788](https://eips.ethereum.org/EIPS/eip-4788),
[EIP-4844](https://eips.ethereum.org/EIPS/eip-4844),
[EIP-7516](https://eips.ethereum.org/EIPS/eip-7516). In other words,
Napoli includes [EIP-1153](https://eips.ethereum.org/EIPS/eip-1153),
[EIP-5656](https://eips.ethereum.org/EIPS/eip-5656),
[EIP-6780](https://eips.ethereum.org/EIPS/eip-6780) from Cancun.

This PR implements
[PIP-31](https://github.com/maticnetwork/Polygon-Improvement-Proposals/blob/main/PIPs/PIP-31.md),
[PIP-16: Transaction Dependency
Data](https://github.com/maticnetwork/Polygon-Improvement-Proposals/blob/main/PIPs/PIP-16.md)
(by merging `ParallelUniverseBlock` into `NapoliBlock`; the bulk of
PIP-16 was implemented in PR #8037), and [PIP-27: Precompiled for
secp256r1 Curve
Support](https://github.com/maticnetwork/Polygon-Improvement-Proposals/blob/main/PIPs/PIP-27.md)
([EIP-7212](https://eips.ethereum.org/EIPS/eip-7212); see also
https://github.com/maticnetwork/bor/pull/1069 &
https://github.com/ethereum/go-ethereum/pull/27540).

---------

Co-authored-by: Anshal Shukla <shukla.anshal85@gmail.com>
2024-01-17 14:13:16 +01:00
Alex Sharov
26ce6aa88b
return 1 lost mainnet file (#9242) 2024-01-17 14:21:51 +07: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
d8b91c4d02
Fix startup sync for txpool processing for bor block production (#9219)
When the sync loop first runs it suppresses block sync events both in
the initial loop and when the blocks being processed are greater than
1000.

This fix removed the first check, because otherwise the first block
received by the process ends up not getting sent to the tx pool. Which
means it won't produce new block for polygon.

As well as this fix - I have also moved the gas initialization to the
txpool start method rather than prompting it with a 'synthetic block
event'

As the txpool start has access to the core & tx DB's it can find the
current block and chain config internally so that it doesn't need to be
externally activated it can just do this itself on start up. This has
the advantage of making the txpool more self contained.
2024-01-13 10:33:34 +00:00
ddl
db1dcbb9d7
refactor(erigon-lib/metrics): replace strings.IndexByte with strings.Cut (#9202)
above go1.18  Index calls are more clearly written using Cut.
https://github.com/golang/go/issues/46336
2024-01-12 13:07:49 +00:00
Alex Sharov
e806db977f
mdbx: reduce 2 times hard dplimit (#9216)
can do it, because we don't do read-after-write in same rwtx
2024-01-12 11:27:18 +01:00
Alex Sharov
3bb1917e8a
recsplit: reduce ram pressure (#9218)
reasons: 
- indexing done in background (or in many workers)
- `recsplit` has 2 etl collectors
2024-01-12 11:26:20 +01:00
Mark Holt
7308e87c0e
Fix txpool queue overflow (#9197)
When discarding spamming we need to remove the tx from the subpools as
well as the sender tx list. Otherwise the tx is ignored by other
operations and left in the subpool

As well as the fix here this PR also contains several changes to TX
TRACING and other logging to make it easier to see what is going on with
pool processing
2024-01-11 10:03:41 +00:00
Alex Sharov
1ee439e6ac
mdbx: dplimit - support cgroups/gomelimit, avoid using SetOptions after env.Open() (#9189) 2024-01-11 08:06:35 +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
milen
95109d9800
erigon-lib: cleanup unnnecessary import in tools.go added in prev PR (#9190) 2024-01-10 19:16:25 +07:00
Alex Sharov
ceeb090f48
mdbx: hard dirtyPages limit (#9178)
logic: 1/42 of ram, but not more than 2Gb for chandata and not more than
256mb for other databases.

---------

Co-authored-by: battlmonstr <battlmonstr@users.noreply.github.com>
2024-01-10 15:15:27 +07:00
milen
e25b15b00e
remotedbserver: add support for bor snapshots (#9180) 2024-01-09 14:48:01 +00:00
ledgerwatch
459ccf8de4
[E3] Some fixes for the in-memory database when working with Caplin (… (#9164)
…testing on Sepolia) (#9151)

---------

Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2024-01-09 08:26:26 +07:00
Dmytro
ff92b701c3
dvovk/updsync (#9134)
refactored data structure for sync statistics
2024-01-08 10:43:04 +01:00
Alex Sharov
7490e7dd63
up x and cli deps (#9154) 2024-01-08 16:01:36 +07:00
Alex Sharov
2cbe8b7fe7
downloader: --verify --verify.files --verify.failfast support (#9156) 2024-01-08 16:01:02 +07:00
a
235af8a321
glob filter (#9148) 2024-01-07 12:03:17 -06:00
battlmonstr
b57cbdcff7
polygon/sync: canonical chain builder (#9117) 2024-01-04 10:44:57 +01:00
Dmytro
777f5dcd61
added collection for log prefix (#9118) 2024-01-03 08:13:56 +07:00
Giulio rebuffo
415b17ca85
Updated erigon-snapshots (#9111) 2024-01-02 09:23:16 +07:00
Giulio rebuffo
a959387aae
Make caplin sync snapshots (all of them) (#9106) 2024-01-01 08:18:56 +07:00
Giulio rebuffo
580c55517f
Make caplin snapshots downloadable (only sepolia) (#9105) 2023-12-31 13:22:41 +01:00
Mark Holt
19bc328a07
Added db loggers to all db callers and fixed flag settings (#9099)
Mdbx now takes a logger - but this has not been pushed to all callers -
meaning it had an invalid logger

This fixes the log propagation.

It also fixed a start-up issue for http.enabled and txpool.disable
created by a previous merge
2023-12-31 17:10:08 +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
a
78bb3cdca8
[caplin] topic strings (#9000) 2023-12-30 16:55:01 +01:00
a
510d62ab8a
[caplin] sse handler placeholder (#9082) 2023-12-30 15:49:45 +01:00
milen
1f237c0aaf
borheimdall: only fetch next span when in last sprint of current span (#9096)
Heimdall prepares the next span a number of sprints before the current
span ends. Currently we always fetch the next span regardless of which
sprint we are in during the current span. This causes a liveness issue
due to how the Heimdall client works (it infinitely retries until it
fetches a span - this issue will be fixed in a separate PR). This PR
fixes this by matching what bor does - it fetches the next span only in
the last sprint of the current span.

Changes:

- Adds a unit test for the above
- Adds a new function BlockInLastSprintOfSpan
- Some code reorg and cleanup - moves the span num related functions
from the bor package to the span sub package for better logical grouping
2023-12-28 15:52:49 +00:00
ledgerwatch
ab27531fa7
Introduce new public buckets for the snapshots (#9094)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-12-28 12:39:25 +00:00
Giulio rebuffo
698ee60339
Beacon API: Added attestation rewards endpoint. (#9091) 2023-12-28 13:07:53 +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
a48db431cb
return deleted caplin-v2 webseed (#9083) 2023-12-26 18:55:17 +07:00
Alex Sharov
0d31444eea
bor mainnet 51m (#9073) 2023-12-25 11:24:14 +07:00
Alex Sharov
bc50bd50a4
make 500K files also seedable (because they actually are) (#9077) 2023-12-25 10:07:31 +07:00
Alex Sharov
2944abbd19
fix typo in snap webseed server names (#9072) 2023-12-24 16:37:13 +07: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
2b87d65285
retire: handle case when bor snaps are behind block snaps (#9061) 2023-12-23 16:37:30 +07:00
ledgerwatch
ec970ac6bc
Fixed duplicate bucket names, remove presigned URLs (#9060)
Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
2023-12-23 04:11:12 +00:00
Dmytro
a36071e7ff
dvovk/snapidx (#9049) 2023-12-22 11:25:55 +00:00