Release notes
Major highlights
State Design Upgrade - HalfPath
This version introduces a new approach to the State database - HalfPath. It replaces the previous approach which for a purpose of these notes we will call “Hash”.
The goal of HalfPath is to improve performance of the existing database without major codebase changes. It is a middleware between Hash design and a full Path-based design (on which we are currently working on). It is mostly aimed for validators performance (observed major effectiveness improvement) and as a side effect improve archive nodes sync.
Major achievements:
- Block Processing time faster by about 30-50% (depends on hardware setup but observed that it gives more improvement on weaker setups so cost of hosting node using Nethermind software can be decreased).
- State Database size smaller by about 25% (previous approach is now close to 200GB while HalfPath is around 150GB). This is only for StateDB - Entire Database will decrease by this 50GB but will still hover around 900GB after SnapSync.
- State Database growth is significantly reduced - the slower database is growing, the smaller amount of maintenance around node is needed.
We are still observing the exact numbers and applying some optimizations to make it as close as possible to “Live pruning” but database should grow about 10-20 times slower (to see the full effect of that it may need 1 or 2 weeks - growth ratio will be dropping after that time). - Archive Node sync faster - as HalfPath is not meant to be the optimization for Archive nodes we observe that it is faster than previous implementation (8mln blocks processed about 30-40% faster and gap was only increasing - more tests around that are to be conducted).
- Archive Node Database size smaller - as above HalfPath major goal wasn’t to make archive node smaller but what was observed is (2.4TB vs 1.7TB at 8mln blocks checkpoint - and gap was getting bigger - we are checking now the final numbers).
Decisions made by the team to make a transition to HalfPath as smooth as possible:
- All newly synced nodes will use a HalfPath as default state design. If for any reason node operator would like to use previous approach there is a option to specify a flag
Init.StateDbKeyScheme=Hash
. - All existing nodes which are synced with old Hash approach will remain on it (so will not get advantage of HalfPath).
Migration to HalfPath can be done in two ways:
- Full Resync - This is the simplest yet the most effective way to migrate. As Nethermind syncs very fast back to the head it may take just 1-2 hours to be back on track.
- Full Pruning migration - There is an option to migrate while staying online using the Full pruning functionality. The downside of that approach is that pruning will take much longer to finish and users to be able to prune with it will need to restart their nodes with flag
Init.StateDbKeyScheme=HalfPath
- without it pruning will behave as before so will recreate state with previous DB approach. User should increase the default full pruning memory budget to at least 8GB (—Pruning.FullPruningMemoryBudgetMb 8000
) to reduce slowdown.
Upgrading from previous version to 1.26.0 will result with:
- Upgrade from 1.25.4 → Node will remain on previous Hash design. To migrate to HalfPath please refer to Migration guide above. If node operator does not want to migrate, it is completely fine staying on Hash design as it will be still fully supported.
- Upgrade from 1.26.0-exp.3 → Node will remain on HalfPath design. No resync is needed between 1.26.0 experimental and current version - all optimizations and bugfixes should be automatically applied.
Learn more
More details about HalfPath and other state redesigns which we are still exploring can be found in this [Medium blogpost](https://medium.com/nethermind-eth/nethermind-client-3-experimental-approaches-to-state-database-change-8498e3d89771).
Also please refer to this [Pull Request](#6331) which contains all of the changes around HalfPath and more in-depth details about specific performance metrics.
Snap Serving
We're excited to share that Nethermind now supports Snap Sync, a capability previously unique to Geth. This is a big step for Ethereum's ecosystem, offering redundancy and easing the considerable responsibility Geth has held in maintaining network health.
This achievement doesn't diminish Geth's critical role but reinforces our shared goal of a resilient Ethereum. We see this as an opportunity to distribute the workload, ensuring the network's strength through diversity.
The feature was previously present, but it required a change to the database layout for efficient performance.
Nodes running on old Hash approach will not have a SnapServing enabled by default. Performance of SnapServing is very bad on this design and may overall performance of a node.
If for any reason node operator wants to enable it on Hash db, there is a flag Sync.SnapServingEnabled=true
which will make it possible but is not advised.
Important
During snap serving for other nodes in network overall performance of node may be slightly worse. Please reach to the team on Discord with all observations out there so more optimizations around it can be discovered and applied - at the same time it is advised to keep it enabled to keep the network more healthy.
Changelog
New features
- Perf/HalfPath state db key by @asdacap in #6331
- Feature/snapsync server by @asdacap in #6722
- Feature/debug get bad blocks by @kjazgar in #3838
- Add eth_blobGasPrice/eth_gasPrices; update eth_feeHistory by @flcl42 in #6563
- Add engine_getClientVersionV1 API support by @rjnrohit in #6814
- Introduce chiseled Docker image by @rubo in #6467
- Feat/native 4byte tracer by @natebeauregard in #6864
Optimism
Performance
- Speed up trie node traversal by @benaadams in #6436
- Return to NoGCRegion now runtime bug is fixed by @benaadams in #6381
- Reduce allocations of Gossip filter closures by @benaadams in #6495
- Optimize Jump Destination Analysis by @benaadams in #6502
- Reduce allocations in StorageRangesMessageSerializer by @benaadams in #6534
- Propagate pooled arrays to RlpStream by @benaadams in #6536
- Further Improve JumpDestAnalysis (x20 improvement) by @benaadams in #6554
- Avoid boxing in AccessLists by @benaadams in #6578
- Trie RlpStreams as structs by @benaadams in #6584
- Hunting allocations by @LukaszRozmej in #6601
- Hunting allocations 2 by @LukaszRozmej in #6604
- Hunting allocations 3 - introduce AccountStruct by @LukaszRozmej in #6605
- Exclude Tx Hashes when serving Blocks & apply network back pressure by @benaadams in #6636
- Allow retrieving memory traces that are unconstrained in size by @guidovranken in #6649
- Perf/fetch blockheader from peer on FCU if block so that it start beacon header sync. by @asdacap in #6650
- Perf/background task scheduler by @asdacap in #6655
- Improved single byte Rlp.DecodeByteArray by @benaadams in #6711
- Optimize RLP length calculation by @PaulusParssinen in #6729
- Faster Json RPC Dispatch by @benaadams in #6746
- Leaf value collector by @asdacap in #6795
- Perf/dont redownload downloaded code by @asdacap in #6873
Bug fixes and stability
- Fix/flush on snap finish by @asdacap in #6444
- Handling exceptions during signatures recovery by @MarekM25 in #6461
- Changed post-merge condition in MultiSyncModeSelector by @MarekM25 in #6433
- Parse BlockParameter correctly for eth_call by @benaadams in #6477
- fix byte length calculation by @tanishqjasoria in #6474
- Fix error on producing a block with multiple transaction for the same contract with block improvement by @asdacap in #6487
- Aligned GetRaw* endpoint with spec by @Demuirgos in #6494
- Increase Trie robustness for multi-readers by @benaadams in #6580
- Disconnect timed out connects by @benaadams in #6594
- fix ParityTraceActionConverter to output init on create by @LukaszRozmej in #6606
- Return BlockForRpc from debug_getBadBlocks by @flcl42 in #6612
- Fix TraceStore plugin by @LukaszRozmej in #6609
- Fix/disconnect p2p message by @ak88 in #6631
- Fix block processing hang after OldReceipts by @asdacap in #6637
- Cleanup rocksdb config and metrics by @asdacap in #6642
- Fix pruning missed nodes without caching db. by @asdacap in #6585
- Self-recovery of TxPool max capacity by @marcindsobczak in #6665
- Fix ShaMerkleTree for multithreaded access by @benaadams in #6687
- Failures > 4 for ping message alerts by @benaadams in #6704
- Update txPool worst value if removal unsuccessful by @benaadams in #6702
- Calculate Tx Hash if fast path not available by @benaadams in #6750
- Estimate when balance matches tx value too by @flcl42 in #6748
- Update rocksdb with the loading order fix by @flcl42 in #6735
- TxPool autorecover by @MarekM25 in #6789
- Bugfix/request receipts by @flcl42 in #6413
- Fix negative gas cost in debug_traceTransaction traces by @natebeauregard in #6831
- Fix/estimate gas #6390 by @ak88 in #6846
- Fix rpc module not returned on arbitrary error by @asdacap in #6842
Other changes
- Pass
readonly struct
BlockExecutionContext
viain
by @benaadams in #6469 - Json rpc more flexible string parameter parsing by @benaadams in #6486
- Fixing few typos in src/Nethermind by @fakefraud in #6508
- Do not throw IOException when file is already downloaded by @Arimionim in #6346
- Feature: Exposing Prometheus metrics to user-defined interface by @tgerring in #6528
- Update [README.md](http://readme.md/) by @oxbau in #6384
- Refactor TxReceipt to be extendable by plugins by @deffrian in #6463
- Enable Ansi color sequences for Cmd by @benaadams in #6615
- Fix typos by @vuittont60 in #6628
- Fix broken link to docs by @krauspt in #6681
- Make everything properly use ReceiptsConfig.StoreReceipts instead of … by @LukaszRozmej in #6776
- Revise validation errors by @ak88 in #6804
- Cleanup/remove effect of memory hint to write buffer and adjust some db parameters by @asdacap in #6767
- Deprecate FastBlock Flag by @obasekiosa in #6792
- Allow configuring last state to be kept by @asdacap in #6809
- Features/unified p2p message metrics by @asdacap in #6835
- Check for multiple cli arguments by @LukaszRozmej in #6861
New Contributors
- @fakefraud made their first contribution in #6508
- @Arimionim made their first contribution in #6346
- @tgerring made their first contribution in #6528
- @oxbau made their first contribution in #6384
- @vuittont60 made their first contribution in #6628
- @guidovranken made their first contribution in #6649
- @krauspt made their first contribution in #6681
- @PaulusParssinen made their first contribution in #6729
- @rjnrohit made their first contribution in #6814
- @obasekiosa made their first contribution in #6792
- @natebeauregard made their first contribution in #6831
Full Changelog: 1.25.4...1.26.0-exp.4