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

Feat/CREATE Part B - Error cases that will be handled within opcode gadgets #1425

Merged
merged 8 commits into from
May 26, 2023

Conversation

KimiWu123
Copy link
Contributor

@KimiWu123 KimiWu123 commented May 22, 2023

Description

NOTE: This is an updated version of #1357

This PR is actually based on top of #1419

Issue Link

#1130

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Contents

Error types for insufficient balance and nonce overflow. These are supporting changes required for the CREATE/CREATE2 opcodes' gadget.

Rationale

The above errors will be handled within the CREATE/CREATE2 opcodes' gadget. In case of insufficient balance, it is also handled in the CallOp gadget for call related opcodes.

@github-actions github-actions bot added crate-bus-mapping Issues related to the bus-mapping workspace member crate-mock Issues related to the mock workspace member crate-zkevm-circuits Issues related to the zkevm-circuits workspace member labels May 22, 2023
@KimiWu123 KimiWu123 self-assigned this May 23, 2023
@KimiWu123 KimiWu123 changed the title Feat/create part b Feat/create part b - Error cases that will be handled within opcode gadgets May 23, 2023
@KimiWu123 KimiWu123 changed the title Feat/create part b - Error cases that will be handled within opcode gadgets Feat/CREATE Part B - Error cases that will be handled within opcode gadgets May 23, 2023
@KimiWu123 KimiWu123 force-pushed the feat/create-part-b branch 2 times, most recently from 88db436 to eb9514d Compare May 25, 2023 08:16
@github-actions github-actions bot removed the crate-mock Issues related to the mock workspace member label May 25, 2023
@KimiWu123 KimiWu123 marked this pull request as ready for review May 25, 2023 09:40
@@ -1295,9 +1292,6 @@ impl<F: Field> ExecutionConfig<F> {
ExecutionState::ErrorDepth => {
assign_exec_step!(self.error_depth)
}
ExecutionState::ErrorContractAddressCollision => {
assign_exec_step!(self.error_contract_address_collision)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

since ErrDepth will be processed inside create gadget and call gadget, we can remove this code too?

            ExecutionState::ErrorDepth => {
                assign_exec_step!(self.error_depth)
            }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in 4147e93

Copy link
Collaborator

@han0110 han0110 left a comment

Choose a reason for hiding this comment

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

LGTM!

@KimiWu123
Copy link
Contributor Author

Hi @lispc and @han0110 , in order to remove ExecutionState::ErrorDepthas lispc mentioned #1425 (comment), many files were touched. Please review again for this commit 4147e93.

@lispc lispc enabled auto-merge May 26, 2023 02:44
Copy link
Collaborator

@han0110 han0110 left a comment

Choose a reason for hiding this comment

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

LGTM!

@lispc lispc added this pull request to the merge queue May 26, 2023
Merged via the queue into main with commit 5e1d35e May 26, 2023
@lispc lispc deleted the feat/create-part-b branch May 26, 2023 04:13
@ed255 ed255 linked an issue May 31, 2023 that may be closed by this pull request
KimiWu123 added a commit that referenced this pull request Jun 9, 2023
### Description

NOTE: This is an updated version of
#1358

This PR is actually based on top of
#1425

### Issue Link

#1130 

### Type of change

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update

### Contents

Bus mapping implementation for CREATE/CREATE2
EVM circuit's gadget for CREATE/CREATE2

### How Has This Been Tested?
Tests can be found here:
https://github.com/scroll-tech/zkevm-circuits/blob/2d2bfc6ccf179ade1a8d063f9586b93e5283a557/zkevm-circuits/src/evm_circuit/execution/create.rs#L678

---------

Co-authored-by: Rohit Narurkar <[email protected]>
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement CREATE & CREATE2
4 participants