-
Couldn't load subscription status.
- Fork 3.8k
op-challenger: Asterisc Support #10030
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
op-challenger: Asterisc Support #10030
Conversation
a14b8f4 to
ee317ee
Compare
|
What I understand is that the only thing we need to make is |
WalkthroughWalkthroughThe recent updates bring significant enhancements to the system by introducing the "Asterisc" trace type. These changes include new variables, error handling, configuration settings, and testing tailored specifically for the "Asterisc" configuration. The system now supports Asterisc-specific game types, metrics recording for Asterisc execution time, and optimizations in existing structures to align better with the Ethereum Optimism project requirements. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
8cefe3c to
b6dd670
Compare
asterisc shares same methods for local and preimages
Basic unit tests mirrored from cannon
b6dd670 to
f25a705
Compare
|
Closing this PR; Refactored implementation is at #10094. |
TL; DR: Implemented op-challenger for asterisc. Only unit test is passing. E2E tests will be implemented at asterisc repo. Need to work on challenger abstraction to avoid code duplication.
Description
op-challenger provides a wrapper with FPVM binary, and it only supported cannon to play dispute game, providing traces. This PR adds a wrapper with yet another FPVM, asterisc.
Although code diff is quite large, they do not add fancy ideas. They are almost same with cannon's structure. I mirrored the structure of cannon's trace directory. There are few building blocks to build the challenger for asterisc. I will list up the components and their needs.
asterisc_state.go,asterisc_memory.go,asterisc_page.go: It reads the asterisc state, and calculate witness or statehash. Cannot be shared with cannon because they have different state formats.prestate.go: It reads the prestate usingasterisc_state.go. Mirroringcannon_state.go.executor.go: Wrapper of asterisc binary, supplying flags.provider.go: Trace provider for asterisc.preimage.go,local.go: These were imported from cannon because these are not cannon specific. No new files added for these.Asterisc specific flags where added to op-challenger. Copied cannon flags and configs, but changed their name to contain asterisc instead of cannon. Tweaked op-challenger to support asterisc game type =
2.dispute-mon will now accept asterisc game type as valid.
Space for abstraction
op-challenger must import the state/memory/page related code to interact. For example, lets compare below code segments:
At
trace/cannon/prestate.go:At
trace/asterisc/prestate.go:Each code segment requires to compute state hash from the state. For cannon, this job is relatively simple because cannon is directly embedded in the monorepo. For asterisc, different story. We cannot import asterisc to the monorepo because of circular dependency. Therefore we need to duplicate the codes, as seen in this PR.
We need better abstraction to hide these details, and this can be redesigned in the follow up PR.
Tests
Unit tests for asterisc tracer is added. Basic flag sanity checking unit test is added.
There are no e2e tests added! These will be added to asterisc. Will refer to output_cannon_test.go.
To add more details about why e2e is implemented at asterisc, asterisc is expected to be maintained at separate repository. Asterisc pulls the monorepo(here!)