-
Notifications
You must be signed in to change notification settings - Fork 720
Implement Block-level access lists (EIP-7928) #10357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 250 commits
Commits
Show all changes
337 commits
Select commit
Hold shift + click to select a range
c3d5970
Merge remote-tracking branch 'upstream/master' into feature/block-lev…
Marchhill aceb9e0
check for null traced access worldstate
Marchhill 5b016d0
fix hash calc
Marchhill 95a5da7
disable in chainspec params test
Marchhill f05fcd7
bal snapshot fix
Marchhill 31fdc5d
fix hash match check
Marchhill f3df8ba
remove comments
Marchhill 4bd3960
Merge remote-tracking branch 'upstream/master' into feature/block-lev…
Marchhill ad7d5c8
null hash for empty access lsit
Marchhill e2643aa
amsterdam fork
Marchhill cf9629e
add bal to block & header decoder, store encoded bal in block, update…
Marchhill 894f5c8
string encoding
Marchhill bdd2448
fix decoding
Marchhill ef6f37b
improve encoding test
Marchhill dc8122c
fix encoding, add tests
Marchhill 50ab9c1
refactor bal encoding test
Marchhill d067106
code changes test
Marchhill e3d9fb5
don't use hash of storage index
Marchhill 5394826
don't add redundant reads
Marchhill 92c7d5a
add new fields to blockchain tests
Marchhill eacf617
Merge remote-tracking branch 'upstream/master' into feature/block-lev…
Marchhill 1d6e8da
tidy code
Marchhill 2d3a412
add blockchain engine test support
Marchhill 2665f0e
tidy test base
Marchhill 19694c2
fix engine test loading, different versions
Marchhill d6fc96d
only set hash if bals enabled
Marchhill 93e823f
fix loading older engine tests
Marchhill ce700c2
fix BAL decoding in execution payload
Marchhill 94cda6a
formatting
Marchhill 57437f6
fix normal blockchain tests
Marchhill b3725c3
set to empty block access list hash if not enabled
Marchhill 31b2424
move to newpayloadv5
Marchhill 878b787
trace get account balance
Marchhill 89bf5f9
codehash
Marchhill c046b92
create account & selfdestruct edge cases
Marchhill f936546
try only setting null hash when enabled
Marchhill be3fd21
undo
Marchhill 455efa7
try only setting null hash when enabled
Marchhill c77d2ee
undo
Marchhill 29537bb
set genesis bal hash in chainspec loader
Marchhill f0863b4
always set bal hash
Marchhill 6ed885f
add to chainspecbasedprovider
Marchhill cdcf39b
set to empty hash if genesis
Marchhill ccfac26
don't record balance change for unchanged balance change in account
Marchhill 6cd23a5
check enabled for traced access world state
Marchhill 16638b0
precompile handling
Marchhill 0d1d43a
don't add empty bal hash to genesis when disabled
Marchhill 9c38e80
add 7702 authority on failed delegation
Marchhill a714e19
engine rpc amsterdam
Marchhill ba184ff
comment logs
Marchhill f07ad62
fix 7702 failed delgation edge case
Marchhill e15eb98
fix blockchain test runner
Marchhill 64ca3ee
allow null BAL in execution payload
Marchhill 3bd0119
amsterdam chainspec
Marchhill 9bd657c
Merge remote-tracking branch 'upstream/master' into bal-devnet-0
Marchhill 7a3c5e5
encode BAL in payload if not already encoded
Marchhill bea57ae
package lock
Marchhill 5a56c5f
disable warning temporarily
Marchhill 54a00d5
fix block building
Marchhill 32b91d9
add encoding and decoding logs tmp
Marchhill 0c23e49
improve logs for degbugging
Marchhill b9fba1f
fix bal index for building & decoding index 0
Marchhill 8087b86
reset block access index
Marchhill cfad062
try to fix invalid hash, add logs
Marchhill 601db9e
remove log
Marchhill c774422
log encoding balance changes
Marchhill 2668013
try fix ushort decoding, save encoded bal
Marchhill 30b6f29
try fix account changes in wrong order error
Marchhill 96bdd95
coinbase zero transfer edge case
Marchhill e461a6c
code change max increase
Marchhill 7352691
Merge remote-tracking branch 'upstream/master' into bal-devnet-0
Marchhill cc7e07c
enforce rlp buffer size limits
Marchhill 36937cd
fix test runners
Marchhill 78d054e
fix restore
Marchhill 074a9e7
fix reverting storage change
Marchhill 81f3d0f
add account read for extcodecopy
Marchhill bc43434
don't add for extcodecopy when oog
Marchhill 872ff02
fix engine test runner
Marchhill c3b9447
refactor test runner
Marchhill f9ff97a
don't record storage change if resets to same value
Marchhill 88ae970
remove storage changes if empty
Marchhill 4023bc2
fix storage changes
Marchhill 77c7130
only add read if write not present
Marchhill a6081ae
fix error message
Marchhill 41e689d
add changes when resetting to og value
Marchhill bd76f9d
change comparison, add logging
Marchhill eb23d61
more logging
Marchhill e314c75
even more logging
Marchhill 8f5604e
use sequenceequal
Marchhill 689f10c
check for previous code deployed being the same
Marchhill 5536c3d
record more account accesses
Marchhill 8d63f4d
extcodesize
Marchhill e7b662d
fix tracing
Marchhill 80cadec
remove console logs
Marchhill 23171a3
remove coinbase edge case
Marchhill d8ac0ea
Merge remote-tracking branch 'upstream/master' into bal-devnet-0-test
Marchhill fe46806
bpo forks
Marchhill 246ff27
base fee update fractions
Marchhill 359df9c
add bpos to spec name parser
Marchhill 4cb4f45
Merge remote-tracking branch 'upstream' into bal-devnet-0-test
Marchhill e09553b
change blockchain tests
Marchhill 8f7c3b1
fix setnonce tracing
Marchhill e4718eb
add storage slot to changes in edge case
Marchhill e3d4308
generatedblockaccesslist for debugging
Marchhill b0dd675
add testing log for decoding
Marchhill 1f064b7
try adding sequence length in block encoding
Marchhill 9da9946
try block decoding fix
Marchhill 0730d44
try fix bal json serialisation
Marchhill d4555b6
refactor
Marchhill 5a4fd75
debug assert fail for unreachable codde
Marchhill 3441a90
remove code change diff check
Marchhill df5a82d
string encoding use json
Marchhill 692e22b
fix: check count empty when checking if storage changed
Marchhill afbfee9
Merge remote-tracking branch 'upstream/master' into bal-devnet-0-test-2
Marchhill 47cb345
fix merge
Marchhill 8cf31e6
fix json serialisation
Marchhill 391c817
fix suggested & generated
Marchhill d38c6ba
fix check code change
Marchhill 6fffe33
blockchain test blob schedule load
Marchhill d74a4b8
nonce change on account creation
Marchhill 84c1157
debugging logs for blob schedule
Marchhill befc83a
fix compile
Marchhill 5d98db8
more logs
Marchhill ebb5b77
try basing amsterdam on osaka
Marchhill 1c76673
undo change
Marchhill ee35d5f
print HIVE vars
Marchhill 0a066b4
new blobschedule log
Marchhill 7f6ab10
override to 6/9
Marchhill 3fb5f65
check of code has changed during tx
Marchhill c8ed3d2
include system address balance change
Marchhill c2b7c0a
fix adding back storage read, handling of system account
Marchhill e90fce7
undo bpo override
Marchhill b357c93
move delegation check later call
Marchhill 2063877
remove extra logs
Marchhill 911c4a6
Merge branch 'master' of github.com:NethermindEth/nethermind into bal…
Marchhill 70d2afb
set balance to 0 on selfdestruct
Marchhill 43d2e73
copy generatedbal to suggested block
Marchhill 4c78c3b
Fix cross-block state leak of `_parityTouchBugAccount.ShouldDelete` f…
qu0b aeb8a73
codecopy fix
Marchhill 01c5761
Merge branch 'bal-devnet-0' of github.com:NethermindEth/nethermind in…
Marchhill 030a214
move generatedBAL to top level
Marchhill b963b7a
getter for generatedBAL
Marchhill cb15cef
change storage keys and values to UInt256
Marchhill 5c57c15
fix conversion to uint256
Marchhill cae8a54
delay charge create gas call
Marchhill b4ff262
add slot changes if not present on restore
Marchhill 5c0cf14
tidy
Marchhill 86b869c
OOG if not enough gas for self-destruct (#10064)
fselmo 6d4715c
Merge branch 'bal-devnet-1' of github.com:NethermindEth/nethermind in…
Marchhill 58f9442
remove bal from block body
Marchhill f084da7
bal store
Marchhill e8bf5fd
add engine api endpoints
Marchhill c3ec66d
add new handlers
Marchhill c154bf3
fix DI
Marchhill 46bfcfe
add debug endpoitn
Marchhill c12c252
make shareable
Marchhill 1f826bc
change attributes
Marchhill cb83d90
getbal test
Marchhill 6963fed
fix encoding
Marchhill 94519bb
insert in bal store on suggest
Marchhill 342a3f5
move to executionpayloadv4
Marchhill 8447cb3
getpayloadv6
Marchhill 4acd687
osaka engine api version
Marchhill 3c64f20
getpayloadv6 DI
Marchhill 9874c30
use executionpayloadv4 in blockchain tests
Marchhill dca3296
fix removing storage read on revert, copy across BAL from suggested f…
Marchhill e479770
Bal devnet 2 fixes (#10293)
benaadams 37e891c
Bal devnet 2 merge (#10297)
benaadams 5326cc5
goto outofgas selfdestruct
Marchhill f639b70
fix call delegation access
Marchhill 2766fb8
fix call gas charging
Marchhill eaf3efb
move new account charge in call
Marchhill 7a78b71
add bal hash to rpc
Marchhill abf1b07
rename to parallelworldstate
Marchhill 38c28af
Merge remote-tracking branch 'upstream/master' into bal-devnet-2
Marchhill 3f9f1f6
fix merge conflict testsourceloader
Marchhill 810e247
fix packages lock
Marchhill 165aa66
add trie back to packages lock
Marchhill 175959f
fix gnosis config
Marchhill 17aef0b
fix testsouceloader
Marchhill 3db161c
bal builder refactor
Marchhill 20473ca
remove block size validation check
Marchhill 1f4aa82
use sortedlist for storage changes
Marchhill 4c28ad6
formatting
Marchhill ef7df4a
move tests
Marchhill 8ec3a96
fix slot changes encoder
Marchhill e2e0526
fix encoding test
Marchhill 5062607
code tests
Marchhill ec57526
improve tests
Marchhill 22ee2d9
change bal to class, fix epv4, test fixes
Marchhill 689db35
tidy tests
Marchhill b11746a
block building test, build.a.bal
Marchhill d4ed88a
use fcu in block building test, update year
Marchhill 6a2fada
rpc changes
Marchhill b2dc766
fix engine rpc method, eth error codes
Marchhill 24ebfd6
enginerpc and eth tests
Marchhill bbfd4b9
add tx to block building test
Marchhill 01d6a04
should_process test and e2e new payload test
Marchhill 1865a99
finish newpayload test
Marchhill 890c65c
copy over validation & test changes
Marchhill aab6cee
fix block bal validation
Marchhill 1874fc9
early bal invalidation
Marchhill d14d056
early read validation
Marchhill 8e76723
ext opcode tests
Marchhill 289e834
add evm tests
Marchhill 251b435
precompile test
Marchhill 5269549
call test
Marchhill 6eea214
other call tests
Marchhill 42ac77e
delegated account test
Marchhill a914b0c
initial oog tests
Marchhill 7640f92
complete pre-state access oog tests
Marchhill 92ae805
complete post-state access oog tests
Marchhill d8550f3
stack underflow tests
Marchhill 9502f9b
revert_with_return_to_original
Marchhill e319c26
more evm tests
Marchhill 43303bd
incorrect order decoding tests
Marchhill 882de9b
optimise remove allocations
Marchhill ec86fdf
unreachable exceptions
Marchhill aefffe9
clear BAL, code change reduce allocation
Marchhill f67b74b
filter post execution reads in storage read gas check
Marchhill 96ad72d
Merge remote-tracking branch 'upstream/master' into bal-devnet-2-bals…
Marchhill f72fd5d
tidy
Marchhill 8d7a0c8
fix aura tests
Marchhill 0471b85
Merge remote-tracking branch 'upstream/master' into bal-devnet-2-bals…
Marchhill bfa5cd0
fix tests
Marchhill ecdbd1c
tidy
Marchhill e42e6d5
check balbuilder not null when tx processing
Marchhill 6d495da
Update src/Nethermind/Ethereum.Test.Base/JsonToEthereumTest.cs
Marchhill 3fabee2
Update src/Nethermind/Ethereum.Test.Base/JsonToEthereumTest.cs
Marchhill de48b8c
Update src/Nethermind/Ethereum.Test.Base/FileTestsSource.cs
Marchhill df2e1dd
Fix tests - remove console output and move converters back
flcl42 60d6f2a
Merge remote-tracking branch 'origin/master' into bal-devnet-2-bals-only
flcl42 ff97728
Consider another override; scan more; account for Skipped in block bu…
flcl42 cbf9912
Use records; clean up
flcl42 58ab5a7
Less heap alloc; check rlp
flcl42 274638f
Merge remote-tracking branch 'origin/master' into bal-devnet-2-bals-only
flcl42 d46e218
review comments
Marchhill 9c3e5d0
Merge remote-tracking branch 'upstream/master' into bal-devnet-2-bals…
Marchhill c2c7ce5
fix rlp
Marchhill fa539a7
fix aura test, blockchain test blob schedule loader
Marchhill 767f78a
tidy
Marchhill 3ac9c84
Merge remote-tracking branch 'upstream/master' into bal-devnet-2-bals…
Marchhill 0fe07a6
fix some commetns
Marchhill b859b07
inherit invalidblockexception
Marchhill 8357110
move addaccountread to extension, tidy delegation handling
Marchhill 3a7b32b
encapsulate setting bal
Marchhill 57c7244
Merge remote-tracking branch 'upstream/master' into bal-devnet-2-bals…
Marchhill a21b883
get tests passing
Marchhill dd11695
Merge remote-tracking branch 'upstream/master' into bal-devnet-2-bals…
Marchhill aa45ba0
refactor BlockProcessor
LukaszRozmej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,7 @@ | |
| "autofac", | ||
| "autogen", | ||
| "auxdata", | ||
| "BALS", | ||
| "badreq", | ||
| "barebone", | ||
| "baseblock", | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/Nethermind/Nethermind.Blockchain/BlockAccessLists/BlockAccessListStore.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| // SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited | ||
| // SPDX-License-Identifier: LGPL-3.0-only | ||
|
|
||
| using Autofac.Features.AttributeFilters; | ||
| using Nethermind.Core; | ||
| using Nethermind.Core.BlockAccessLists; | ||
| using Nethermind.Core.Crypto; | ||
| using Nethermind.Db; | ||
| using Nethermind.Serialization.Rlp; | ||
| using Nethermind.Serialization.Rlp.Eip7928; | ||
|
|
||
| namespace Nethermind.Blockchain.Headers; | ||
|
|
||
| public class BlockAccessListStore( | ||
| [KeyFilter(DbNames.BlockAccessLists)] IDb balDb, | ||
| BlockAccessListDecoder? decoder = null) | ||
| : IBlockAccessListStore | ||
| { | ||
| private readonly BlockAccessListDecoder _balDecoder = decoder ?? new(); | ||
|
|
||
| public void Insert(Hash256 blockHash, BlockAccessList bal) | ||
| => balDb.Set(blockHash, Rlp.Encode(bal).Bytes); | ||
|
flcl42 marked this conversation as resolved.
Outdated
|
||
|
|
||
| public void Insert(Hash256 blockHash, byte[] encodedBal) | ||
| => balDb.Set(blockHash, encodedBal); | ||
|
|
||
| public byte[]? GetRlp(Hash256 blockHash) | ||
| => balDb.Get(blockHash); | ||
|
|
||
| public BlockAccessList? Get(Hash256 blockHash) | ||
| { | ||
| byte[]? rlp = balDb.Get(blockHash); | ||
| return rlp is null ? null : _balDecoder.Decode(rlp); | ||
| } | ||
|
|
||
| public void Delete(Hash256 blockHash) | ||
| => balDb.Delete(blockHash); | ||
| } | ||
19 changes: 19 additions & 0 deletions
19
src/Nethermind/Nethermind.Blockchain/BlockAccessLists/IBlockAccessListStore.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| // SPDX-FileCopyrightText: 2026 Demerzel Solutions Limited | ||
| // SPDX-License-Identifier: LGPL-3.0-only | ||
|
|
||
| using System; | ||
| using System.Collections.Generic; | ||
| using Nethermind.Core; | ||
| using Nethermind.Core.BlockAccessLists; | ||
| using Nethermind.Core.Crypto; | ||
|
|
||
| namespace Nethermind.Blockchain.Headers; | ||
|
|
||
| public interface IBlockAccessListStore | ||
| { | ||
| void Insert(Hash256 blockHash, byte[] bal); | ||
| void Insert(Hash256 blockHash, BlockAccessList bal); | ||
| byte[]? GetRlp(Hash256 blockHash); | ||
| BlockAccessList? Get(Hash256 blockHash); | ||
| void Delete(Hash256 blockHash); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.