-
Notifications
You must be signed in to change notification settings - Fork 854
implement oog sha3 error state #1558
implement oog sha3 error state #1558
Conversation
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 the first round of review. I added some quick feedback on nitpicks.
I noticed that we have MemoryExpandedAddressGadget, but no checks are performed.
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.
LGTM
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.
LGTM. I have a question for the trait CommonMemoryAddressGadget
@@ -61,6 +69,32 @@ pub(crate) mod address_high { | |||
} | |||
} | |||
|
|||
/// Memory address trait to adapt for right and Uint overflow cases. | |||
pub(crate) trait CommonMemoryAddressGadget<F: Field> { |
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.
Is the CommonMemoryAddessGadget trait necessary?
We only use MemoryAddressGadget for the no overflow case, and we only use MemoryExpandedAddressGadget for Sha3 oog when the overflow is possible.
In the current PR it seems the traits are not super useful as we already know the concrete struct in the function body that consumes it.
I don't plan to block the PR longer, but it would be great if you could share some of the rationale for adding the trait.
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.
the rationale is to design common methods for normal and error memory address gadget use , they both have offset
, length
etc. we can see successful opcode gadgets also use it. @ChihChengLiang does it make sense to you?
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 is also used in oog static/dynamic memory(Kimi working on it) error cases etc.cases
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.
Thanks for sharing the rationale. I think it makes sense to me.
5d01150
### Description implement ErrorOutOfGasCREATE error gadget, relies on PR #1558, only can be ready after that pr merged. ### Issue Link closed [#1522](#1522) ### Type of change - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update This PR contains: - oog create/create2 both use OOG::Create - circuit for oog create - tests for create/tx deploy cases --------- Co-authored-by: Zhang Zhuo <mycinbrin@gmail.com>
Description
implement oog sha3 error state
Issue Link
Type of change
This PR contains: