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

ECO-1906 Cannon Proving #16

Open
wants to merge 76 commits into
base: main
Choose a base branch
from
Open

ECO-1906 Cannon Proving #16

wants to merge 76 commits into from

Conversation

johnwhitton
Copy link
Contributor

@johnwhitton johnwhitton commented Jul 10, 2024

Key Refactors Include

Proving Logic Prover.sol

  • Chain Block Proofs replace L1,L2,L3 world states and only storing the lastest state for each proof
  • setChainConfiguration provides an ownable function to allow the configuration of source and destination chains on each chain
  • Settlement Chain Introduce the concept of a settlement chain - this will enable L3 chains to prove against L2 chains using the same proving algorithms such as bedrock and cannon.
  • Upgradeable Proving Contract We've made the Prover Upgradeable, the thought is that it will only needed to be upgraded when we introduce a new proving mechanism. Adding additional destination chains can be done by SetChainConfiguration. The benefit of upgrading is that we can also keep all the states (including the intents that have been proven) when upgrading.
  • proveL2WorldStateBedrock replaces proveOutputRoot and moving forward will be renamed proveWorldStateBedrock as this proving mechanism should also work on L3's as long as their settlement chain is correctly configured
  • proveL2WorldStateCannon introduces support for the Cannon proving Mechanism will also be renamed to proveWorldStateCannon as this proving mechanism should also work on L3's as long as their settlement chain is correctly configured

Copy link
Collaborator

@nknavkal nknavkal left a comment

Choose a reason for hiding this comment

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

yeah its fine for now, a lot of this is going to get overhauled soon though so dont lose these comments. I don't really think its worth addressing any of them within the context of this architecture, just save it for the commit where we move everything into the master prover implementation

Copy link
Collaborator

Choose a reason for hiding this comment

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

what are these .openzeppelin files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Open Zeppelin comes from the faxt that we're using the

import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";

and

    "@openzeppelin/hardhat-upgrades": "^3.2.0",
    "@openzeppelin/contracts": "^5.0.2",
    "@openzeppelin/contracts-upgradeable": "^5.0.2"

optimismProvider,
)

// ECO PROTOCOL Contracts
Copy link
Collaborator

Choose a reason for hiding this comment

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

just a note for making this a little less clunky, maybe we can make a bunch of IntentProtocol objects, make all their fields the various contracts, constants etc and then we could import them all in one fell swoop? would be more extensible for future networks too i would think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good Idea 🙏

IntentSource__factory.abi,
optimismIntentCreator,
)
export const optimismIntentSourceContractClaimant = new Contract(
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there a reason you're doing it this way rather than just doing .connect() in the script itself? much cleaner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Open for discussion, original though was to put all the signer, provider and contract configuration in the setup, so that it could be used by multiple scripts.
I think a bigger conversation is the role of this repository in providing examples for prover and solver services or whether we move this to a separate repository.

contracts/Prover.sol Outdated Show resolved Hide resolved
contracts/Prover.sol Outdated Show resolved Hide resolved
return number;
}

function assembleGameStatusStorage(
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there an expectation that a user calls this? seems like a helper, should make it private and just stick a call into whatever public function would be using it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, should revisit this initial thought is that proving services may use it to validate the GameStatus Storage.

contracts/Prover.sol Outdated Show resolved Hide resolved
contracts/Prover.sol Outdated Show resolved Hide resolved
contracts/Prover.sol Outdated Show resolved Hide resolved
contracts/interfaces/IIntentSource.sol Show resolved Hide resolved
@johnwhitton johnwhitton removed the request for review from StoyanD August 15, 2024 14:48
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.

3 participants