-
Notifications
You must be signed in to change notification settings - Fork 428
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
EIP-7702 and EIP-7251 #7459
base: pectra_payload_bodies
Are you sure you want to change the base?
EIP-7702 and EIP-7251 #7459
Conversation
…ethermind into feature/eip-7702
src/Nethermind/Nethermind.Core/ConsensusRequests/ConsensusRequest.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Benchmark/Core/CodeInfoRepositoryBenchmark.cs
Outdated
Show resolved
Hide resolved
|
||
requestsList.AddRange(_depositsProcessor.ProcessDeposits(block, receipts, spec)); | ||
requestsList.AddRange(_withdrawalRequestsProcessor.ReadWithdrawalRequests(block, state, spec)); | ||
using ArrayPoolList<ConsensusRequest> requestsList = new(receipts.Length * 2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to initialize capacity with block.Requests.Length
Receipts are only relevant for Deposits
cc: @LukaszRozmej
private AuthorizationTuple[] Tuples100; | ||
private AuthorizationTuple[] Tuples1k; | ||
|
||
private CodeInfoRepository sut; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cosmetic, but weird variable name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
abbreviation for "system under test": https://learn.microsoft.com/en-us/archive/blogs/ploeh/naming-sut-test-variables
src/Nethermind/Nethermind.Evm.Benchmark/MultipleUnsignedOperations.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Evm.Benchmark/StaticCallBenchmarks.cs
Outdated
Show resolved
Hide resolved
@@ -137,12 +137,20 @@ protected EthereumTestResult RunTest(GeneralStateTest test, ITxTracer txTracer) | |||
|
|||
Block block = Build.A.Block.WithTransactions(test.Transaction).WithHeader(header).TestObject; | |||
|
|||
bool isValid = _txValidator.IsWellFormed(test.Transaction, spec) && IsValidBlock(block, specProvider); | |||
bool blockIsValid = IsValidBlock(block, specProvider); | |||
ValidationResult txIsValid = _txValidator.IsWellFormed(test.Transaction, spec); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling BlockValidator should be enough and could replace those two lines:
bool blockIsValid = IsValidBlock(block, specProvider);
ValidationResult txIsValid = _txValidator.IsWellFormed(test.Transaction, spec);
src/Nethermind/Nethermind.Consensus/Processing/RecoverSignature.cs
Outdated
Show resolved
Hide resolved
if (!tx.HasAuthorizationList) | ||
return AcceptTxResult.Accepted; | ||
|
||
Metrics.PendingTransactionsWithExpensiveFiltering++; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This metric is incorrect here, as it counts transactions that reach the expensive filtering in TxPool. For SetCode transactions, we end up counting one transaction twice.
I think having a separate metric would be a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already Metrics.Eip7702TransactionsInBlock
so maybe this one should just be removed?
src/Nethermind/Nethermind.TxPool/Filters/RecoverAuthorityFilter.cs
Outdated
Show resolved
Hide resolved
@@ -282,3 +310,42 @@ public sealed class SignatureTxValidator : BaseSignatureTxValidator | |||
public static readonly SignatureTxValidator Instance = new(); | |||
private SignatureTxValidator() { } | |||
} | |||
|
|||
public sealed class SetCodeTxValidator : ITxValidator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that this validation is being omitted in the BlockProductionTransactionPicker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont see the TxValidator checks being used there, maybe because the logic is that picked tx comes from TxPool
?
src/Nethermind/Nethermind.Evm.Benchmark/MultipleUnsignedOperations.cs
Outdated
Show resolved
Hide resolved
@@ -78,6 +79,18 @@ public void RecoverData(Block block) | |||
{ | |||
tx.SenderAddress = sender; | |||
|
|||
if (tx.HasAuthorizationList) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MarekM25 please take another look at RecoverSignatures
. I have fixed an oversight here.
…ermindeth/nethermind into pectra_fix_7702_after_merge
https://eips.ethereum.org/EIPS/eip-7702
https://eips.ethereum.org/EIPS/eip-7251 (consolidations)
Changes
Adds an authorization_list to tx that is used to set delegations on EOAs in the form of
0xef0100 || address
When the EOA is called it is delegated to the
address
, in similar fashion as aDELEGATECALL
.EVM opcodes like
EXTCODESIZE
,EXTCODECOPY
etc. are affected by a delegation.Other things to note:
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Optional. Remove if not applicable.
Documentation
Requires documentation update
If yes, link the PR to the docs update or the issue with the details labeled
docs
. Remove if not applicable.Requires explanation in Release Notes
If yes, fill in the details here. Remove if not applicable.
Remarks
Optional. Remove if not applicable.