From 5d164c5e76360f5c88d2914efb6179be53ea3083 Mon Sep 17 00:00:00 2001 From: krlosMata Date: Tue, 7 Feb 2023 13:44:30 +0100 Subject: [PATCH] fixes identity and not set CTX to 0 --- main/end.zkasm | 4 ++-- main/precompiled/identity.zkasm | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/main/end.zkasm b/main/end.zkasm index f297e23f..5ac75185 100644 --- a/main/end.zkasm +++ b/main/end.zkasm @@ -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) \ No newline at end of file + ; 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) \ No newline at end of file diff --git a/main/precompiled/identity.zkasm b/main/precompiled/identity.zkasm index 11c55c0f..b9d79c5c 100644 --- a/main/precompiled/identity.zkasm +++ b/main/precompiled/identity.zkasm @@ -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