Skip to content

Conversation

@yperbasis
Copy link
Member

No description provided.

JkLondon and others added 30 commits August 7, 2025 01:00
cp from 3.1

---------

Co-authored-by: JkLondon <[email protected]>
Co-authored-by: JkLondon <[email protected]>
Co-authored-by: JkLondon <[email protected]>
Follow up #16118. The outer `evm` wasn't used, so it was pointless to
cancel it.
introduces `Spec` type gathering all chain specifications (config,
genesis, hashes, name, dns, bootnodes) into one type accessible directly
and indirectly by chainname. Improves framework of adding new chain
specs for Polygon (and arbitrum)

---------

Co-authored-by: alex <[email protected]>
Based on this draft PR : #15303

---------

Co-authored-by: Mark Holt <[email protected]>
Co-authored-by: antonis19 <[email protected]>
Reverts #15974
due to testing calls to unregistered chains
…16503)

after 26d43d5

`TestMiningBenchmark` started failing consistently during `make
test-all-race`, e.g. run:
https://github.com/erigontech/erigon/actions/runs/16806309189/job/47599533501


upon inspection, it looked like the test was taking 2 mins to re-try
mining loop - check `Start mining based on miner.recommit` below:

<img width="1088" height="140" alt="Screenshot 2025-08-07 at 18 55 22"
src="https://github.com/user-attachments/assets/b3a1cc47-4b4e-47c1-8385-7e2dbeefc173"
/>

this PR fixes this by setting the miner recommit to 3 secs (our default)
also it sets some ports to :0 to let the OS handle these and avoid using
fixed port nums in CI
basically the API was returning null for unset blob schedule and lh was
shitting the bed
Should fix #16274 and #16384.

Should help with #16151.

Also fixes a case where uploading/seeding isn't handled well and caused
very high scheduler overhead. It may have caused gradual performance
decline over time, I noticed it on long-running nodes.

anacrolix/torrent@master...anacrolix

There's a few changes of @AskAlexSharov, I will leave them in.

Fixes excessive piece hashing routines being spawned.

Exposes a few variables that modify webseed HTTP client to help pin down
why OVH is being throttled.

Fixes a case where torrents added from disk can race against be
"required" to proceed past a sync stage. This seemed to cause hashing
errors due to races.

Fix an annoying log message about `"initialized downloads", "torrents":
0` for snapshots added by non-sync services, that just happen to be
adding nothing.

Fix a few invariants that weren't checked correctly in
anacrolix/torrent.

---------

Co-authored-by: alex <[email protected]>
For better troubleshooting it helps to have the full command used + any
flags in the logs. This PR prints the startup command while redacting
potentially sensitive values like HTTP(S), WS(S) urls and IP addresses.

---------

Co-authored-by: antonis19 <[email protected]>
… is done in test-all (#16517)

follow up after recent changes which introduced a new workflow for `Test
All (with -race)`
…16511)

also `seg` to `db` and `commitment` to `execution`

Part of #15713
and also `types/accounts` and `types/witness`

Part of #15713
Also pulls change in anacrolix/torrent to be less pedantic about chunk
size when adding torrents that already exist in the client.

Fixes #16481.

Needs to be cherry-picked to 3.1 after merge.
First part addressing #16448.
#16208 introduced skipping
using the Downloader.Completed RPC. This means "completion" flags that
the Downloader respects are skipped. Until
#15514 those are needed.

This introduces the behaviour suggested by
#16208 (review).

Note that it doesn't *alone* fix
#16448. Another change is
needed to make sure that torrents with verification requested block
Completed too. But there are probably other unexpected behaviours
introduced by shortcutting the function as in
#16208.

After this is main I will cherry pick to 3.1 too (probably combined with
the other PR).
```

## BEFORE

Running tool: /usr/bin/go test -benchmem -run=^$ -bench ^BenchmarkPrecompiledEcrecover$ github.com/erigontech/erigon/core/vm -v

goos: linux
goarch: amd64
pkg: github.com/erigontech/erigon/core/vm
cpu: AMD Ryzen 9 7945HX with Radeon Graphics
BenchmarkPrecompiledEcrecover
BenchmarkPrecompiledEcrecover/CallEcrecoverUnrecoverableKey-Gas=3000
BenchmarkPrecompiledEcrecover/CallEcrecoverUnrecoverableKey-Gas=3000-32         	  405890	      2854 ns/op	      3000 gas/op	      1051 mgas/s	     160 B/op	       2 allocs/op
BenchmarkPrecompiledEcrecover/ValidKey-Gas=3000
BenchmarkPrecompiledEcrecover/ValidKey-Gas=3000-32                              	   44242	     27304 ns/op	      3000 gas/op	       109.9 mgas/s	     224 B/op	       4 allocs/op
BenchmarkPrecompiledEcrecover/InvalidHighV-bits-1-Gas=3000
BenchmarkPrecompiledEcrecover/InvalidHighV-bits-1-Gas=3000-32                   	134827530	         8.896 ns/op	      3000 gas/op	    337227 mgas/s	       0 B/op	       0 allocs/op
BenchmarkPrecompiledEcrecover/InvalidHighV-bits-2-Gas=3000
BenchmarkPrecompiledEcrecover/InvalidHighV-bits-2-Gas=3000-32                   	100000000	        11.82 ns/op	      3000 gas/op	    253796 mgas/s	       0 B/op	       0 allocs/op
BenchmarkPrecompiledEcrecover/InvalidHighV-bits-3-Gas=3000
BenchmarkPrecompiledEcrecover/InvalidHighV-bits-3-Gas=3000-32                   	96497160	        11.92 ns/op	      3000 gas/op	    251703 mgas/s	       0 B/op	       0 allocs/op
BenchmarkPrecompiledEcrecover/ValidKey2-Gas=3000
BenchmarkPrecompiledEcrecover/ValidKey2-Gas=3000-32                             	   46298	     25798 ns/op	      3000 gas/op	       116.3 mgas/s	     224 B/op	       4 allocs/op
PASS
ok  	github.com/erigontech/erigon/core/vm	9.053s


## AFTER

Running tool: /usr/bin/go test -benchmem -run=^$ -bench ^BenchmarkPrecompiledEcrecover$ github.com/erigontech/erigon/core/vm -v

goos: linux
goarch: amd64
pkg: github.com/erigontech/erigon/core/vm
cpu: AMD Ryzen 9 7945HX with Radeon Graphics
BenchmarkPrecompiledEcrecover
BenchmarkPrecompiledEcrecover/CallEcrecoverUnrecoverableKey-Gas=3000
BenchmarkPrecompiledEcrecover/CallEcrecoverUnrecoverableKey-Gas=3000-32         	  399147	      2857 ns/op	      3000 gas/op	      1050 mgas/s	     160 B/op	       2 allocs/op
BenchmarkPrecompiledEcrecover/ValidKey-Gas=3000
BenchmarkPrecompiledEcrecover/ValidKey-Gas=3000-32                              	   43558	     27176 ns/op	      3000 gas/op	       110.4 mgas/s	     224 B/op	       4 allocs/op
BenchmarkPrecompiledEcrecover/InvalidHighV-bits-1-Gas=3000
BenchmarkPrecompiledEcrecover/InvalidHighV-bits-1-Gas=3000-32                   	131973532	         9.016 ns/op	      3000 gas/op	    332745 mgas/s	       0 B/op	       0 allocs/op
BenchmarkPrecompiledEcrecover/InvalidHighV-bits-2-Gas=3000
BenchmarkPrecompiledEcrecover/InvalidHighV-bits-2-Gas=3000-32                   	120312512	         9.970 ns/op	      3000 gas/op	    300899 mgas/s	       0 B/op	       0 allocs/op
BenchmarkPrecompiledEcrecover/InvalidHighV-bits-3-Gas=3000
BenchmarkPrecompiledEcrecover/InvalidHighV-bits-3-Gas=3000-32                   	120357236	         9.974 ns/op	      3000 gas/op	    300766 mgas/s	       0 B/op	       0 allocs/op
BenchmarkPrecompiledEcrecover/ValidKey2-Gas=3000
BenchmarkPrecompiledEcrecover/ValidKey2-Gas=3000-32                             	   45979	     26090 ns/op	      3000 gas/op	       115.0 mgas/s	     224 B/op	       4 allocs/op
PASS
ok  	github.com/erigontech/erigon/core/vm	11.094s


```

---------

Co-authored-by: Paweł Bylica <[email protected]>
…options handling (#16505)

closes #14283

adds tests in `pool_test.go` for:
- pool cleanup - verify both encrypted and decrypted txn pools get
cleaned up
- blob txns are skipped from shutter pool - if accidentally ending up in
the txn pool (matches nethermind)
- pool taking into account WithGasTarget and WithTxnIdsFilter options
for ProvideTxns

fixes for discovered issues:
- we weren't updating the cleanup metrics for the encrypted txn pool
(made it look like the pool isn't getting cleaned up and leaking mem)
- found a bug in `EncryptedTxnSubmissionLess` which is used to traverse
the submissions tree
- we weren't calling `txnParseCtx.ParseTransaction` with correct input
for `hasEnvelope`
- we weren't taking into account gas target and txn ids filter options
- we had incorrect logic for signing blob txns (there were no usages for
it across the codebase before these new tests were added)
- added a error log in case the pool unexpectedly stopped due to some
err and ProvideTxns was called - makes it much easier to see that the
background goroutines are no longer operational
- simplified logic for MaxDecryptionKeysDelay (better protection for
very long waits for unexpected future slot inputs)
- fixes an issue that caused our validators to crash a month ago: 
```
[EROR] [07-08|16:59:33.000] background component error               err="decryption keys processor issue: decryption keys processing loop: unexpected item txn index lt next txn index: 38275 < 38276"
```

note: im making use of experimental (go1.24)
[synctest](https://go.dev/blog/synctest) - it will be added as stable in
go1.25
I had started a clarification of Alex's numbered upgrade process. Not
sure where the other stuff I replaced got in.

Also add a note on torrent logging and how to reset snapshots.

Co-authored-by: Alex Sharov <[email protected]>
canepat and others added 27 commits August 27, 2025 07:49
moved `salt` out of config objects 
and `dirs` too (not compile-time-known field)
genesis write and state root calc: 
- it's high-level rare-used logic: mostly `backend.go` calling it
- but it's very complex (high-level): creating temporary db, calculating
state root, etc...
- moving it out of `core` package. because `core` package is low-level 
- also I moved `ReadChainConfig`/`WriteChainConfig` from `core` to
`rawdb` package

(In next PR I planing add blockFiles to `temporal.DB` - so, it will
manage open/close transactions on this files too - same as currently it
does for state files)
Unfortunately it was not used anywhere in files production/release
process. last commits are from 2023. so, removing.
move more things to `statecfg` package:
- Schema
- DomainCfg/IICfg
- RegisterDomain calls
- AddDependencyBtwnDomains calls 
- versions 


about `statecfg` package: all our components have separated cfg package
- `txpoolcfg`, `downloadercfg`, `rpccfg`. Because configs: are low-level
concept and passing everywhere around APP. Usually such `cfg` packages
don't depend on anything big - and have basic types config-types,
Default values for configs, constants, etc... Usually `cfg` are known at
comp-time (or at least at `init`).

`db/kv` aslo as `cfg`-style package - it has configs (`tables.go`) and
interfaces.
fixes #16852

checking the `blackListForPruning` was accidentally removed in
#16648

diff of Downloader.Add logs (before/after fix):
https://www.diffchecker.com/MoE9EsyG/
up `mock`, `grpc`, `goja` (same as geth)
@yperbasis what do you think? 
it's `discv4` observer of p2p network to gather statistic and topology. 
no updates since 2023 and no unit-tests.
Change the channel to a buffered channel with capacity 1. This ensures
that the goroutine can always complete the send, even if the caller has
already returned due to context cancellation. The response will simply
sit in the channel until it is garbage collected, avoiding the leak.
…16823)

Switch boundary check from txNum > max to txNum < _min to correctly
detect transitions between blocks during descending iteration over
history index. This ensures per-block Min/Max are recomputed when
crossing into an older block, making the “no system txs” check reliable
across the full scan.
@yperbasis yperbasis changed the title [DO NOT SQUASH MERGE] merge main@c3ca884 to arb0 [DO NOT SQUASH MERGE] merge main@35c7c26 to arb0 Aug 28, 2025
@yperbasis
Copy link
Member Author

Superseded by PR #17648

@yperbasis yperbasis closed this Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.