-
Notifications
You must be signed in to change notification settings - Fork 479
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
Add Eof Execution EIP-7692 (EIP-663, EIP-3540, EIP-3670, EIP-4200, EIP-4750, EIP-5450, EIP-6206, EIP-7069, EIP-7480, EIP-7620, EIP-7698, EIP-7756) #8176
base: master
Are you sure you want to change the base?
Conversation
* alot of fixes to stack validation and other fixes
- jump stack validation - Data opcodes (datacopy mistake in gas calculation
- new HeaderParsing Method (loop + swtich)
@@ -13,6 +13,7 @@ | |||
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.5.0" /> | |||
<PackageVersion Include="Ckzg.Bindings" Version="2.0.1.1258" /> | |||
<PackageVersion Include="Colorful.Console" Version="1.2.15" /> | |||
<PackageVersion Include="CommandLineParser" Version="2.9.1" /> |
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 is redundant. We already use the same CLI parser for everything else.
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.
A few remarks. I love both, the direction and the execution. Long live the delegate*
calls!
@@ -431,5 +437,9 @@ public interface IReleaseSpec : IEip1559Spec, IReceiptSpec | |||
bool IsAuthorizationListEnabled => IsEip7702Enabled; | |||
|
|||
public bool RequestsEnabled => ConsolidationRequestsEnabled || WithdrawalRequestsEnabled || DepositsEnabled; | |||
|
|||
public object? EvmInstructions { get; set; } |
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.
Could we have some comments here? What kind of object is it etc?
|
||
public object? EvmInstructions { get; set; } | ||
|
||
public object? EvmTracedInstructions { get; set; } |
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.
Same as above? Maybe refer to Trace, NoTrace?
@@ -20,6 +20,7 @@ namespace Nethermind.Core | |||
[DebuggerDisplay("{Hash}, Value: {Value}, To: {To}, Gas: {GasLimit}")] | |||
public class Transaction | |||
{ | |||
public byte[] EofMagic = [0xEF, 0x00]; |
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.
public byte[] EofMagic = [0xEF, 0x00]; | |
public static ReadOnlyMemory<byte> EofMagic => [0xEF, 0x00]; |
stuff?
deployingAddress.Bytes.CopyTo(bytes.Slice(1, 20)); | ||
salt.CopyTo(bytes.Slice(21, salt.Length)); | ||
ValueKeccak.Compute(initCode).BytesAsSpan.CopyTo(bytes.Slice(21 + salt.Length, 32)); | ||
deployingAddress.Bytes.CopyTo(bytes.Slice(1, Address.Size)); |
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.
Thank you for removing magic 🙇
} | ||
private static void WaitForAnalysisToComplete(ManualResetEventSlim resetEvent) | ||
{ | ||
Thread thread = Thread.CurrentThread; |
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 was the scoping mechanism elsewhere. Can't we do using var priority = ...
here?
|
||
for (int i = 0; i < lookup.Length; i++) | ||
{ | ||
lookup[i] = &InstructionBadInstruction; |
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.
Awesome!
lookup[(int)Instruction.BYTE] = &InstructionByte; | ||
|
||
// Conditional: enable shift opcodes if the spec allows. | ||
if (spec.ShiftOpcodesEnabled) |
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.
Are you saying you extracted all spec
checks? ❤️
_codeInfoRepository.InsertCode(WorldState, code, env.ExecutingAccount, spec); | ||
|
||
unspentGas -= codeDepositGasCost; | ||
} | ||
} | ||
|
||
if (tx.IsEofContractCreation) |
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.
Extract method? Gets really big.
|
||
namespace Nethermind.Evm; | ||
|
||
public interface IFlag |
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.
As you generalized on/off using generic parameter trick, should it be commented for future generations how and why to use it?
debugger?.TryWait(ref _vmState, ref programCounter, ref gasAvailable, ref stack.Head); | ||
#endif | ||
// Fetch the current instruction from the code section. | ||
Instruction instruction = codeSection[programCounter]; |
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'm not sure this can be trusted. You removed so much of the beautiful code that was here and all we're left is an array lookup... On a serious note: beautiful 😍
Closes #4584
Closes #4586
Closes #4906
Closes #4907
Closes #4956
Changes
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.