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

Create State and Transition traits #1

Merged
merged 10 commits into from
Feb 27, 2024
Merged

Conversation

4l0n50
Copy link
Member

@4l0n50 4l0n50 commented Feb 26, 2024

Description

Changes enum State to trait State, which is implemented by Interpreter and GenerationState. The State trait require to implement the same methods of the previous enum, and implements the ones having the old enum as input (for example run_cpu) . It also required to create a new trait Transition: State which implements some the the functions in trasition.rs and require to implement others related to the state transition.

@4l0n50 4l0n50 changed the base branch from interpreter-unification to interpreter-unified February 26, 2024 10:49
}

/// Skips the following instructions for some specific labels
fn skip_if_necessary(&mut self, op: Operation) -> Result<Operation, ProgramError>;
Copy link
Member Author

Choose a reason for hiding this comment

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

This method is begging for a better name. Any idea?

@4l0n50 4l0n50 changed the title State trait Create State and Transition traits Feb 26, 2024
evm_arithmetization/src/generation/state.rs Outdated Show resolved Hide resolved
evm_arithmetization/src/cpu/kernel/interpreter.rs Outdated Show resolved Hide resolved
evm_arithmetization/src/witness/operation.rs Outdated Show resolved Hide resolved
@LindaGuiga LindaGuiga merged commit 2891c5b into interpreter-unified Feb 27, 2024
5 checks passed
Nashtare pushed a commit that referenced this pull request Mar 1, 2024
* Unify interpreter and CPU logic.

* Cleanup

* Update CHANGELOG

* Cleanup

* Apply comments

* Remove extra STARK pushes

* Clippy

* Remove new_with_kernel

* Fix extend_memory

* Create State and Transition traits (#1)

* Add traits State and Transition

* Move perform_state_op to Transition

* Fix bug

* Get rid of is_generation_state + add reviews

* Remove TDO

* Fix handle_error

* Move preinitialized_segments from the interpreter to MemoryState

* Clippy

* Apply get_halt_context comment

---------

Co-authored-by: Linda Guiga <[email protected]>

* Apply comments

* Remove incr_interpreter_clock

---------

Co-authored-by: Alonso González <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants