-
Notifications
You must be signed in to change notification settings - Fork 50
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
Feature/oog #74
Feature/oog #74
Conversation
laisolizq
commented
May 26, 2022
- check out of gas
- check stack over flow (it will be necessary to update this)
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.
💯
@@ -12,13 +12,15 @@ opSTOP: | |||
GAS + B => GAS | |||
$ => SP :MLOAD(lastSP) | |||
$ => PC :MLOAD(lastPC) | |||
1 :MSTORE(SP++) ; // TODO: call to an EOA address, what is going on ? | |||
1 :MSTORE(SP++) |
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.
Remove comments at the beginning of the file
main/opcodes.zkasm
Outdated
:JMP(readCode) | ||
|
||
opSTOPend: | ||
:JMP(endCode) | ||
|
||
opADD: | ||
SP - 2 :JMPN(stackOverflow) |
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 error should be renamed to: stackUnderflow
And just add the label stackUnderflow
just above stackOverflow
since the routine would be exactly the same.
This apply for the rest of this errors
:JMP(sendGasSeq) | ||
|
||
stackOverflow: |
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.
Ethereum yellow paper quotation:
if the execution halts in an exceptional
fashion (i.e. due to an exhausted gas supply, stack underflow, invalid jump destination or invalid instruction), then
no gas is refunded to the caller and the state is reverted to
the point immediately prior to balance transfer (i.e.
main/utils.zkasm
Outdated
:JMP(stackOverflow) | ||
|
||
stackOverflowEnd: |
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.
Stack overflow
could be check by doing a recursive function: https://stackoverflow.com/questions/70315824/solidity-stack-limit-reached-10241023-when-trying-to-burnStack underflow
could be checked by trying topop
a variable when it does not exist (source: https://medium.com/hackernoon/how-to-debug-ethereum-smart-contracts-7efd883d8cc3)
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 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.
😸
Add on step for unsigned transactions