-
Notifications
You must be signed in to change notification settings - Fork 487
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
Implement EIP-7805 (FOCIL) #8003
base: master
Are you sure you want to change the base?
Conversation
src/Nethermind/Nethermind.Consensus/Producers/BlockProducerEnvFactory.cs
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus/Producers/PayloadAttributes.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus/Transactions/InclusionListTxSource.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus/Validators/IInclusionListValidator.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Merge.Plugin/Handlers/EngineRpcCapabilitiesProvider.cs
Outdated
Show resolved
Hide resolved
{ | ||
// todo: limit size of IL? | ||
IEnumerable<Transaction> txs = inclusionListTxSource.GetTransactions(blockTree.Head!.Header, long.MaxValue); | ||
byte[][] txBytes = [.. txs.Select(tx => Rlp.Encode(tx).Bytes)]; |
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.
We could potentially use ArrayPoolList to avoid allocation, ResultWrapper
should Dispose it correctly after being serialized.
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.
Since we're returning the bytes I don't see that we can use ArrayPoolList here, maybe I'm missing something?
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.
you can return ArrayPoolList<byte[]>
, you could return ArrayPoolList<ArrayPoolList> even.
Also Rlp.Encode
is potentially not the best either due to allocations.
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.
If I returned this then I would have to have ArrayPoolList<byte[]>
as the return value in the engine api signature, this seems wrong to me, you think it's ok?
I don't know of a way to encode without allocating so if I did something like ArrayPoolList<ArrayPoolList<byte>>
then I would have to allocate anyway and then use ToPooledList()
src/Nethermind/Nethermind.Merge.Plugin/Handlers/NewPayloadHandler.cs
Outdated
Show resolved
Hide resolved
src/Nethermind/Nethermind.Consensus/Validators/InclusionListValidator.cs
Outdated
Show resolved
Hide resolved
continue; | ||
} | ||
|
||
bool couldIncludeTx = _transactionProcessor.BuildUp(tx, new(block.Header, spec), NullTxTracer.Instance); |
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.
Would be probably good to Snapshot and Revert WorldState?
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 don't think it needs to be reset as there is this bit in the EIP:
Also note that we do not need to reset the state to S, since the only way for a transaction to alter the state is for it to execute successfully, in which case the block is invalid, and so the block will not be applied to the state.
Also with BuildUp
the new state is uncommitted so should be reverted right?
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.
Need to double check. Comment from EIP doesn't have to work well with Nethermind as we have a bit different way of operating on state.
Changes
engine_getInclusionList
PayloadAttributes
andnewPayload
parametersTypes of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Documentation
Requires documentation update
Requires explanation in Release Notes