Skip to content

Commit

Permalink
fixes identity and not set CTX to 0
Browse files Browse the repository at this point in the history
  • Loading branch information
krlosMata committed Feb 7, 2023
1 parent 9ea22fe commit 5d164c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions main/end.zkasm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
finalWait:
${beforeLast()} :JMPN(finalWait)
; Set all registers to 0 except inputs: B (oldstateRoot), C (oldAccInputHash), SP (oldNumBatch) & GAS (chainID)
0 => A, D, E, CTX, PC, MAXMEM, SR, HASHPOS, RR, RCX :JMP(start)
; Set all registers to 0 except inputs: B (oldstateRoot), C (oldAccInputHash), SP (oldNumBatch), GAS (chainID) & CTX (forkID)
0 => A, D, E, PC, MAXMEM, SR, HASHPOS, RR, RCX :JMP(start)
5 changes: 3 additions & 2 deletions main/precompiled/identity.zkasm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ IDENTITY:
GAS - %IDENTITY_WORD_GAS*A => GAS :JMPN(outOfGas)
CTX :MSTORE(currentCTX)
CTX => A
$ => CTX :MLOAD(originCTX), JMPZ(handleGas)
A :MSTORE(retDataCTX)
$ => B :MLOAD(originCTX), JMPZ(handleGas)
B => CTX
A :MSTORE(retDataCTX)
A => CTX
0 => B
0 => E
Expand Down

0 comments on commit 5d164c5

Please sign in to comment.