Skip to content
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

Resolve merge conflict for zkevm-circuits/src/evm_circuit/witness.rs #2

Open
wants to merge 43 commits into
base: opcodes/returndatacopy
Choose a base branch
from

Conversation

xiaodino
Copy link

No description provided.

xiaodino and others added 30 commits August 22, 2022 15:57
Signed-off-by: smtmfft <[email protected]>

Signed-off-by: smtmfft <[email protected]>
Signed-off-by: smtmfft <[email protected]>

Signed-off-by: smtmfft <[email protected]>
)

i.e., only if it is not root call.

RETURN spec:

The `RETURN` opcode terminates the call successfully with return data for the
caller.

It behaves differently in different scenarios:

- `is_create` and `is_root`
    - A. Returns the specified memory chunk as deployment code.
    - B. End the execution
- `is_create` and `not is_root`
    - A. Returns the specified memory chunk as deployment code.
    - C. Restores caller's context and switch to it.
- `not is_create` and `is_root`
    - B. End the execution
- `not is_create` and `not is_root`
    - D. Returns the specified memory chunk to the caller.
    - C. Restores caller's context and switch to it.

Signed-off-by: smtmfft <[email protected]>

Signed-off-by: smtmfft <[email protected]>
Co-authored-by: smtmfft <[email protected]>
smtmfft added a commit that referenced this pull request Nov 2, 2022
* Add circuit for RETURNDATASIZE opcode

* Update tests

* update last call info in return (#2)

Signed-off-by: smtmfft <[email protected]>

Signed-off-by: smtmfft <[email protected]>

* Update tests

* Update tests

* Update format in zkevm-circuits/src/evm_circuit/execution.rs

* Change unwrap to expect in returndatasize.rs

* Add circuit for RETURNDATASIZE opcode

* Update tests

* update last call info in return (#2)

Signed-off-by: smtmfft <[email protected]>

Signed-off-by: smtmfft <[email protected]>

* Update tests

* Update tests

* Update format in zkevm-circuits/src/evm_circuit/execution.rs

* Change unwrap to expect in returndatasize.rs

* according to RETURN spec, callee info update happens only in case C, (#3)

i.e., only if it is not root call.

RETURN spec:

The `RETURN` opcode terminates the call successfully with return data for the
caller.

It behaves differently in different scenarios:

- `is_create` and `is_root`
    - A. Returns the specified memory chunk as deployment code.
    - B. End the execution
- `is_create` and `not is_root`
    - A. Returns the specified memory chunk as deployment code.
    - C. Restores caller's context and switch to it.
- `not is_create` and `is_root`
    - B. End the execution
- `not is_create` and `not is_root`
    - D. Returns the specified memory chunk to the caller.
    - C. Restores caller's context and switch to it.

Signed-off-by: smtmfft <[email protected]>

Signed-off-by: smtmfft <[email protected]>
Co-authored-by: smtmfft <[email protected]>

* Fix the issues with rustfmt

* Fix merge conflicts

* Update

* Add tests

* Resolve merge conflicts

* Update bus-mapping return.rs, use N_BYTES_U64 for return_data_size and update tests

* Revert change in bus-mapping return

* Update bus-mapping returndatasize_tests

Signed-off-by: smtmfft <[email protected]>
Signed-off-by: smtmfft <[email protected]>
Co-authored-by: smtmfft <[email protected]>
Co-authored-by: smtmfft <[email protected]>
Co-authored-by: Rohit Narurkar <[email protected]>
Co-authored-by: Carlos Pérez <[email protected]>
Co-authored-by: z2trillion <[email protected]>
Co-authored-by: adria0.eth <[email protected]>
@smtmfft smtmfft force-pushed the opcodes/returndatacopy branch from 45673e7 to 7a31ce4 Compare November 2, 2022 15:47
smtmfft pushed a commit that referenced this pull request Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants