-
Notifications
You must be signed in to change notification settings - Fork 149
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
Implementing BLOBHASH
Opcode
#2693
base: master
Are you sure you want to change the base?
Implementing BLOBHASH
Opcode
#2693
Conversation
…ment `BLOBHASH` operation
@@ -479,6 +487,7 @@ The `"rlp"` key loads the block information. | |||
=> #if ( notBool Ghasbasefee << SCHED >> ) | |||
orBool TXTYPE ==K Legacy | |||
orBool TXTYPE ==K AccessList | |||
orBool TXTYPE ==K Blob |
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 just unsure about this part. Do you have any thoughts, @anvacaru? Please see this Gas Accounting section of EIP-4844 for context.
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 seems wrong. Blob transactions are newer than DynamicFee transactions and should have the fields of all prior types, including the DynamicFee fields.
rule <k> MLOAD INDEX => #asWord(#range(LM, INDEX, 32)) ~> #push ... </k> | ||
<localMem> LM </localMem> | ||
|
||
rule <k> BLOBHASH INDEX => 0 ~> #push ... </k> |
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.
These rules seem fine but the placement of them, between MLOAD and MSTORE, seems off. I would place it next to BLOCKHASH, which it is much more similar to.
@@ -479,6 +487,7 @@ The `"rlp"` key loads the block information. | |||
=> #if ( notBool Ghasbasefee << SCHED >> ) | |||
orBool TXTYPE ==K Legacy | |||
orBool TXTYPE ==K AccessList | |||
orBool TXTYPE ==K Blob |
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 seems wrong. Blob transactions are newer than DynamicFee transactions and should have the fields of all prior types, including the DynamicFee fields.
There is one more problem. You are matching directly on the txVersionedHashes field, but this field exists inside a cell Map and you are not specifying which transaction you are accessing the hashes of, which means that if the block contains multiple transactions, you might conceivably return the hashes associated with a past or future transaction within the block. You probably want to copy the field from the transaction into the |
This PR implements the
BLOBHASH
Opcode as part of the implementation of EIP-4844.To implement this new operation, the type of
txVersionedHashes
had to be changed toList
.