Skip to content

chore: sync sc-feat/opcm2-upgrade-op-chain with develop#763

Merged
0xiamflux merged 4 commits intosc-feat/opcm2-upgrade-op-chainfrom
sync/opcm2
Dec 17, 2025
Merged

chore: sync sc-feat/opcm2-upgrade-op-chain with develop#763
0xiamflux merged 4 commits intosc-feat/opcm2-upgrade-op-chainfrom
sync/opcm2

Conversation

@0xiamflux
Copy link

@0xiamflux 0xiamflux commented Dec 17, 2025

Note

Adds upgrade sequence validation to OPContractsManagerV2, replaces constant version with a pure function and internal accessor, and introduces a semgrep rule to enforce using the internal version accessor.

  • Contracts (OPContractsManagerV2)
    • Convert version from constant to function version() pure returning "7.0.0"; add _version() internal accessor and replace internal comparisons.
    • Add isPermittedUpgradeSequence(ISystemConfig) with semver-based checks; enforce in _apply for non-initial upgrades.
    • Add error OPContractsManagerV2_InvalidUpgradeSequence(string _lastVersion, string _thisVersion).
    • Update interface IOPContractsManagerV2 and ABI; refresh semver-lock hashes.
  • Tooling / Linting
    • Add semgrep rule sol-safety-opcmv2-use-internal-version to require _version() instead of direct version(); add corresponding test case.
    • Make semgrep CI step fail on findings (--error).
  • Tests
    • Add comprehensive tests for upgrade sequencing logic and adapt tests to new _version()/version() behavior.
    • Minor test refactors (shared helpers) and cleanup (remove unused v1 import).

Written by Cursor Bugbot for commit 5a087eb. This will update automatically on new commits. Configure here.

smartcontracts and others added 4 commits December 16, 2025 23:04
…8583)

* feat: have OPCMv2 check upgrade ordering version

This PR introduces a check in OPCM that validates that the
version difference in the previous OPCM and the current OPCM is
acceptable. This PR explicitly disallows skipping OPCM versions
which was previously an implicit requirement.

* fix: properly set version testing flag

* fix: semver lock

* fix: move valid instructions allowance

* fix: semver lock

* fix: better mechanism for checking permitted upgrades

* fix: properly run permitted upgrade sequence tests
* chore: bump opcmv2 to v7

* fix: correct version in upgrade sequence

* fix: broken tests
@0xiamflux 0xiamflux self-assigned this Dec 17, 2025
@0xiamflux 0xiamflux merged commit a425048 into sc-feat/opcm2-upgrade-op-chain Dec 17, 2025
1 of 2 checks passed
@0xiamflux 0xiamflux deleted the sync/opcm2 branch December 17, 2025 17:28
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