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

Bus-mapping for opcode calldatacopy #393

Conversation

silathdiir
Copy link
Contributor

Close #309

Summary

  1. Add ExecState to bus-mapping ExecStep to support Virtual step BeginTx, EndTx and CopyToMemory.
  2. Add function new_step to CircuitInputStateRef for multi-step support.
  3. Implement CallDataCopy bus-mapping only for root call. Will send another PR for internal call of CallDataCopy bus-mapping when PR Implementation ExecutionState::CALL #278 is merged.

silathdiir and others added 28 commits March 15, 2022 15:15
2. Remove gas calculation and set in `calldatacopy` bus-mapping.
3. Revert `test_ok_internal` since not want to set internal call.
@github-actions github-actions bot added crate-bus-mapping Issues related to the bus-mapping workspace member T-opcode Type: opcode-related and focused PR/Issue labels Mar 18, 2022
@github-actions github-actions bot added the crate-zkevm-circuits Issues related to the zkevm-circuits workspace member label Mar 18, 2022
@icemelon
Copy link
Collaborator

I suggest that we should merge this PR even though calldatacopy with internal call is not supported yet, because it changes the gen_assoicated_op function signature and could affect other bus-mapping PRs.

@ed255 ed255 self-requested a review March 18, 2022 10:06
Copy link
Member

@ed255 ed255 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Thanks for working on this :)

I've added a few comments with minor suggestions, but overall everything looks good!

@ed255
Copy link
Member

ed255 commented Mar 21, 2022

Let's wait for a second review and afterwards we can merge this!

Copy link
Collaborator

@ChihChengLiang ChihChengLiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the PR!

@ChihChengLiang ChihChengLiang merged commit ea5b823 into privacy-scaling-explorations:main Mar 21, 2022
@0xmountaintop 0xmountaintop deleted the calldatacopy-bus-mapping branch March 21, 2022 18:57
@CPerezz CPerezz mentioned this pull request Apr 4, 2022
19 tasks
zemse pushed a commit to zemse/zkevm-circuits that referenced this pull request Mar 22, 2023
…th is zero (privacy-scaling-explorations#393)

* Truncate memory offset of Word to Uint64 for Call opcodes when memory length is zero.

* Truncate memory offset for `CALLDATACOPY`.

* Truncate memory offset for `CODECOPY`.

* Truncate memory offset for `EXTCODECOPY`.

* Truncate memory offset for `RETURNDATACOPY`.

* Truncate memory offset for `RETURN` and `REVERT`.

* Truncate memory offset for `SHA3` (`KECCAK256`).

* Truncate memory offset for `CREATE` (and `CREATE2`).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
crate-bus-mapping Issues related to the bus-mapping workspace member crate-zkevm-circuits Issues related to the zkevm-circuits workspace member T-opcode Type: opcode-related and focused PR/Issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

circuit input builder: support multi-step and "virtual" steps
5 participants