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

Read the bytecode at a given offset #31

Open
Bernardstanislas opened this issue Oct 16, 2022 · 1 comment
Open

Read the bytecode at a given offset #31

Bernardstanislas opened this issue Oct 16, 2022 · 1 comment
Labels
Context: intricated deep understanding of the codebase required Difficulty: intermediate require some notions, but can be learned while doing Duration: 1 day will take about one day Techno: cairo cairo Type: feature a new feature to implement

Comments

@Bernardstanislas
Copy link
Contributor

Context

pc points at the instruction currently being processed by the EVM, and is represented as a byte offset in the bytecode.

Goal

Have an internal function to read the current opcode at a given pc value. Keep in mind that some opcodes are expressed on several bytes, because they hold a value alongside with the actual opcode value. PUSH1 is one of these for example.

Expectations

  • have a function that can be called with a pc value and returns the opcode at the given offset
  • this function should be usable by In-memory program counter and JUMP opcode implementation #30 to check that the opcode at a jump destination is actually a JUMPDEST
  • find how to deal with variable size of opcodes decoding, one byte for JUMPDEST for example, and two bytes for PUSH1
@Bernardstanislas Bernardstanislas added Difficulty: intermediate require some notions, but can be learned while doing Type: feature a new feature to implement Context: intricated deep understanding of the codebase required Techno: cairo cairo Duration: 1 day will take about one day labels Oct 16, 2022
@DIWAKARKASHYAP
Copy link

i want to work on this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Context: intricated deep understanding of the codebase required Difficulty: intermediate require some notions, but can be learned while doing Duration: 1 day will take about one day Techno: cairo cairo Type: feature a new feature to implement
Projects
None yet
Development

No branches or pull requests

2 participants