-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
cannon: Autodetect VM type from state #11803
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #11803 +/- ##
===========================================
+ Coverage 78.13% 78.47% +0.34%
===========================================
Files 40 41 +1
Lines 3179 3206 +27
===========================================
+ Hits 2484 2516 +32
+ Misses 533 529 -4
+ Partials 162 161 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
83a6cfc
to
dd797d1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!! Looks good - approving optimistically but I think the sleepCheck comment needs to be addressed.
…nd forbid serializing multithreaded states to JSON
Test read/write/create for VersionedState
Multithreaded states always use binary serialization.
297e9c1
to
1dd1668
Compare
* cannon: Autodetect VM type from state in run command * cannon: Autodetect VM type from state in witness command * cannon: Remove vm type flag from run and witness * cannon: Only peek the version byte * cannon: Move all version handling to VersionedState, simplify a lot and forbid serializing multithreaded states to JSON * cannon: Rename method * op-challenger: Update cannon state parsing to use version detecting methods * cannon: Move CreateVM to FPVMState for simplicity Test read/write/create for VersionedState * cannon: Readd detect_test * cannon: Remove json names from multithreaded.State. Multithreaded states always use binary serialization. * cannon: Move vmtype to load_elf since it is no longer shared. * cannon: Ensure metadata is available and sleepCheck used even if debug is disabled. * op-challenger: Update canon state loading test to cover multiple state versions.
Description
Modifies cannon to automatically detect the VM type from the supplied state.
VersionedState
struct which wraps the vm type specific state.VersionedState
returns an error when attempting to serialise a multithreaded state as JSON since JSON states are always assumed to be single threaded.FPVMState
now exposes aCreateVM
method so it can create the appropriate VM (akaInstrumentedState
) for the type of state. Therun
command uses this so its implementation is now completely agnostic to the type of state.InitDebug
to accept the metadata as an arg rather than requiring it in theInstrumentedState
constructor so it matches the multithreaded versionMetadata
to avoid introducing package cyclesTests
Added unit tests for the new code that detects versions.
Metadata