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

Implement STEP Event for zkEVM Similar to EVM's Operation Tracking #189

Open
mpopovac-txfusion opened this issue Oct 17, 2023 · 0 comments
Labels
feature ➕ Feature item p3 🔵 Indicates low priority item

Comments

@mpopovac-txfusion
Copy link

🌟 Feature Request

📝 Description

To enhance the zkEVM's tracking capabilities, I'd like to propose the addition of a STEP event similar to the EVM. The STEP event would monitor each operation executed in the EVM during the execution of a smart contract.

Attributes

account:

  • Type: Account
  • Description: Represents the state of the account currently executing the operation.

address:

  • Type: Address {buf: Buffer(20)}
  • Description: The address of the account currently executing the operation.

codeAddress:

  • Type: Address {buf: Buffer(20)}
  • Description: The address where the code being executed resides.

depth:

  • Type: Integer
  • Description: Indicates the current call depth.

eei:

  • Type: Object (EEI)
  • Description: Represents the Ethereum Environment Interface used by the executing contract.

gasLeft:

  • Type: BigInt
  • Description: The remaining gas for the current contract execution.

gasRefund:

  • Type: BigInt
  • Description: Amount of gas that will be refunded at the end of the transaction.

memory:

  • Type: Buffer
  • Description: The current state of the EVM's memory.

memoryWordCount:

  • Type: BigInt
  • Description: The size of memory in words.

opcode:

  • Type: Object {name: String, fee: Integer, dynamicFee: BigInt, isAsync: Boolean}
  • Description: Denotes the current operation code being executed.

pc:

  • Type: Integer
  • Description: The program counter pointing to the position in the bytecode of the current operation.

returnStack:

  • Type: List of BigInt
  • Description: A separate stack used for specific operations.

stack:

  • Type: List of BigInt
  • Description: Represents the current state of the stack in the EVM, where intermediate values are stored during contract execution.

🤔 Rationale

Implementing the STEP event in zkEVM would provide granular insights into contract execution, allowing developers to better understand, debug, and optimize their contracts. This feature would be in line with the transparency and observability standards set by the traditional EVM.

🖼️ Mockups/Examples

account:Account
address:Address {buf: Buffer(20)}
codeAddress:Address {buf: Buffer(20)}
depth:0
eei: EEI
gasLeft:1099511509902n
gasRefund:0n
memory:Buffer(8192) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, %E2%80%A6]
memoryWordCount:3n
opcode:{name: 'MLOAD', fee: 3, dynamicFee: 3n, isAsync: false}
pc:21
returnStack:(0) []
stack:(1) [64n]
0:64n

📋 Additional Context

Ensuring compatibility and similarity with the EVM's STEP event would facilitate smoother migration for developers familiar with the EVM. Moreover, it would further bridge the gap between zkEVM and EVM, providing a consistent development experience.

@dutterbutter dutterbutter added p3 🔵 Indicates low priority item feature ➕ Feature item labels Jan 30, 2024
IAvecilla pushed a commit to lambdaclass/era-test-node that referenced this issue Feb 29, 2024
* Validate curve point evaluation output (matter-labs#186)

Not infinity

* Optimize and clarify REDC (matter-labs#187)

* Remove unnecassary variables storing in `currentB` and `currentC` (matter-labs#189)

* Remove redundant check in `projectiveAdd` (matter-labs#195)

* Improve ec constants docs (matter-labs#196)

* Remove unnecessary `r` conversion from Montgomery form (matter-labs#188)

* Fix doc comment mismatch (matter-labs#197)

* Redundant opposite point addition case (matter-labs#198)

* reuse computation (matter-labs#199)

* Add tests for special hash values (matter-labs#202)

---------

Co-authored-by: Ivan Litteri <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature ➕ Feature item p3 🔵 Indicates low priority item
Projects
None yet
Development

No branches or pull requests

2 participants