-
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/fix rlp push0 #286
Changes from 2 commits
d77f64a
a273144
04c8a1a
2c9cca7
a23dc63
b35e5a4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,15 @@ | |
* - stack input: none | ||
* - stack output: [pushed_value] | ||
*/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment applies to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree !! We will add specific comment for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also you need a newer link https://www.evm.codes/#5f?fork=shanghai |
||
|
||
opPUSH0: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it not consume any ZK counters? I would think that gas check at stack check do. Even POP requires 100 steps. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we would add them |
||
; check out-of-gas | ||
GAS - %GAS_QUICK_STEP => GAS :JMPN(outOfGas) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. lint: align with following instructions |
||
; store stack output | ||
0 :MSTORE(SP++); [0 => SP] | ||
; check stack overflow | ||
%CALLDATA_OFFSET - SP :JMPN(stackOverflow, readCode) | ||
|
||
opPUSH1: | ||
; number of bytes to push to D | ||
1 => D | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -872,10 +872,13 @@ SHLarithfinal: | |
|
||
; out of counters full tracer event trigger | ||
outOfCountersStep: | ||
$ :MLOAD(isLoadRLP),JMPNZ(handleOOCSatRLP) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think adding this check only once at There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and add |
||
$${eventLog(onError, OOCS)} :JMP(handleBatchError) | ||
outOfCountersKeccak: | ||
$ :MLOAD(isLoadRLP),JMPNZ(handleOOCKatRLP) | ||
$${eventLog(onError, OOCK)} :JMP(handleBatchError) | ||
outOfCountersBinary: | ||
$ :MLOAD(isLoadRLP),JMPNZ(handleOOCBatRLP) | ||
$${eventLog(onError, OOCB)} :JMP(handleBatchError) | ||
outOfCountersMemalign: | ||
$${eventLog(onError, OOCM)} :JMP(handleBatchError) | ||
|
@@ -1153,6 +1156,7 @@ finalPush: | |
VAR GLOBAL tmpVarDaddB | ||
VAR GLOBAL tmpZkPCaddB | ||
VAR GLOBAL auxBytes | ||
VAR GLOBAL auxLengthBytes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not only used in this function, so this global variable should be in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can compute in
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
;@info: adds data to batchHashdata byte by byte | ||
;@in: A: bytes to add | ||
;@in D: bytes length | ||
|
@@ -1161,6 +1165,7 @@ addBatchHashByteByByte: | |
RR :MSTORE(tmpZkPCaddB) | ||
A :MSTORE(auxBytes) | ||
D :MSTORE(tmpVarDaddB) | ||
D :MSTORE(auxLengthBytes) | ||
1 => D | ||
|
||
utilsAddBatchHashBytebyByteLoop: | ||
|
@@ -1174,6 +1179,8 @@ utilsAddBatchHashBytebyByteLoop: | |
D => B | ||
; add last byte to batchHashData | ||
1 => D :CALL(addBatchHashData); in:[D: length of the hash] | ||
$ => D :MLOAD(auxLengthBytes) | ||
D - 1 :MSTORE(auxLengthBytes) | ||
; check loop | ||
B => D | ||
; D + 1 => D, we set 33 instead of 32 to earn 1 step | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,4 +90,5 @@ VAR CTX salt ; CREATE2 parameter 'salt' used to compute new contract address | |
VAR CTX gasCTX ; remaining gas in the origin CTX when a new context is created | ||
VAR CTX dataStarts; hash position where de transaction 'data' starts in the batchHashData | ||
VAR CTX isPreEIP155 ; flag to check if the current tx is legacy, previous to Spurious Dragon (EIP-155) | ||
VAR CTX initTouchedSR ; touched root once a new context begins | ||
VAR CTX initTouchedSR ; touched root once a new context begins | ||
VAR CTX isLoadRLP ; flag to determine if the function is called from RLP loop | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change to isLoadingRLP or isProcessingRLP. |
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 var now is of type CTX. We have to options:
loadTx_rlp
: this way, all the CTX are set to 0txLoopRLP
The current situation is that we are only setting the flag to 0 for the last processed context