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

feat: migrate OPSuccinctL2OutputOracle to OptimismPortalV2 #277

Merged
merged 36 commits into from
Jan 15, 2025

Conversation

leruaa
Copy link
Contributor

@leruaa leruaa commented Dec 13, 2024

Adding OPSuccinctDisputeGame and OPSuccinctDisputeGameFactory contracts to integrate OPSuccinctL2OutputOracle to OptimismPortalV2.

OPSuccinctDisputeGame implements IDisputeGame and is a thin wrapper around OPSuccinctL2OutputOracle. It also implements CWIA and is cloned each time a new game is created. I didn't implement IDisputeGame on OPSuccinctL2OutputOracle as it doesn't make sense to clone it each time and is more expensive.

The proposer has been updated to call OPSuccinctDisputeGameFactory.create() each time a new outputRoot is proposed, if DGF_ADDRESS is set.

Copy link

github-actions bot commented Dec 13, 2024

Metric Value
Batch Start 22,562,730
Batch End 22,562,735
Witness Generation (seconds) 56
Execution Duration (seconds) 52
Total Instruction Count 1,839,631,488
Oracle Verify Cycles 388,982,235
Derivation Cycles 940,269,761
Block Execution Cycles 358,636,753
Blob Verification Cycles 158,501,739
Total SP1 Gas 0
Number of Blocks 6
Number of Transactions 71
Ethereum Gas Used 16,803,953
Cycles per Block 306,605,248
Cycles per Transaction 25,910,302
Transactions per Block 11
Gas Used per Block 2,800,658
Gas Used per Transaction 236,675
BN Pair Cycles 0
BN Add Cycles 0
BN Mul Cycles 0
KZG Eval Cycles 0
EC Recover Cycles 1,416,133
P256 Verify Cycles 0

@leruaa leruaa marked this pull request as draft December 13, 2024 17:43
@leruaa leruaa marked this pull request as ready for review January 13, 2025 16:19
/// i.e. The game type should indicate the security model.
/// @return gameType_ The type of proof system being used.
function gameType() public view returns (GameType) {
// TODO: Retrive and return the game type.
Copy link
Member

Choose a reason for hiding this comment

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

Does this still need to be added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I set it to GameTypes.CANNON for now, and I discussed with OP Labs, they aren't opposed to adding a new GameTypes.OP_SUCCINCT

Copy link
Member

Choose a reason for hiding this comment

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

What is the use of GAME_TYPE? To see the security model? When would GameTypes.OP_SUCCINCT be upstreamed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

GameTypes are used in DisputeGameFactory to store multiple games in a mapping, with the game type as key.

We don't have a clear view on when GameTypes.OP_SUCCINCT will be upstreamed, but if for instance we add:

GameType internal constant OP_SUCCINCT = GameType.wrap(3);

here, we could temporary do:

return GameType.wrap(3);

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good, just add a comment that GameType.wrap(3) will eventually be upstreamed to be OP Succinct. Add a TODO that this GameType needs to be changed in the future, and link to the corresponding Optimism contracts PR.

Copy link
Member

@ratankaliani ratankaliani left a comment

Choose a reason for hiding this comment

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

impl IDisputeGame for OPSuccinctL2OutputOracle
Additionals notes:
Initializable on OPSuccinctL2OutputOracle clashes with IInitializable on IDisputeGame (they both define initialize()), so I renamed OPSuccinctL2OutputOracle::initialize() to initializeParams()

I don't see an update to OPSuccinctL2OutputOracle? Did you incorporate that in this PR? You should make sure that you update the scripts if so.

Can you also add a new folder inside of the book/ for experimental/beta features and document how users can use the OptimismPortalV2 features. I'm planning to go through the docs and repo later this week. It's important that this feature/deployment for it is documented well.

Copy link
Member

@ratankaliani ratankaliani left a comment

Choose a reason for hiding this comment

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

LGTM, once the documentation nits + DGF contract link are added

leruaa and others added 6 commits January 15, 2025 00:57
* :add

* build on branch

* update

* add

* add

* add

* add

* add

* add

* add

* add

* add

* feat: update elf

* add

* add

* add

* add

* add

* add

* fix

* add

* add

* add

* add
* ci: add ci for elf check

* chore(elf): update elfs
@leruaa leruaa merged commit d2f0d4f into main Jan 15, 2025
12 checks passed
@leruaa leruaa deleted the aurelien/dispute-game branch January 15, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants