superchain-registry icon indicating copy to clipboard operation
superchain-registry copied to clipboard

ops: add depset checker

Open bitwiseguy opened this issue 6 months ago • 1 comments

Overview

Adds a new DepsetChecker object to perform the following interop validations:

  1. Offchain: every chain in the depset has the exact same depset in their config toml
  2. Offchain: StaticConfigDependencySet.ActivationTime must be ≥ to that chain’s [hardforks.interop_time]
  3. Onchain: every chain in the depset has the same DisputeGameFactoryProxy and EthLockboxProxy address
    • Note: EthLockboxProxy check is currently disabled. Need to be able to update op-fetcher import (via monorepo) before we can make this check as currently designed. Blocked by https://github.com/ethereum-optimism/optimism/issues/15934

DepsetChecker is wrapped by the new ops/cmd/check_depsets program, which is invoked by a new circleci job check-depsets for every pr.

Details

DepsetChecker takes three inputs:

  1. logger
  2. AddressesJSON mapping of chainId --> addresses: contains addresses for every chain it needs to validate. In production, this will be data from the codegen'ed addresses.json file that is populated by op-fetcher after it has retrieved all addresses from onchain. This means DepsetChecker MUST run after codegen in the production ci.
  3. []DiskChainConfig slice, which includes the data from each chains .toml config. In production, all chain configs from all superchains in the child dirs within superchain/configs will be provided.

Related issues

  • https://github.com/ethereum-optimism/optimism/issues/15870
  • https://github.com/ethereum-optimism/optimism/issues/15872
  • https://github.com/ethereum-optimism/optimism/issues/15871

bitwiseguy avatar May 16 '25 18:05 bitwiseguy

Codecov Report

Attention: Patch coverage is 67.74194% with 60 lines in your changes missing coverage. Please review.

Project coverage is 42.63%. Comparing base (7bd8187) to head (0cf5c32).

Files with missing lines Patch % Lines
ops/cmd/check_depsets/main.go 0.00% 30 Missing :warning:
ops/internal/manage/depsets.go 81.29% 20 Missing and 9 partials :warning:
ops/internal/config/chain.go 0.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1013      +/-   ##
==========================================
+ Coverage   41.08%   42.63%   +1.54%     
==========================================
  Files          43       45       +2     
  Lines        3018     3204     +186     
==========================================
+ Hits         1240     1366     +126     
- Misses       1655     1706      +51     
- Partials      123      132       +9     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar May 20 '25 18:05 codecov-commenter