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

Config: Add contract impl addresses & versions to config toml #525

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

Conversation

vdamle
Copy link
Contributor

@vdamle vdamle commented Aug 28, 2024

(updated 9/9/24)

  • store and expose the contract implementation addresses & versions for each contracts release. this is intended to be used by internal/external components such as validation code within superchain-registry, op-stack-manager, monorepo upgrade tool etc. The intent is to persist a single source of truth for the implementation addresses.
  • the addresses & versions are stored in validation/standard/standard-versions.toml per contracts release tag
  • the latest contracts release information that is specified in the registry is specified in superchain.toml as op_contracts_release. Any external consumer should be able to read that tag and look for address/version information under that tag in validation/standard/standard-versions.toml
  • Initial addresses/versions are recorded for v1.3.0/MCP & v1.4.0 L1 contracts release.

This description is updated per discussion below on the originally created draft PR.

Addresses: #520

@vdamle vdamle requested a review from a team as a code owner August 28, 2024 18:54
@vdamle vdamle requested a review from bitwiseguy August 28, 2024 18:54
@vdamle vdamle marked this pull request as draft August 28, 2024 18:54
@vdamle vdamle marked this pull request as ready for review September 9, 2024 18:37
@vdamle vdamle requested review from geoknee and mds1 September 9, 2024 18:37
@vdamle vdamle changed the title [Draft] Config: Add contract impl addresses & versions to config toml Config: Add contract impl addresses & versions to config toml Sep 9, 2024
@vdamle vdamle force-pushed the vinod/impl-addresses branch 2 times, most recently from 35ba4db to 63f10e4 Compare September 10, 2024 17:25
Comment on lines 15 to 21
anchor_state_registry = { version = "1.0.0" }
delayed_weth = { version = "1.0.0" }
dispute_game_factory = { version = "1.0.0" }
fault_dispute_game = { version = "1.2.0" }
permissioned_dispute_game = { version = "1.2.0" }
mips = { version = "1.0.1" }
preimage_oracle = { version = "1.0.0" }
Copy link
Contributor

Choose a reason for hiding this comment

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

For FP contracts:

  • OptimismPortal2, DisputeGameFactory, and DelayedWETH have shared implementations for all chains, so should have an address here
  • PreimageOracle and MIPS are singletons (one, non-proxied instance for all chains). Therefore these probably should be at the superchain level with SuperchainConfig and ProtocolVersions
  • Anchor state registry, fault dispute game permissioned dispute game: we know what semver to expect, but each one has a unique address per chain (i.e. these contracts cannot be reused)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Anchor state registry, fault dispute game permissioned dispute game: we know what semver to expect, but each one has a unique address per chain (i.e. these contracts cannot be reused)

Retained only semvers, dropped addresses.

PreimageOracle and MIPS are singletons (one, non-proxied instance for all chains). Therefore these probably should be at the superchain level with SuperchainConfig and ProtocolVersions

@mds1 It appears that the contract addresses for MIPS and PreimageOracle are different for v1.4.0 and v1.6.0. As is, there is no way to disambiguate contract addresses at the superchain level for different releases. Should we keep these addresses in standard-versions.toml so we have the ability to store an address per release?

Copy link
Contributor

@mds1 mds1 Sep 12, 2024

Choose a reason for hiding this comment

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

Should we keep these addresses in standard-versions.toml so we have the ability to store an address per release?

Yea this seems like a good solution. I would just suggest that we have some way to differentiate the implementations from the singletons, e.g. maybe in the toml we use [contract_tag."op-contracts/v1.4.0".implementations] and [contract_tag."op-contracts/v1.4.0".singletons], or you can add a third key like { version ="foo", address = "bar", kind = <"implementation"|"singleton">

Vinod Damle added 6 commits September 13, 2024 06:55
… config toml

* store and expose the contract implementation addresses & versions for each contracts release.
this is intended to be used by internal/external components such as validation code
within superchain-registry, op-stack-manager, monorepo upgrade tool etc.
The intent is to persist a single source of truth for the implementation addresses.
* the addresses are stored in `superchain.toml` as a map of the contracts release
 tag as a string to the implementation contract addresses
* Initial addresses/versions are recorded for v1.3.0/MCP L1 contracts release
* contract implemetnation addresses now live with contract versions in validation
* Instead of two separate files/sections, they are now specified as a `VersionedContract`
  which is a pre-existing construct in SCR.
moved `op_contracts_release` from superchain.toml
to `validation/standard/standard-config.toml`
dispute_game_factory = "1.0.0"
fault_dispute_game = "1.2.0"
permissioned_dispute_game = "1.2.0"
standard_release = "op-contracts/v1.4.0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally, we should be able to run just validate "*" on this branch and have it pass.

I think updating this to "op-contracts/v1.6.0" may be important for that.

geoknee and others added 2 commits September 13, 2024 09:48
* update standard release

* make a more useful diff

* update go mod

---------

Co-authored-by: Vinod Damle <[email protected]>
…ess` in standard contract versions (#587)

* VersionedContract has optional implementation_address and address fields

* use pointers
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.

Include contract addresses against semantic versions for L1 smart contracts
4 participants