Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
chore: rename classes and tags to match circuit implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
han0110 committed Dec 5, 2021
1 parent d9a7271 commit 811d866
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 156 deletions.
2 changes: 1 addition & 1 deletion src/zkevm_specs/evm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .execution import *
from .execution_result import *
from .execution_state import *
from .main import *
from .opcode import *
from .precompiled import *
Expand Down
8 changes: 4 additions & 4 deletions src/zkevm_specs/evm/execution/begin_tx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def begin_tx(instruction: Instruction, is_first_step: bool = False):
tx_callee_address = instruction.tx_lookup(tx_id, TxContextFieldTag.CalleeAddress)
tx_is_create = instruction.tx_lookup(tx_id, TxContextFieldTag.IsCreate)
tx_value = instruction.tx_lookup(tx_id, TxContextFieldTag.Value)
tx_calldata_length = instruction.tx_lookup(tx_id, TxContextFieldTag.CalldataLength)
tx_call_data_length = instruction.tx_lookup(tx_id, TxContextFieldTag.CallDataLength)

# Verify nonce
tx_nonce = instruction.tx_lookup(tx_id, TxContextFieldTag.Nonce)
Expand Down Expand Up @@ -63,16 +63,16 @@ def begin_tx(instruction: Instruction, is_first_step: bool = False):

# Setup next call's context
# Note that:
# - CallerCallId, ReturndataOffset, ReturndataLength, Result
# - CallerCallId, ReturnDataOffset, ReturnDataLength, Result
# should never be used in root call, so unnecessary to check
# - TxId is propagated from previous step or constraint to 1 if is_first_step
# - IsPersistent will be verified in the end of tx
for (tag, value) in [
(CallContextFieldTag.Depth, 1),
(CallContextFieldTag.CallerAddress, tx_caller_address),
(CallContextFieldTag.CalleeAddress, tx_callee_address),
(CallContextFieldTag.CalldataOffset, 0),
(CallContextFieldTag.CalldataLength, tx_calldata_length),
(CallContextFieldTag.CallDataOffset, 0),
(CallContextFieldTag.CallDataLength, tx_call_data_length),
(CallContextFieldTag.Value, tx_value),
(CallContextFieldTag.IsStatic, False),
]:
Expand Down
Loading

0 comments on commit 811d866

Please sign in to comment.