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.
Implements: https://eips.ethereum.org/EIPS/eip-7708
Open questions:
Missing definitions
Magic
was not defined in EIP, I have set a placeholder forMagic
as the hash of0000...000000000
as proposed hereAddress
is also not defined in EIP, I have set placeholder0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE
as proposed hereCREATE
is called?"Stuff" I'm unsure about
From EIP:
Q1
"value-transferring transaction" - is this just EOA to EOA transfer? (eg. Bob directly transferred 1 ETH to Alice)
Q2
This one is about adding logs in the proper place.
I think I placed
SELF_DESTRUCT
appropriately. But I'm unsure about handlingCALL
and "value-transferring tx"This is my understanding of transaction execution flow (is this OK?):
My understanding is that we potentially have 3 options for placing logs:
TransitionDb
: Not OK, because we cannot handleSELF_DESTRUCT
here (since we don't know contract balance) and doesn't satisfy EIP requirement "...The other two LOGs are placed when the value transfer executes."Transfer
(core/evm.go
): Not ok becauseSELF_DESTRUCT
doesn't call this function - but I'm unsure why. Can we refactor bothopSelfdestruct
andopSelfdestruct6780
, especially sinceopSelfdestruct6780
does the same steps asTransfer
and have logs created inTransfer
?CALL
and "value-transferring tx" at the same place, andSELF_DESTRUCT
is handled specially)Q3
EIP activation - how to choose when EIP will be activated, especially given this is code aimed at rollups.
Q4
What are the usual test practices? I found no log-specific tests (apart from marshaling/unmarshalling). Is mocking
StateDB
and the op-codes the best way to go?