-
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: Modularize mipsevm packages #11135
cannon: Modularize mipsevm packages #11135
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #11135 +/- ##
===========================================
+ Coverage 62.58% 64.41% +1.83%
===========================================
Files 21 27 +6
Lines 1935 2147 +212
Branches 71 71
===========================================
+ Hits 1211 1383 +172
- Misses 687 717 +30
- Partials 37 47 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Consider flattening Go packages unless there are visibility concerns.
Specifically, the following files should be directly part of the core
package rather than in subpackages:
- core/witness/witness.go
- core/oracle/oracle.go
- core/state/state.go
- core/debug/debug.go
This frees us identifier uses for debug
, state
, etc without introducing ambiguity.
Similarly, the impls
package doesn't serve any purpose. We can have single_threaded
and multi_threaded
packages moved up.
Flattened those packages as you suggested, and went ahead and moved the |
77ead49
to
e39f019
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!
Need a monorepo-ops-reviewer for approval. cc @ajsutton |
4584c97
Description
Refactor the
mipsevm
package to be more modular.Basically, this PR creates a bunch of sub-packages for the various files that were previously in the
mipsevm
package. Generically, this is meant to help create a better separation of concerns, clarify dependencies, improve encapsulation, and make test utilities more reusable. It should also help keep the code legible as we add the new Multithreaded Cannon logic and avoid name conflicts and accidental imports.Overview of the new package structure:
test_util
package that holds test helpers extracted from the existing teststests
package to hold non-unit testsOther changes:
MTState
toState
(and similarly for related constants, variables, etc)State
) with the generic interface (FPVMState
).Notes for the reviewer:
There should be no functional changes in this PR. The changes here should mostly consist of package restructuring, visibility changes to some symbols, and shuffling some symbols between files.
Tests
This is a refactor, tests were just moved. One thing to highlight is that some tests in
state_test.go
were moved toinstrumented_test.go
to avoid circular dependencies (and because these tests were not really forstate.go
).Metadata
Part of: #11642