Skip to content

Commit 463efb3

Browse files
Marchhillqu0bfselmobenaadamsaso20455
authored
Implement Block-level access lists (EIP-7928) (#10357)
* check for null traced access worldstate * fix hash calc * disable in chainspec params test * bal snapshot fix * fix hash match check * remove comments * null hash for empty access lsit * amsterdam fork * add bal to block & header decoder, store encoded bal in block, update blockchain test runners * string encoding * fix decoding * improve encoding test * fix encoding, add tests * refactor bal encoding test * code changes test * don't use hash of storage index * don't add redundant reads * add new fields to blockchain tests * tidy code * add blockchain engine test support * tidy test base * fix engine test loading, different versions * only set hash if bals enabled * fix loading older engine tests * fix BAL decoding in execution payload * formatting * fix normal blockchain tests * set to empty block access list hash if not enabled * move to newpayloadv5 * trace get account balance * codehash * create account & selfdestruct edge cases * try only setting null hash when enabled * undo * try only setting null hash when enabled * undo * set genesis bal hash in chainspec loader * always set bal hash * add to chainspecbasedprovider * set to empty hash if genesis * don't record balance change for unchanged balance change in account * check enabled for traced access world state * precompile handling * don't add empty bal hash to genesis when disabled * add 7702 authority on failed delegation * engine rpc amsterdam * comment logs * fix 7702 failed delgation edge case * fix blockchain test runner * allow null BAL in execution payload * amsterdam chainspec * encode BAL in payload if not already encoded * package lock * disable warning temporarily * fix block building * add encoding and decoding logs tmp * improve logs for degbugging * fix bal index for building & decoding index 0 * reset block access index * try to fix invalid hash, add logs * remove log * log encoding balance changes * try fix ushort decoding, save encoded bal * try fix account changes in wrong order error * coinbase zero transfer edge case * code change max increase * enforce rlp buffer size limits * fix test runners * fix restore * fix reverting storage change * add account read for extcodecopy * don't add for extcodecopy when oog * fix engine test runner * refactor test runner * don't record storage change if resets to same value * remove storage changes if empty * fix storage changes * only add read if write not present * fix error message * add changes when resetting to og value * change comparison, add logging * more logging * even more logging * use sequenceequal * check for previous code deployed being the same * record more account accesses * extcodesize * fix tracing * remove console logs * remove coinbase edge case * bpo forks * base fee update fractions * add bpos to spec name parser * change blockchain tests * fix setnonce tracing * add storage slot to changes in edge case * generatedblockaccesslist for debugging * add testing log for decoding * try adding sequence length in block encoding * try block decoding fix * try fix bal json serialisation * refactor * debug assert fail for unreachable codde * remove code change diff check * string encoding use json * fix: check count empty when checking if storage changed * fix merge * fix json serialisation * fix suggested & generated * fix check code change * blockchain test blob schedule load * nonce change on account creation * debugging logs for blob schedule * fix compile * more logs * try basing amsterdam on osaka * undo change * print HIVE vars * new blobschedule log * override to 6/9 * check of code has changed during tx * include system address balance change * fix adding back storage read, handling of system account * undo bpo override * move delegation check later call * remove extra logs * set balance to 0 on selfdestruct * copy generatedbal to suggested block * Fix cross-block state leak of `_parityTouchBugAccount.ShouldDelete` flag in VirtualMachine (#9856) reset parity touch bug shouldDelete * codecopy fix * move generatedBAL to top level * getter for generatedBAL * change storage keys and values to UInt256 * fix conversion to uint256 * delay charge create gas call * add slot changes if not present on restore * tidy * OOG if not enough gas for self-destruct (#10064) OOG if not enough for selfdestruct * remove bal from block body * bal store * add engine api endpoints * add new handlers * fix DI * add debug endpoitn * make shareable * change attributes * getbal test * fix encoding * insert in bal store on suggest * move to executionpayloadv4 * getpayloadv6 * osaka engine api version * getpayloadv6 DI * use executionpayloadv4 in blockchain tests * fix removing storage read on revert, copy across BAL from suggested for debugging * Bal devnet 2 fixes (#10293) * Fix whitespaces * Fix 1 * Fix 2 * Fix 3 * Fix 4 * Fix 5 * Bal devnet 2 merge (#10297) * fix: NodeKey.GetHashCode() violates Equals/GetHashCode contract (#9744) * chore: remove dead IsSyncing field and its assignment (#9790) * chore: remove dead IsSyncing field and its assignment * Apply suggestion from @LukaszRozmej * Simplify result creation in SyncingSubscription Refactor SyncingSubscription logic for clarity and efficiency. * Fix resource leak by using 'using' statement --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Move engaging NoGC out of hot path (#9799) * Move engaging NoGC out of hot path * AI was right * Better naming * chore: remove duplicate AddDatabase registrations in DbModule (#9802) * chore: streamline nullability suppression in LruCache (#9796) Update LruCache.cs * Remove unused transaction hash collections in SendBlobs CLI (#9798) Update SetupCli.cs * Reduce storage tracking allocations (#9664) * Reduce storage tracking allocations * formatting * Formatting * Switch to new * Less changes * Remove thread static * Use extension * Fast empty path * Use faster checks for StackPool * Also reset skip flag * Feedback * Fix * AI feedback * formatting * Devirtualize filter{store | manager} (#9779) * Devirtualize filter{store | manager} * Feedback * Lets not get fancy * More specific * Feedback * Cache masternode quorum math in VotesManager (#9794) Update VotesManager.cs * fix: RlpxHost.Init guard to reference RlpxHost instead of PeerManager (#9805) * chore: remove unused block parameter (#9814) * Remove defensive copies from SecP256k1 (#9817) * Remove defensive copies from SecP256k1 * Remove type entirely * Remove unneeded .ToArray() * Max optimize * Allow Inner Reverts for eth_gasEstimate (#9822) * address inner revert for eth_gasEstimate * add new error type * fix: mismatches in error messages (#9823) fix mismatches in error messages * fix: avoid allocation in PutSpan by throwing immediately (#9819) * fix: avoid allocation in PutSpan by throwing immediately * Update RpcDb.cs * Fix merge issue (#9824) * Fix ColumnsDb constructor recursion and reuse resolved keys (#9818) * Update ColumnsDb.cs * Update ColumnsDb.cs * Resolve Transitive dependency warnings (#9827) * Resolve Transitive dependency warnings * Update Directory.Packages.props Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix buyGas in simulate (#9761) * test * Try fix * Try fix * Remove flag from non rpc calls * Fix json rpc tests * Fix more tests * Fix system tx processor * Fix blockchain tests * More fixes * Update src/Nethermind/Nethermind.Taiko/TaikoTransactionProcessor.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix restore * Fix small issues * Update src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * known failing tests --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove redundant Math.Min call in SnapServer storage guard (#9828) Update SnapServer.cs * Remove unnecessary pragma suppression from SortedPool events (#9830) Update SortedPool.Events.cs * Shrink ReadToEndAsync async machine (#9831) * Shrink ReadToEndAsync async machine * Update src/Nethermind/Nethermind.JsonRpc/PipeReaderExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Optimize BlockParameter parsing (#9835) * fix: correct EOFCREATE error message (#9836) * chore: remove unused ShouldSerialize hooks and fix nullable properties (#9820) * chore: remove unused ShouldSerialize hooks and fix nullable properties * remove private readonly bool _isAuRaBlock * fix build --------- Co-authored-by: Marcos Antonio Maceo <35319980+stdevMac@users.noreply.github.com> Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Auto-update fast sync settings (#9840) Co-authored-by: rubo <rubo@users.noreply.github.com> * Update OP Superchain chains (#9841) Co-authored-by: emlautarom1 <emlautarom1@users.noreply.github.com> * fix: keep PeerPool commit loop running when no pending changes (#9839) * chore(init): remove unused StateReader assignment in InitializeBlockchain (#9843) Update InitializeBlockchain.cs * Increase precision of gas price logging (#9845) * Fast path JwtAuthentication (#9837) * Fast path JwtAuthentication * AI complaining * fix: add missing string interpolation (#9851) * fix: dispose automatic pruning triggers to stop background timers (#9847) * fix: dispose automatic pruning triggers to stop background timers * Update PruningTrieStateFactory.cs * Update CompositePruningTrigger.cs * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: remove unused IHttpContextFactory resolution in StartAsync (#9857) * fix: use ArgumentNullException for ecdsa parameter (#9858) * Fix some spelling, add dictionary (#9850) * Fix some spelling, add dictionary * Fix bundle * Apply review feedback: fix typo and simplify test string (#9863) * Initial plan * Apply both suggestions: fix "Since" → "Sync" typo and simplify test string Co-authored-by: flcl42 <630501+flcl42@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: flcl42 <630501+flcl42@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: flcl42 <630501+flcl42@users.noreply.github.com> * Fail fast for missing precompile (#9862) * Fail fast for missing precompile * fomatting * fix(txpool): race condition in NonceManager.TxWithNonceReceived (#9861) * Dispose plugins when supported (#9848) * Dispose plugins if needed * Fix redundant allocation in IXdcHeaderStore.BulkInsert (#9829) Update IXdcHeaderStore.cs * perf: avoid extra allocation by iterating snapshot (#9842) * Adjust JOC Bootnodes according to recent changes (#9869) fix: adjust joc bootnodes * fix leak in NettyDiscoveryBaseHandler (#9873) * Don't cache current block cache (#9852) * Don't cache current block cache, this makes cache usable for block production where current block hash is unknown * refactors * slight refactor * more simplification * fix * fixes for Hash being null - block production * fix for prefetch * fix test * remove redundant check * Reduce Evm Exceptions (#9808) * Reduce Evm Memory Exceptions * Reduce exceptions further * Compile issue * AI feedback * AI feedback * Add test coverage for out-of-gas conditions in memory operations (#9811) * Initial plan * Add out-of-gas test coverage for memory operations Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> * Reduce casts * Change to tryX pattern --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> * Bump up the version to 1.37.0-unstable (#9871) Co-authored-by: stdevMac <stdevMac@users.noreply.github.com> * Taiko Shasta Changes (#9709) * initial changes * make l1BlockHeight optional in L1Origin * fix field name inconsistency in NMC and Geth * undo field name change (catalyst fixed) * shasta devnet fixes * address review comments and fix issues --------- Co-authored-by: Ahmad Bitar <33181301+smartprogrammer93@users.noreply.github.com> * fix: invert post-merge difficulty validation logic in T8n tool (#9880) * Changed default PublicKey serialization to use hash format (#9696) * Changed default PublicKey serialization to use hash format * Added tests for PublicKey serialization format changes * removed comments, parsed JSON properly, fixed naming convention * Added regression tests for PublicKey serialization changes * removed previous combined test file * updated regression tests to verify byte content produced by each converter * removed linq skip and take * removed tests that validate unsupported inputs * ran dotnet format --------- Co-authored-by: Stavros Vlachakis <89769224+svlachakis@users.noreply.github.com> * Fix Jovian fork id (#9877) * Fix Jovian fork id * Add test * Fix Base Mainnet test * Formatting --------- Co-authored-by: Lautaro Emanuel <emlautarom1@gmail.com> * fix: tie readonly DB provider to env lifetime and clear per-scope buffers (#9883) * fix: remove duplicate EIP-7702 transaction counting in TxPool (#9885) * fix: prevent EVM memory size overflow crash for extreme memory requests (#9887) fix: prevent EVM memory size overflow crash for large memory requests The memory validation in CheckMemoryAccessViolation was checking against long.MaxValue, but .NET arrays are limited to int.MaxValue. When memory requests exceeded int.MaxValue but were less than long.MaxValue, the word-aligned size calculation would overflow when cast to int, causing ArrayPool.Rent() to allocate an incorrectly sized array and subsequent Array.Copy operations to crash. This fix changes the limit from long.MaxValue to (int.MaxValue - WordSize + 1) to ensure that after word alignment, the resulting size still fits in int. Root cause: - Memory size validation checked: totalSize > long.MaxValue - But .NET arrays require: (int)Size to be valid - Word alignment adds up to 31 bytes: Size = totalSize + (32 - totalSize % 32) - When totalSize > int.MaxValue - 31, (int)Size overflows Example crash scenario: 1. Contract requests 4GB (0xffffffff) memory via DELEGATECALL 2. Validation passes (4GB < long.MaxValue) 3. Word-aligned Size = 0x100000000 (exceeds int.MaxValue) 4. (int)Size = 0 (overflow) 5. ArrayPool.Rent(0) returns tiny array 6. Array.Copy crashes with "Destination array was not long enough" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com> * Auto-update fast sync settings (#9893) Co-authored-by: rubo <rubo@users.noreply.github.com> * fix: map InvalidBlockRangeUpdate to BreachOfProtocol (#9891) * Update OP Superchain chains (#9892) Co-authored-by: emlautarom1 <emlautarom1@users.noreply.github.com> * Run taiko nodes on latest version (#9899) feat: run taiko nodes on latest version * Update Dockerfiles (#9909) Co-authored-by: rubo <rubo@users.noreply.github.com> * Disable publishing to Downloads (#9910) * chore: remove from release the upload to the downloads page * Delete publish-downloads.sh --------- Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com> * Fix hive getLogs (#9889) * try fix * Fix tests * Try fix * Fix * Fix from & to * Fix block in the future * Fix build * Fix range in the future * Fix block range * to * Fix tests * Fix json rpc tests * Fix formatting * Fix blockchain tests * Fix suggestions * Fix tags * Remove address from AddressFilter * Fix tests * Fix address filter * Fix suggestions * fix: remove duplicate gRPC host validation in GrpcClient (#9922) * Move ExecutionEnvironment to Rentable sealed class (#9916) * Move ExecutionEnvironment to Rentable sealed class * fixes * convert to properties * fix * better * fix Benchmarks * comment * Update src/Nethermind/Nethermind.Evm.Benchmark/MultipleUnsignedOperations.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/Nethermind/Nethermind.Evm/EvmState.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Apply suggestion from @alexb5dh Co-authored-by: Alex <alexb5dh@gmail.com> * Refactor Disposing * fixes * Add Dispose guard --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Alex <alexb5dh@gmail.com> * fix: align BlockHashes dictionary to use nullable Hash256 (#9900) fix: make T8nBlockHashProvider accept non-nullable Hash256 * Only pool pure Transaction objects, not subclasses (#9884) check: * Auto-update fast sync settings (#9933) Co-authored-by: rubo <rubo@users.noreply.github.com> * Update OP Superchain chains (#9932) Co-authored-by: emlautarom1 <emlautarom1@users.noreply.github.com> * Adjust JOC testnet Bootnodes according to recent changes (#9940) fix: adjust joc testnet bootnodes * fix: Remove redundant BlockHeader field reassignments in StatelessExecution (#9928) Update SetupCli.cs * test: add Eip2565Transition check for posdao chain spec (#9920) Add missing Eip2565Transition assertion in Can_load_posdao_with_rewriteBytecode test. The test now verifies that Eip2565Transition is null for posdao.json since it uses the old modexp pricing format (divisor: 20) without modexp2565 transition. Resolves TODO comment about modexp 2565. Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Fixes #9606: DebugTracerTests thread synchronization issue (#9875) Fix DebugTracerTests thread synchronization issue (#9606) - Add vmThread.Join() calls after while loops to ensure VM threads complete before TearDown disposes the WorldState scope - Add ExecuteSafe helper method to catch ThreadInterruptedException from aborted threads - Add ThreadJoinTimeout constant to prevent tests from hanging This fixes the 'IWorldState must only be used within scope' exception that occurred when VM threads were still running during test cleanup. * Faster protocol parsing, add Ethrex (#9935) * Improve protocol parsing, add Ethrex * Add comprehensive unit tests for ProtocolParser (#9936) * Initial plan * Add comprehensive unit tests for ProtocolParser Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> * Refactor hex validation tests to reduce code duplication Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> * Optimize RecognizeClientType with zero-allocation likelihood-ordered regex (#9943) * Initial plan * Optimize RecognizeClientType using compiled regex Co-authored-by: LukaszRozmej <12445221+LukaszRozmej@users.noreply.github.com> * Address code review feedback: optimize regex ordering and group iteration Co-authored-by: LukaszRozmej <12445221+LukaszRozmej@users.noreply.github.com> * Generate regex from enum and use FastEnum for better performance Co-authored-by: LukaszRozmej <12445221+LukaszRozmej@users.noreply.github.com> * Add explanatory comments for regex pattern generation Co-authored-by: LukaszRozmej <12445221+LukaszRozmej@users.noreply.github.com> * Use Regex.EnumerateMatches and ReadOnlySpan to eliminate allocations Co-authored-by: LukaszRozmej <12445221+LukaszRozmej@users.noreply.github.com> * Simplify regex pattern by removing unnecessary named groups Co-authored-by: LukaszRozmej <12445221+LukaszRozmej@users.noreply.github.com> * Rename to _clientTypeRegex and optimize regex order by likelihood Co-authored-by: LukaszRozmej <12445221+LukaszRozmej@users.noreply.github.com> * Refactor to use Except for cleaner exclusion logic Co-authored-by: LukaszRozmej <12445221+LukaszRozmej@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: LukaszRozmej <12445221+LukaszRozmej@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> Co-authored-by: LukaszRozmej <12445221+LukaszRozmej@users.noreply.github.com> * Precompiles names fix (#9944) correct names as per https://eips.ethereum.org/EIPS/eip-2537 * Update packages (#9907) * Fix hanging scenario if persisted node not able to be pruned (#9931) * Fix haning scenation if persisted node not able to be pruned * Minor comment adjustment * Reduce warning if in commit buffer mode * Separate wrong nonce errors (#9941) * Separate wrong nonce errors --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Add engine_getBlobsV3 (#9942) * Add engine_getBlobsV3 --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * fix: only touch coinbase after successful transaction in state tests (#9865) * fix: only touch coinbase after successful transaction in state tests When a transaction fails validation (e.g., insufficient balance), the state test runner should not modify state at all. Previously, the coinbase account was created in InitializeTestState before transaction execution, causing state root divergence from geth when transactions failed validation. This fix moves coinbase creation to after successful transaction execution, matching geth's behavior: - Only touch coinbase when txResult == Ok - When validation fails, state remains unchanged from pre-state This was a consensus bug in the test framework (not production code) introduced in PR #9225. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Update src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs * fix: update T8nExecutor to use new InitializeTestState signature The InitializeTestState method signature was changed to remove the coinbase parameter. T8nExecutor already creates the coinbase account separately (line 54), so we just need to update the call to match the new 3-argument signature. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: only touch coinbase after successful transaction in state tests When a transaction fails validation (e.g., insufficient balance), the state test runner should not modify state at all. Previously, the coinbase account was created in InitializeTestState before transaction execution, causing state root divergence from geth when transactions failed validation. This fix moves coinbase creation to after successful transaction execution, matching geth's behavior: - Only touch coinbase when txResult == Ok - When validation fails, state remains unchanged from pre-state This was a consensus bug in the test framework (not production code) introduced in PR #9225. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: add IsLegacy flag for backward-compatible coinbase handling in state tests Legacy tests expected coinbase to be created before transaction execution, which was a buggy behavior baked into their expected state roots. This adds an IsLegacy flag to preserve backward compatibility while new tests use the correct behavior of creating coinbase only after successful tx. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Update src/Nethermind/Ethereum.Test.Base/GeneralTestBase.cs Co-authored-by: Alexey Osipov <me@flcl.me> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> Co-authored-by: Alexey Osipov <me@flcl.me> * Gnosis Balancer permanent changes (#9946) * initial commit * fork info test, tidy * small tidy * load fork transition * fix test * use real gnosis json for test * simplify test * start aura check rewrite by timestamp count * reuse prague specs * osakagnosis * private praguegnosis * use array for overrides internally * formatting --------- Co-authored-by: Marc Harvey-Hill <10379486+Marchhill@users.noreply.github.com> * Sign release builds (#9937) * Increase default rlp collection limit to 4MB (#9957) * Auto-update fast sync settings (#9964) Co-authored-by: kamilchodola <kamilchodola@users.noreply.github.com> * Fix/limit get proof (#9967) * limit and deduplicate getProof * const * fix merge * feat(merkle): remove unused RootOfNull to avoid dead code and startup allocation (#9898) * Fix/rlp decode array checks (#9968) * Add report test cases * Add checks to `DecodeArray` and `DecodeByteArrays` * Remove TODOs * Always check for `DecodeArray` and similar * More missing checks * fix build * compact storage encoding fix * more fix * Different way of handling compact encoding of receipts * Increase discovery tests timeout * fix * refactor --------- Co-authored-by: Lautaro Emanuel <emlautarom1@gmail.com> * fix: dispose IEraStore when EraImporter.Import fails early (#9978) * Remove rpc from hive worflow (#9971) fix workflow * Elevate access for ABI decode override more easily (#9977) Increase access for decode * Run all tests on master (#9979) * fix * fix * Remove parsing Uint256 from statics (#9980) * perf: Remove redundant ToArray() allocation in TrieStore warning log (#9969) * Update TrieStore.cs * Update src/Nethermind/Nethermind.Trie/Pruning/TrieStore.cs --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Optimise MemDb for ZK (#9952) * feat(evm): generify VirtualMachine with policy-based gas tracking (#9846) * refactor: Remove redundant try-catch in SszProperty.StaticLength (#9976) * Update SszProperty.cs * Update src/Nethermind/Nethermind.Serialization.SszGenerator/SszProperty.cs --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * fix: correct NSubstitute argument types in AuraWithdrawalProcessorTests (#9966) Update AuraWithdrawalProcessorTests.cs * Auto-update fast sync settings (#9989) Co-authored-by: rubo <rubo@users.noreply.github.com> * Update OP Superchain chains (#9988) Co-authored-by: emlautarom1 <emlautarom1@users.noreply.github.com> * perf: avoid LINQ allocations in GetStorageRangesMessageSerializer (#9951) * refactor: cache blob and proof counts in BlobProofsManagerV1 (#9983) * Update BlobProofsManagerV1.cs * Update src/Nethermind/Nethermind.Crypto/BlobProofsManagerV1.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: replace unused mock logger with LimboTraceLogger in EnrDiscoveryTests (#9993) Replace EnrTreeCrawler logger with LimboTraceLogger * fix: replace empty exception with informative BlockchainException in ExtractSigners (#9986) perf: avoid unnecessary block clone in block_to_payload_v3 Replace generic Exception with empty message in ExtractSigners method with BlockchainException containing descriptive error message. This aligns with project's exception handling patterns and improves debuggability. * perf(tests): Remove redundant ToList() calls in PatriciaTreeBulkSetterTests (#9981) Update PatriciaTreeBulkSetterTests.cs * Use correct HardwareAcceleration checks for Vector (#10007) * Use correct HardwareAcceleration checks for Vector * Update src/Nethermind/Nethermind.Evm/CodeAnalysis/JumpDestinationAnalyzer.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Vector512 --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Optimize ColumnDb MultiGet allocations (#9908) * Update ColumnDb.cs * Update ColumnDb.cs * fix: correct type name in TimeoutDecoder error message (#9948) Co-authored-by: ak88 <anders@nethermind.io> * perf: reduce allocations in TypeExtensions (#9994) * Update TypeExtensions.cs * Update TypeExtensions.cs * Update TypeExtensions.cs * refactor(trie): remove redundant condition check in IsValidWithOneNodeLess (#9982) * Update TrieNode.cs * Update src/Nethermind/Nethermind.Trie/TrieNode.cs * Update src/Nethermind/Nethermind.Trie/TrieNode.cs --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> Co-authored-by: Ben {chmark} Adams <thundercat@illyriad.co.uk> * fix: return correct count when no peer was dropped in DropWorstPeer (#10001) * Consider type boundaries (#10000) * Taiko Shasta Changes - II (#9998) * taiko-geth changes * potential fix for 'main chain predecessor cannot be found' error * address comments & add goldentouch account filter * Set release target commit explicitly (#10009) * Fix/json converters exception type (#9984) * fix: use JsonException in boolean and BigInteger converters * fix: use JsonException in boolean and BigInteger converters * Update src/Nethermind/Nethermind.Serialization.Json/BigIntegerConverter.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Update src/Nethermind/Nethermind.Serialization.Json/BooleanConverter.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * fix ci * Update BooleanConverter.cs --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * refactor(tests): Remove unused variables in Enode exception tests (#9991) * Update PeerManagerTests.cs * Update PeerManagerTests.cs * Update src/Nethermind/Nethermind.Network.Test/PeerManagerTests.cs * Update PeerManagerTests.cs * Update PeerManagerTests.cs --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * test: replace Task.Delay with After() in ContractDataStoreTests (#9985) * Update ContractDataStoreTests.cs * Update ContractDataStoreTests.cs * Update ContractDataStoreWithLocalDataTests.cs * fix: delegate raw converters read to base converters (#10006) * fix: delegate raw converters read to base converters * fix: delegate raw converters read to base converters * fix * fix: remove duplicate HasSignedRecently checks in sealer clique (#10011) * Make Nethermind UI SSE endpoint relative (#10008) * fix: use IHttpClient from DI in MergePlugin instead of creating HttpClient directly (#9995) * Update MergePlugin.cs * Update DefaultHttpClient.cs * Update src/Nethermind/Nethermind.Merge.Plugin/MergePlugin.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update MergePlugin.cs * Update DefaultHttpClient.cs --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Validate blobs lengths (#9999) * refactor(AuRa): remove redundant Create override (#10014) * Feature/Worldstate backend (#9089) * WorldState backend Fix check failure Add small test Whitespace Different setter Slight cleanup Whitespace Rename to scope provider Add code to `IWorldStateScopeProvider`. (#9291) * Add codedb * Add test * Whitespace * use span on set Fix TestworldStateFactory build Rename to update state root Refactor/Nicer IWorldStateScopeProvider interface (#9375) * Reduce interfacae surface area * Fix build * Fix random * Fix randomly failing pyspec test * Whitespace Refactor/Slight cleanup to world state write batch API. (#9400) Remove on account updated callback Fix build Feature/add back `OnAccountUpdated` (#9436) * Add back on account updated * Hint get * Update src/Nethermind/Nethermind.Evm/State/IWorldStateScopeProvider.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Fix build --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> Feature/worldstate scope provider manager (#9306) * World state manager to return scope provider * Fix build * Fix build Fix selfdestruct Fix selfdestruct not called in some case Fix build Whitespace Fix build Slight per on small contract * Fix build * Whitespace * Update src/Nethermind/Nethermind.State/TrieStoreScopeProvider.cs Co-authored-by: Marc <Marchhill@users.noreply.github.com> * Address comment * Make test more consistent * Extra comment * Fix precompile cache config * Remove missed comment * Address comment --------- Co-authored-by: Marc <Marchhill@users.noreply.github.com> * fix: use ArgumentNullException for null logManager in EthStatsClient (#10018) Update EthStatsClient.cs * fix: correct BlobTxMissingBlobs error message (#10015) * fix: correct BlobTxMissingBlobs error message * fix * Change KzgPolynomialCommitments.BlsModulus to new instead of parse (#10032) * Fix/isStorageEmpty check does not get reflected until after commit. (#10039) * ADd logger * Slightly more log * Actually fix it * Uses a different dedicated is empty check * Fix code formatting in WorldStateScopeOperationLogger (#10040) * Initial plan * Fix formatting: Add space before colon in class declaration Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * Update src/Nethermind/Nethermind.Core/Account.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Update src/Nethermind/Nethermind.State/PersistentStorageProvider.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Update src/Nethermind/Nethermind.State/WorldStateScopeOperationLogger.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Update src/Nethermind/Nethermind.State/WorldStateScopeOperationLogger.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Update src/Nethermind/Nethermind.State/WorldStateScopeOperationLogger.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Update src/Nethermind/Nethermind.State/WorldStateScopeOperationLogger.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Update src/Nethermind/Nethermind.State/WorldStateScopeOperationLogger.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Update src/Nethermind/Nethermind.State/WorldStateScopeOperationLogger.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Update src/Nethermind/Nethermind.State/WorldStateScopeOperationLogger.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * fix: use GaugeMetric for PeerCandidateCount (#10004) * Fix IsTracing calculation by making it lazy (#10053) * Auto-update fast sync settings (#10055) Co-authored-by: rubo <rubo@users.noreply.github.com> * Merge package release workflows (#10049) * Fix/get logs optimization (#9923) * try fix * Fix tests * Try fix * Fix * Fix from & to * Fix block in the future * Fix build * Fix range in the future * Fix block range * to * Fix tests * Fix json rpc tests * Fix formatting * Fix blockchain tests * Fix suggestions * Fix tags * Remove address from AddressFilter * Fix tests * Fix address filter * Optimize Filter changes * fix * refactor * Apply suggestions from code review Co-authored-by: Nikita Mescheryakov <root@nikitam.io> --------- Co-authored-by: Nikita Meshcheriakov <root@nikitam.io> * fix: resource cleanup in BeaconHeadersSyncFeed (#10037) * fix: resource cleanup in BeaconHeadersSyncFeed * remove override * perf: avoid rlp encode-decode in simulate receipt recovery (#10021) * perf: avoid rlp encode-decode in simulate receipt recovery * fix * Fix CodeQL workflow (#10056) * Check for 0 in MOD opcode (#10061) Check for 0 in Mod * Keep EXP opcode in UInt256 domain (#10060) * Keep EXP opcode in UInt256 domain * Is bytes * fix: DataFeed constructor null checks (#10062) * Update schema (#10035) * Remove MetricsController._metricTypes (#10057) * Fixes #9577: resolve race condition in StateSyncFeedTests.Big_test (#9972) * fix(sync): resolve race condition in StateSyncFeedTests.Big_test (#9577) * fix(sync): Isolate block tree cache in StateSyncFeedTestsBase to fix parallel test failures * changes --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Perf/TryGetDirtyNode (#10067) * Try get dirty child * Appendmut set last * Should be inside instead * Fix tracelog * Fix trace again * Call prune persisted recursively on commit and on copy too (#10065) * feat(abi): add support for fixed-size array element types (#10025) * XDC Reward handler (#9881) * calculator * state reader * masternode voting contract * fix * abi json * working load test * test * test * test getCandidates * cleanup * format * remove var * format * review comments * implement calculate rewards base flow and get signing txs * implement rewards per signer and distribution calculations * implement getCadidateOwner * refactors and add comments to the code * add block signer contract address to the configuration spec * implement reward module tests * implement hook for reward calculation in hotstuff pipeline * refactor and format * format * fix xdc test * wire IRewardClaculator in ConfigureContainer in XdcTestBlockchain * address review comments and add unit test with precalculated xdc reward values * add missing dependencies in Xdc module * fix resolving contract addresses from spec * fix error with WorldState after merge * add comments for reward tests with link to original source --------- Co-authored-by: ak88 <anders.holmbjerg@hotmail.com> Co-authored-by: ak88 <anders@nethermind.io> * Use baseblock for tree visitor (#10066) * Surge: Fix Profitabilty Check Bypass (#10020) * add potential fix * nit: improve config description * Skip SST file size checks when MaxOpenFiles is specified (#10002) * Skip SST file size checks when MaxOpenFiles is specified * Add config option, skip SST checks on MacOS if not configured otherwise * Remove obvious comment * Fix: Correct memory access validation in TrySaveByte for MSTORE8 operation (#9970) * Update EvmPooledMemory.cs * Update src/Nethermind/Nethermind.Evm/EvmPooledMemory.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/Nethermind/Nethermind.Evm/EvmPooledMemory.cs * Update src/Nethermind/Nethermind.Evm/EvmPooledMemory.cs --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update file header templates (#10077) * Should update child if parent has empty keccak as well (#10073) * Should update child if parent has empty keccak as well * Combine conditions * Improve FastHash quality (#10082) * Improve hash quality * formatting * Update src/Nethermind/Nethermind.Core/Extensions/SpanExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactor: replace HexConvert.ToUInt256 with UInt256.Parse (#10085) Keep HexConvert.ToUInt64 as it handles both base 10 and 16 automatically. * fix: ensure eth_getBlockByNumber enforces canonical block retrieval (#10024) * fix: ensure eth_getBlockByNumber enforces canonical block retrieval * fix tests * address comment * apply suggestion * Auto-update fast sync settings (#10089) Co-authored-by: rubo <rubo@users.noreply.github.com> * fix: correct assertion variables in Cleans_invalid_blocks_before_starting test (#10086) Update BlockTreeTests.cs * Drop eth66 and eth67 support, add eth69 as a default (#9938) * Drop eth66 and eth67 support * Fix tests * test * bump versions * Fix E2ESyncTests failures when isPostMerge=false - remove eth/69 from default capabilities (#10103) * Initial plan * Remove eth/69 from default capabilities - added dynamically by MergePlugin Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> * Fix test expecting eth/69 as highest default protocol version Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> * fix --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> * fix(network): shutdown rlpx executor group (#10087) * feat (gas policy): add `ConsumeCodeCopyGas` method (#10068) * Add Address recovery from PublicKey to KeccakCache (#10003) * Add Address recovery from PublicKey to KeccakCache * Improve comments * Feedback * refactor: remove unused Destroy change type from storage provider (#10106) * Update to UInt256 version 1.4.0 (#10107) * Update to UInt256 version 1.4.0 * Fix some div zero * chore: remove debug-only keccak keys from proof call storage test (#10104) * fix: use parameter name in BloomStorage null check (#10096) * fix: correct ExampleResponse for admin_importHistory method (#10097) Update IEraAdminRpcModule.cs * fix: remove redundant blockInfosDb assertions (#10099) Update BlockTreeTests.cs * perf: reuse SimpleConsoleLogger instance in SimpleConsoleLogManager (#10070) Update SimpleConsoleLogManager.cs * optimize eth_gasPrice using kth algorithm (#10100) * optimize eth_gasPrice using kth algorithm * fix: review nethermind --------- Co-authored-by: weixie.cui <weixie.cui@okg.com> * Don't queue prunes (#10112) * Don't queue prunes * Add delay * Add Delay reasoning comment * refactor: simplify Avx2 branches for UInt256 shuffles (#10111) * refactor: simplify Avx2 branches for UInt256 shuffles * Update EvmStack.cs * fix(kute): prevent null label crash in Prometheus metrics reporter (#10109) * Fix #10068 regression (#10116) * Git/ignore claude config (#10118) * Ignore claude config in git * Ignore claude config in git * perf: use cached BlockInfo variable instead of redundant array access in BlockTree (#10125) Update BlockTree.cs * Save space locally on builds (#10113) * Add Directory.Build.targets with: - Skip copying dependencies and native runtimes for library projects - Filter native runtimes to current OS only during local builds - Share native runtimes across projects during local builds with a shared location and junctions/symlinks * NethermindCopyAllRuntimes -> CI * Remove filtering native lib by os * Move Directory.Build.targets to src/Nethermind * Make mechanism opt-in with SlimBuild parameter Add Directory.Build.targets to Solution Items * SlimBuild can have any value to be enabled * Refactor Directory.Build.targets (#10122) --------- Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com> * Align Nethermind with the latest taiko-geth changes (#10127) * Surge TDX Attestation (#9954) * initial changes for taiko tdx * fixes and refactoring * optimize attestation * simplify attestation, return block header and add tests * add two variants for attestation, remove quotes & instance id, add tests * remove docs * minor fix * modify header attestation to return both hash and header rlp * refactor * fix tests and address comments * nit: fix whitespace * undo tdx module change * modify signature to use blockhash+stateroot * fix new header serialization * address comments --------- Co-authored-by: smartprogrammer93 <smartprogrammer@windowslive.com> * Remove redundant `File.Delete` after `File.Move` (#10128) * refactor: simplify conditional returns in FeeTooLowFilter (#10129) * refactor: remove unused finalization manager field in Optimism plugin (#10130) * Optimize discv5 (#10081) * Update schema * Fix schema * No need in type cast * Use improved discv5; refactor * Update PierTwo.Lantern.Discv5.WireProtocol * Less errors * Pooled * refactor: remove unused `_pushEnabled` from MonitoringService (#10135) refactor: remove unused _pushEnabled from MonitoringService * Add some guards to RetryCache (#10134) * Add some guards to RetryCache Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> Co-authored-by: Marcos Antonio Maceo <35319980+stdevMac@users.noreply.github.com> * XDC save snapshot on gap block (#9774) * start * state reader * state reader * masternode voting contract * fix * blocktree saves snapshot on gap * abi json * working load test * test * test * test getCandidates * cleanup * format * update masternodes * hooked up with deposit contract * remove var * format * review comments * format * test rewrite * test fix * format * test save snapshot on head block * merge fix * cleanup * merge fix * merge fix * merge fix * remove using * remove class * fix MasternodeVotingContract IOC * perf: Remove redundant allocations in NettyDiscoveryHandlerTests (#10155) Update NettyDiscoveryHandlerTests.cs * fix: correct header range logging in PoW forward sync (#10140) Update PowForwardHeaderProvider.cs * fix: avoid GetReceiptData when hash lookup unsupported (#10023) Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * fix: correct slice index in Address.TryParseVariableLength (#9902) * fix: correct slice index in Address.TryParseVariableLength * test * update test Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Update src/Nethermind/Nethermind.Core.Test/AddressTests.cs --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * perf(facade): optimize SimulateDictionaryHeaderStore.Get for cache hits (#9903) * fix: add informative message to block processing timeout exception (#9912) Update HiveRunner.cs * fix: Remove invalid eth_getTransactionByHash call (#9784) * Fix typos 2 (#10162) * Few typos fixed * Check in the pipeline * Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Remove * Some fixes * Test --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix: remove duplicate transaction processor adapter registration (#10170) * perf: avoid extra init code allocations in CREATE/EOFCREATE (#10019) * perf: avoid extra init code allocations in CREATE/EOFCREATE * perf: avoid extra init code allocations in CREATE/EOFCREATE * Replace empty array initializations with Array.Empty<T>() (#10172) * Initial plan * Replace empty array initializations with Array.Empty<T>() Co-authored-by: MarekM25 <9356351+MarekM25@users.noreply.github.com> * Replace new Address[0] with Array.Empty<Address>() in Xdc production code Co-authored-by: MarekM25 <9356351+MarekM25@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MarekM25 <9356351+MarekM25@users.noreply.github.com> * Fix disposing of a pooled array (#10168) * fix(SendBlobs): add missing receiverOption to reclaim command (#10136) * Auto-update fast sync settings (#10179) Co-authored-by: rubo <rubo@users.noreply.github.com> * fix(sync): use INetworkConfig constructor for SyncPeerPool DI registration (#10158) * fix(sync): use INetworkConfig constructor for SyncPeerPool DI registration SyncPeerPool was ignoring the configured MaxActivePeers value and always using a hardcoded default of 100 peers. Root cause: SyncPeerPool has two constructors: 1. One taking INetworkConfig that reads ActivePeersMaxCount from config 2. One with default parameters (peersMaxCount = 100) The DI registration `.AddSingleton<SyncPeerPool>()` allowed Autofac to pick a constructor automatically. Autofac selected the constructor with default parameters, completely bypassing INetworkConfig. This caused SyncPeerPool.PeerMaxCount to always be 100 regardless of the configured Network.MaxActivePeers value. Fix: Use explicit factory registration that specifies INetworkConfig as a dependency, ensuring the correct constructor is called with config values. * refactor: use UseConstructorForDependencyInjection attribute and add test * refactor(tools): eliminate redundant First() calls in HiveConsensusWorkflowGenerator (#10182) Update Program.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * docs: fix dead link (#10181) Update ForkchoiceUpdatedV1Result.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Remove redundant ToArray calls in eth_accounts (#10185) Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Override default CLI option alias (#10148) Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com> * Add AGENTS.md (#10177) * Fix cannot prune storage root (#10203) * Fix cannot prune storage root * Fix whitespace formatting in TreeStoreTests.cs (#10204) * Initial plan * Fix whitespace formatting in TreeStoreTests.cs Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * Support CLI alias overrides in docs (#10197) * Fast-path ConcurrentDict AddOrUpdate (#10220) * Fast-path ConcurrentDict AddOrUpdate * Also debug * Reuse same nibble keys for short paths (#10214) * Reuse same nibble keys for short paths * Address review comments: remove unused parameter, add XML docs, add unit tests for GetPathArray (#10215) * Initial plan * Address review comments: remove unused parameter, add XML docs, add unit tests Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> * formatting * Other places * formatting * More optimal * Add tests for PrependNibble and ConcatNibbles methods (#10216) * Initial plan * Add comprehensive tests for PrependNibble and ConcatNibbles methods Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> * Fix misleading comments in ConcatNibbles tests Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> * Add validation checks to ConcatNibbles for invalid nibble values (#10217) * Initial plan * Add validation checks to ConcatNibbles for robustness Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> * Update src/Nethermind/Nethermind.Trie/HexPrefix.cs Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: benaadams <1142958+benaadams@users.noreply.github.com> Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com> * Update Dockerfiles (#10222) Co-authored-by: rubo <rubo@users.noreply.github.com> * Change async capturing closures to regular async methods (#10221) * Change async capturing closures to regular async methods * Formatting * Spelling * Reduce closure allocations in RetryCache (#10223) * Reduce closure allocations in RetryCache * Feedback * perf: Avoid unnecessary base fee calculations (#10213) * Update OP Superchain chains (#10178) Co-authored-by: emlautarom1 <emlautarom1@users.noreply.github.com> Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Remove redundant static metadata from `CachedPrecompile` wrapper (#10225) Update CachedCodeInfoRepository.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * refactor: extract duplicate chain ID retrieval logic in SendBlobs CLI (#10150) Update SetupCli.cs * perf: avoid eager client id formatting in ZeroNettyP2PHandler (#10189) * perf: avoid eager client id formatting in ZeroNettyP2PHandler * Update src/Nethermind/Nethermind.Network/P2P/ProtocolHandlers/ZeroNettyP2PHandler.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * add GetClientId and remove duplication * Apply suggestions from code review * Apply suggestion from @LukaszRozmej --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * fix: align storage tracing flag for ReportStorageChange (#10201) Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * fix(test-runner): Use maxPriorityFeePerGas for EIP-1559 state test parsing (#10205) For EIP-1559+ transactions, GasPrice is aliased to MaxPriorityFeePerGas in go-ethereum. When parsing state tests, use maxPriorityFeePerGas from JSON when available, falling back to maxFeePerGas if not specified. This aligns Nethermind's state test parsing behavior with go-ethereum. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Alexey Osipov <me@flcl.me> Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * fix: gRPC client reconnect to shutdown previous channel (#10156) * fix: gRPC client reconnect to shutdown previous channel * Update src/Nethermind/Nethermind.Grpc/Clients/GrpcClient.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Update src/Nethermind/Nethermind.Grpc/Clients/GrpcClient.cs --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * perf: eliminate redundant allocations in SendData byte normalization (#10154) Update BlobSender.cs * refactor: split ClHealthTrackerTests into separate test methods (#10171) * Update ClHealthTrackerTests.cs * Update ClHealthTrackerTests.cs --------- Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Optimize `PathUtils` (#10219) * Use `ConcurrentDictionary.GetOrAdd` in `Session` to avoid manual get-or-add logic (#10229) Update Session.cs * Allow some delays to be configurable (#10227) * Allow some delays to be configurable * Always async * Formatting * Update src/Nethermind/Nethermind.Merge.Plugin/IMergeConfig.cs Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com> * Update src/Nethermind/Nethermind.Db/IPruningConfig.cs Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com> --------- Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com> * Schedule largest storage changes first (#10236) * Schedule largest storage changes first * Feedback * fix: SyncDispatcher leak by disposing CountdownEvent (#10240) * Move default implementations out of IReleaseSpec (#10237) * Move default implementations out of IReleaseSpec * fix some test * Update src/Nethermind/Nethermind.Core/Specs/IReleaseSpecExtensions.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix more tests * Cleanup ISpecProvider.GetSpec * fix test * less whitespace --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix `PathUtils` for JetBrains Rider (#10238) * Apply a workaround for JetBrains Rider * Don't use `System.Diagnostics` * Fix formatting * Optimize storage key handling (#10241) * Optimize storage key handling Replaces byte[] with ValueHash256 for storage key lookup and computation in StorageTree for improved type safety and performance. Updates related method signatures and usages to use ValueHash256. Adds [SkipLocalsInit] attribute to several performance-critical methods in trie and pruning code. * Feedback * fix: avoid mutating levels in header/body existence checks (#10157) * fix: Add missing fields to Transaction.CopyTo and PoolPolicy.Return (#9890) Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Consider genesis in processing and finalization (#10235) * Refactor/Allow metrics before block processing (#10076) * Invert metric dependencies * Use timer loop * Rename metrics updater * Comment * Reduce change * Reduce change * Unit tests * Some cleanup * Fix dependencies * Add missing file header * Update src/Nethermind/Nethermind.Init/Modules/MonitoringModule.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Update src/Nethermind/Nethermind.Init/Steps/EthereumStepsManager.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> * Split the monitoring module out * Use BlockEventArgs * Whitespace * Address PR review comments: fix comment and remove unused method (#10084) * Initial plan * Address PR review comments: update comment and remove StopAsync Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * Move db monitoring outside * Fix build * [WIP] Refactor to allow metrics before block processing (#10186) * Initial plan * Fix filename format issue: remove trailing space from IMonitoringService.cs Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * Does this fix format? --------- Co-authored-by: Ruben Buniatyan <rubo@users.noreply.github.com> Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * Fix maybe combine logic fetch child with wrong path. (#10145) * Fix maybe combine logicc missed a fetch node * Fix typo in test class name: StrictRawScopedTrieStoce → StrictRawScopedTrieStore (#10146) * Initial plan * Fix typo in class name: StrictRawScopedTrieStoce -> StrictRawScopedTrieStore Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * Feature/RocksDb Snapshot (#10080) * Snapshot support * Move logic to db reader * Ensure get is used * Add comment on verify checksum * Format * Address PR #10080 review comments: fix memory leaks, improve documentation, add safety checks (#10083) * Initial plan * Address review comments: fix docs, memory leaks, and add safety checks Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * Remove unused _readOptions field from RocksdbSortedView Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * Use discard pattern for unused readOptions parameter Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * Remove unnecessary readOptions parameter from RocksdbSortedView Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * Make nullable --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * Bump default pruning cache by 512MB for larger mainnet blocks (#10247) Bump default pruning cache by 512MB * Fix: Change Taiko RPC Response to PascalCase (#10244) change case * perf(clique): eliminate redundant cache lookup in GetBlockSealer (#10252) Update SnapshotManager.cs * Skip GC when pruning (#10230) * Skip GC when pruning * fix * feedback * Auto-update fast sync settings (#10260) Co-authored-by: rubo <rubo@users.noreply.github.com> * Update OP Superchain chains (#10261) Co-authored-by: emlautarom1 <emlautarom1@users.noreply.github.com> * Fix/shared blockcache not used (#10263) * Cleaner optimize for hits * Columns db snapshot * Fix block cache * Fix test * Fix test * Fix build * Spell fix * Refactor HyperClockCacheWrapper to use SafeHandle pattern (#10265) * Initial plan * Refactor HyperClockCacheWrapper to use SafeHandle pattern Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * ColumnsDb snapshot (#10262) * ColumnsDb snapshot * Apply PR feedback: use NotSupportedException and simplify lambda syntax (#10264) * Initial plan * Apply PR feedback: use NotSupportedException and simplify lambda syntax Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: asdacap <1841324+asdacap@users.noreply.github.com> * Refactor ReleaseSpec (#10251) * Add taiko debug RPC for integration test support (#10211) * Add taikoAuth_waitForTxPoolSync method * Revert unnecessary changes * Update src/Nethermind/Nethermind.TxPool/ITxPool.cs * Update src/Nethermind/Nethermind.TxPool/TxPool.cs * Update src/Nethermind/Nethermind.TxPool/HashCache.cs * Resolve comments * Simplify, remove needless logic, and rename * Resolve comments --------- Co-authored-by: Ahmad Bitar <33181301+smartprogrammer93@users.noreply.github.com> * feat(tracing): enable external tracer registration and VM inheritance (#10228) * Re-enable prewarmer tx adapter for state pre-warming (#10266) Enable prewarmer tx adapter for state pre-warming * Validate state test tx as part of a block (#10224) * Add basic block validation to state tests * Some cleanup * Fix review * Add ProgressLogger to trie verification and full pruning operations (#10273) * docs: add implementation plan for ProgressLogger trie visitor integration Addresses #8504 - More use of ProgressLogger Detailed step-by-step plan with: - VisitorProgressTracker class implementation - Unit tests for thread-safety and accuracy - Integration into CopyTreeVisitor and TrieStatsCollector Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(trie): add VisitorProgressTracker for path-based progress estimation Addresses #8504 - More use of ProgressLogger - Tracks visited path prefixes at 4 levels (16 to 65536 granularity) - Thread-safe for concurrent traversal - Estimates progress from keyspace position, not node count Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * test(trie): add unit tests for VisitorProgressTracker Tests cover: - Progress tracking at different levels - Thread-safety with concurrent calls - Monotonically increasing progress - Edge cases (short paths, empty path) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * feat(pruning): integrate VisitorProgressTracker into CopyTreeVisitor Replaces manual every-1M-nodes logging with path-based progress estimation. Progress now shows actual percentage through the keyspace. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Improve TrieStatsCollector progress display - Always enable progress tracking in TrieStatsCollector - Add custom formatter to show node count instead of block speed - Track max reported progress to prevent backwards jumps - Display format: "Trie Verification 12.34% [...] nodes: 1.2M" Fixes progress display issues where: - Progress would jump backwards (12% → 5%) due to granularity switching - Showed confusing "Blk/s" units for trie operations - Displayed "11 / 100 (11.00%)" format that looked odd Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * docs: remove implementation plan documents Implementation is complete, no need for plan docs in the codebase. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Track both state and storage nodes in progress display The node count now includes both state and storage nodes, providing a more accurate representation of total work done. Progress estimation still uses state trie paths only. Changes: - Add _totalWorkDone counter for display (state + storage nodes) - Add isStorage parameter to OnNodeVisited() - Always increment total work, only track state nodes for progress Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * Optimize progress tracking with active level and startup delay Improvements: - Add 1 second startup delay before logging to prevent early high values from getting stuck in _maxReportedProgress - Only track the deepest level…
1 parent dd66893 commit 463efb3

147 files changed

Lines changed: 5634 additions & 342 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"auxdata",
5454
"backpressure",
5555
"badreq",
56+
"bals",
5657
"barebone",
5758
"baseblock",
5859
"basefee",

src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected async Task<EthereumTestResult> RunTest(BlockchainTest test, Stopwatch?
8989
List<(ForkActivation Activation, IReleaseSpec Spec)> transitions =
9090
isEngineTest ?
9191
[((ForkActivation)0, test.Network)] :
92-
[((ForkActivation)0, test.GenesisSpec), ((ForkActivation)1, test.Network)]; // TODO: this thing took a lot of time to find after it was removed!, genesis block is always initialized with Frontier
92+
[((ForkActivation)0, test.GenesisSpec), ((ForkActivation)1, test.Network)]; // genesis block is always initialized with Frontier
9393

9494
if (test.NetworkAfterTransition is not null)
9595
{
@@ -312,7 +312,7 @@ private static BlockHeader SuggestBlocks(BlockchainTest test, bool failOnInvalid
312312

313313
private async static Task RunNewPayloads(TestEngineNewPayloadsJson[]? newPayloads, IEngineRpcModule engineRpcModule)
314314
{
315-
(ExecutionPayloadV3, string[]?, string[]?, int, int)[] payloads = [.. JsonToEthereumTest.Convert(newPayloads)];
315+
(ExecutionPayloadV4, string[]?, string[]?, int, int)[] payloads = [.. JsonToEthereumTest.Convert(newPayloads)];
316316

317317
// blockchain test engine
318318
foreach ((ExecutionPayload executionPayload, string[]? blobVersionedHashes, string[]? validationError, int newPayloadVersion, int fcuVersion) in payloads)

src/Nethermind/Ethereum.Test.Base/BlockchainTestJson.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class BlockchainTestJson
2020
public IReleaseSpec? EthereumNetworkAfterTransition { get; set; }
2121
public ForkActivation? TransitionForkActivation { get; set; }
2222
public string? LastBlockHash { get; set; }
23+
public ConfigJson? Config { get; set; }
2324
public string? GenesisRlp { get; set; }
2425

2526
public TestBlockJson[]? Blocks { get; set; }
@@ -34,4 +35,18 @@ public class BlockchainTestJson
3435
public string? SealEngine { get; set; }
3536
public string? LoadFailure { get; set; }
3637
}
38+
39+
public class ConfigJson
40+
{
41+
public string? Network { get; set; }
42+
public string? Chainid { get; set; }
43+
public Dictionary<string, BlobScheduleEntryJson>? BlobSchedule;
44+
}
45+
46+
public class BlobScheduleEntryJson
47+
{
48+
public string? Target;
49+
public string? Max;
50+
public string? BaseFeeUpdateFraction;
51+
}
3752
}

src/Nethermind/Ethereum.Test.Base/JsonToEthereumTest.cs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
using Nethermind.Serialization.Json;
2020
using Nethermind.Serialization.Rlp;
2121
using Nethermind.Specs;
22+
using Nethermind.Specs.Test;
2223

2324
namespace Ethereum.Test.Base
2425
{
@@ -74,7 +75,7 @@ public static BlockHeader Convert(TestBlockHeaderJson? headerJson)
7475
StateRoot = new Hash256(headerJson.StateRoot),
7576
TxRoot = new Hash256(headerJson.TransactionsTrie),
7677
WithdrawalsRoot = headerJson.WithdrawalsRoot is null ? null : new Hash256(headerJson.WithdrawalsRoot),
77-
// BlockAccessListHash = headerJson.BlockAccessListHash is null ? null : new Hash256(headerJson.BlockAccessListHash),
78+
BlockAccessListHash = headerJson.BlockAccessListHash is null ? null : new Hash256(headerJson.BlockAccessListHash),
7879
};
7980

8081
if (headerJson.BaseFeePerGas is not null)
@@ -85,7 +86,7 @@ public static BlockHeader Convert(TestBlockHeaderJson? headerJson)
8586
return header;
8687
}
8788

88-
public static IEnumerable<(ExecutionPayloadV3, string[]?, string[]?, int, int)> Convert(TestEngineNewPayloadsJson[]? executionPayloadsJson)
89+
public static IEnumerable<(ExecutionPayloadV4, string[]?, string[]?, int, int)> Convert(TestEngineNewPayloadsJson[]? executionPayloadsJson)
8990
{
9091
if (executionPayloadsJson is null)
9192
{
@@ -98,7 +99,7 @@ public static BlockHeader Convert(TestBlockHeaderJson? headerJson)
9899
string[]? blobVersionedHashes = engineNewPayload.Params.Length > 1 ? engineNewPayload.Params[1].Deserialize<string[]?>(EthereumJsonSerializer.JsonOptions) : null;
99100
string? parentBeaconBlockRoot = engineNewPayload.Params.Length > 2 ? engineNewPayload.Params[2].Deserialize<string?>(EthereumJsonSerializer.JsonOptions) : null;
100101
string[]? validationError = engineNewPayload.Params.Length > 3 ? engineNewPayload.Params[3].Deserialize<string[]?>(EthereumJsonSerializer.JsonOptions) : null;
101-
yield return (new ExecutionPayloadV3()
102+
yield return (new ExecutionPayloadV4()
102103
{
103104
BaseFeePerGas = (ulong)Bytes.FromHexString(executionPayload.BaseFeePerGas).ToUnsignedBigInteger(),
104105
BlockHash = new(executionPayload.BlockHash),
@@ -113,7 +114,7 @@ public static BlockHeader Convert(TestBlockHeaderJson? headerJson)
113114
ReceiptsRoot = new(executionPayload.ReceiptsRoot),
114115
StateRoot = new(executionPayload.StateRoot),
115116
Timestamp = (ulong)Bytes.FromHexString(executionPayload.Timestamp).ToUnsignedBigInteger(),
116-
// BlockAccessList = executionPayload.BlockAccessList is null ? null : Bytes.FromHexString(executionPayload.BlockAccessList),
117+
BlockAccessList = executionPayload.BlockAccessList is null ? null : Bytes.FromHexString(executionPayload.BlockAccessList),
117118
BlobGasUsed = executionPayload.BlobGasUsed is null ? null : (ulong)Bytes.FromHexString(executionPayload.BlobGasUsed).ToUnsignedBigInteger(),
118119
ExcessBlobGas = executionPayload.ExcessBlobGas is null ? null : (ulong)Bytes.FromHexString(executionPayload.ExcessBlobGas).ToUnsignedBigInteger(),
119120
ParentBeaconBlockRoot = parentBeaconBlockRoot is null ? null : new(parentBeaconBlockRoot),
@@ -432,11 +433,11 @@ public static IEnumerable<BlockchainTest> ConvertToBlockchainTests(string json)
432433
string[] transitionInfo = testSpec.Network.Split("At");
433434
string[] networks = transitionInfo[0].Split("To");
434435

435-
testSpec.EthereumNetwork = SpecNameParser.Parse(networks[0]);
436+
testSpec.EthereumNetwork = LoadSpec(networks[0], testSpec.Config?.BlobSchedule);
436437
if (transitionInfo.Length > 1)
437438
{
438439
testSpec.TransitionForkActivation = TransitionForkActivation(transitionInfo[1]);
439-
testSpec.EthereumNetworkAfterTransition = SpecNameParser.Parse(networks[1]);
440+
testSpec.EthereumNetworkAfterTransition = LoadSpec(networks[1], testSpec.Config?.BlobSchedule);
440441
}
441442

442443
(string name, string category) = GetNameAndCategory(testName);
@@ -446,6 +447,22 @@ public static IEnumerable<BlockchainTest> ConvertToBlockchainTests(string json)
446447
return testsByName;
447448
}
448449

450+
private static IReleaseSpec LoadSpec(string name, Dictionary<string, BlobScheduleEntryJson>? blobSchedule)
451+
{
452+
IReleaseSpec spec = SpecNameParser.Parse(name);
453+
if (blobSchedule is null || !blobSchedule.TryGetValue(name, out BlobScheduleEntryJson? blobCount))
454+
{
455+
return spec;
456+
}
457+
458+
return new OverridableReleaseSpec(spec)
459+
{
460+
MaxBlobCount = System.Convert.ToUInt64(blobCount.Max, 16),
461+
TargetBlobCount = System.Convert.ToUInt64(blobCount.Target, 16),
462+
BlobBaseFeeUpdateFraction = System.Convert.ToUInt64(blobCount.BaseFeeUpdateFraction, 16)
463+
};
464+
}
465+
449466
private static (string name, string category) GetNameAndCategory(string key)
450467
{
451468
key = key.Replace('\\', '/');

src/Nethermind/Nethermind.Blockchain.Test/PrecompileCachedCodeInfoRepositoryTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Nethermind.Evm;
1313
using Nethermind.Evm.CodeAnalysis;
1414
using Nethermind.Evm.Precompiles;
15+
using Nethermind.Evm.State;
1516
using Nethermind.Specs.Forks;
1617
using Nethermind.State;
1718
using NSubstitute;

src/Nethermind/Nethermind.Blockchain.Test/Validators/BlockValidatorTests.cs

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
using NUnit.Framework;
1616
using System.Collections.Generic;
1717
using FluentAssertions;
18+
using Nethermind.Core.BlockAccessLists;
19+
using Nethermind.Serialization.Rlp;
1820
using Nethermind.Core.Test;
1921

2022
namespace Nethermind.Blockchain.Test.Validators;
@@ -252,15 +254,17 @@ private static IEnumerable<TestCaseData> BadSuggestedBlocks()
252254
.TestObject,
253255
parent,
254256
Substitute.For<ISpecProvider>(),
255-
"InvalidUnclesHash");
257+
"InvalidUnclesHash")
258+
{ TestName = "InvalidUnclesHash" };
256259

257260
yield return new TestCaseData(
258261
Build.A.Block
259262
.WithHeader(Build.A.BlockHeader.WithParent(parent).WithTransactionsRoot(Keccak.Zero).TestObject)
260263
.TestObject,
261264
parent,
262265
Substitute.For<ISpecProvider>(),
263-
"InvalidTxRoot");
266+
"InvalidTxRoot")
267+
{ TestName = "InvalidTxRoot" };
264268

265269
yield return new TestCaseData(
266270
Build.A.Block.WithBlobGasUsed(131072)
@@ -275,13 +279,50 @@ private static IEnumerable<TestCaseData> BadSuggestedBlocks()
275279
.TestObject,
276280
parent,
277281
new CustomSpecProvider(((ForkActivation)0, Cancun.Instance)),
278-
"InsufficientMaxFeePerBlobGas");
282+
"InsufficientMaxFeePerBlobGas")
283+
{ TestName = "InsufficientMaxFeePerBlobGas" };
279284

280285
yield return new TestCaseData(
281286
Build.A.Block.WithParent(parent).WithEncodedSize(Eip7934Constants.DefaultMaxRlpBlockSize + 1).TestObject,
282287
parent,
283288
new CustomSpecProvider(((ForkActivation)0, Osaka.Instance)),
284-
"ExceededBlockSizeLimit");
289+
"ExceededBlockSizeLimit")
290+
{ TestName = "ExceededBlockSizeLimit" };
291+
292+
yield return new TestCaseData(
293+
Build.A.Block
294+
.WithParent(parent)
295+
.WithBlobGasUsed(0)
296+
.WithWithdrawals([])
297+
.WithBlockAccessList(new())
298+
.WithEncodedBlockAccessList(Rlp.Encode(new BlockAccessList()).Bytes).TestObject,
299+
parent,
300+
new CustomSpecProvider(((ForkActivation)0, Amsterdam.Instance)),
301+
"InvalidBlockLevelAccessListHash")
302+
{ TestName = "InvalidBlockLevelAccessListHash" };
303+
304+
yield return new TestCaseData(
305+
Build.A.Block
306+
.WithParent(parent)
307+
.WithBlobGasUsed(0)
308+
.WithWithdrawals([])
309+
.WithBlockAccessList(new())
310+
.WithEncodedBlockAccessList([0xfa]).TestObject,
311+
parent,
312+
new CustomSpecProvider(((ForkActivation)0, Amsterdam.Instance)),
313+
"InvalidBlockLevelAccessList")
314+
{ TestName = "InvalidBlockLevelAccessList" };
315+
316+
yield return new TestCaseData(
317+
Build.A.Block
318+
.WithParent(parent)
319+
.WithBlobGasUsed(0)
320+
.WithWithdrawals([])
321+
.WithBlockAccessList(new()).TestObject,
322+
parent,
323+
new CustomSpecProvider(((ForkActivation)0, Osaka.Instance)),
324+
"BlockLevelAccessListNotEnabled")
325+
{ TestName = "BlockLevelAccessListNotEnabled" };
285326
}
286327

287328
[TestCaseSource(nameof(BadSuggestedBlocks))]
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited
2+
// SPDX-License-Identifier: LGPL-3.0-only
3+
4+
using Autofac.Features.AttributeFilters;
5+
using Nethermind.Core;
6+
using Nethermind.Core.BlockAccessLists;
7+
using Nethermind.Core.Crypto;
8+
using Nethermind.Db;
9+
using Nethermind.Serialization.Rlp;
10+
using Nethermind.Serialization.Rlp.Eip7928;
11+
using System;
12+
13+
namespace Nethermind.Blockchain.Headers;
14+
15+
public class BlockAccessListStore(
16+
[KeyFilter(DbNames.BlockAccessLists)] IDb balDb,
17+
BlockAccessListDecoder? decoder = null)
18+
: IBlockAccessListStore
19+
{
20+
private readonly BlockAccessListDecoder _balDecoder = decoder ?? new();
21+
22+
public void Insert(Hash256 blockHash, BlockAccessList bal)
23+
{
24+
using NettyRlpStream rlpStream = BlockAccessListDecoder.Instance.EncodeToNewNettyStream(bal);
25+
balDb.Set(blockHash, rlpStream.AsSpan());
26+
}
27+
28+
public void Insert(Hash256 blockHash, byte[] encodedBal)
29+
=> balDb.Set(blockHash, encodedBal);
30+
31+
public byte[]? GetRlp(Hash256 blockHash)
32+
=> balDb.Get(blockHash);
33+
34+
public BlockAccessList? Get(Hash256 blockHash)
35+
{
36+
ReadOnlySpan<byte> rlp = balDb.GetSpan(blockHash);
37+
return rlp.IsEmpty ? null : _balDecoder.Decode(rlp);
38+
}
39+
40+
public void Delete(Hash256 blockHash)
41+
=> balDb.Delete(blockHash);
42+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited
2+
// SPDX-License-Identifier: LGPL-3.0-only
3+
4+
using Nethermind.Core;
5+
using Nethermind.Core.BlockAccessLists;
6+
using Nethermind.Core.Crypto;
7+
8+
namespace Nethermind.Blockchain.Headers;
9+
10+
public interface IBlockAccessListStore
11+
{
12+
void InsertFromBlock(Block block)
13+
{
14+
if (block.EncodedBlockAccessList is not null)
15+
{
16+
Insert(block.Hash, block.EncodedBlockAccessList);
17+
}
18+
else if (block.BlockAccessList is not null)
19+
{
20+
Insert(block.Hash, block.BlockAccessList);
21+
}
22+
}
23+
24+
void Insert(Hash256 blockHash, byte[] bal);
25+
void Insert(Hash256 blockHash, BlockAccessList bal);
26+
byte[]? GetRlp(Hash256 blockHash);
27+
BlockAccessList? Get(Hash256 blockHash);
28+
void Delete(Hash256 blockHash);
29+
}

src/Nethermind/Nethermind.Blockchain/BlockTree.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public partial class BlockTree : IBlockTree
4444
private readonly IDb _blockInfoDb;
4545
private readonly IDb _metadataDb;
4646
private readonly IBadBlockStore _badBlockStore;
47+
private readonly IBlockAccessListStore _balStore;
4748

4849
private readonly LruCache<ValueHash256, Block> _invalidBlocks =
4950
new(128, 128, "invalid blocks");
@@ -113,6 +114,7 @@ public BlockTree(
113114
[KeyFilter(DbNames.BlockInfos)] IDb? blockInfoDb,
114115
[KeyFilter(DbNames.Metadata)] IDb? metadataDb,
115116
IBadBlockStore? badBlockStore,
117+
IBlockAccessListStore? balStore,
116118
IChainLevelInfoRepository? chainLevelInfoRepository,
117119
ISpecProvider? specProvider,
118120
IBloomStorage? bloomStorage,
@@ -126,6 +128,7 @@ public BlockTree(
126128
_blockInfoDb = blockInfoDb ?? throw new ArgumentNullException(nameof(blockInfoDb));
127129
_metadataDb = metadataDb ?? throw new ArgumentNullException(nameof(metadataDb));
128130
_badBlockStore = badBlockStore ?? throw new ArgumentNullException(nameof(badBlockStore));
131+
_balStore = balStore ?? throw new ArgumentNullException(nameof(balStore));
129132
SpecProvider = specProvider ?? throw new ArgumentNullException(nameof(specProvider));
130133
_bloomStorage = bloomStorage ?? throw new ArgumentNullException(nameof(bloomStorage));
131134
_syncConfig = syncConfig ?? throw new ArgumentNullException(nameof(syncConfig));
@@ -416,6 +419,7 @@ public AddBlockResult Insert(Block block, BlockTreeInsertBlockOptions insertBloc
416419

417420
_blockStore.Insert(block, writeFlags: blockWriteFlags);
418421
_headerStore.InsertBlockNumber(block.Hash, block.Number);
422+
_balStore.InsertFromBlock(block);
419423

420424
bool saveHeader = (insertBlockOptions & BlockTreeInsertBlockOptions.SaveHeader) != 0;
421425
if (saveHeader)
@@ -483,6 +487,7 @@ protected virtual AddBlockResult Suggest(Block? block, BlockHeader header, Block
483487
}
484488

485489
_blockStore.Insert(block);
490+
_balStore.InsertFromBlock(block);
486491
}
487492

488493
if (!isKnown)
@@ -1679,6 +1684,7 @@ public int DeleteChainSlice(in long startNumber, long? endNumber = null, bool fo
16791684
_blockInfoDb.Delete(blockHash);
16801685
_blockStore.Delete(i, blockHash);
16811686
_headerStore.Delete(blockHash);
1687+
_balStore.Delete(blockHash);
16821688
}
16831689
}
16841690
}

src/Nethermind/Nethermind.Blockchain/PrecompileCachedCodeInfoRepository.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Nethermind.Evm;
1313
using Nethermind.Evm.CodeAnalysis;
1414
using Nethermind.Evm.Precompiles;
15+
using Nethermind.Evm.State;
1516
using Nethermind.State;
1617

1718
namespace Nethermind.Blockchain;

0 commit comments

Comments
 (0)