Skip to content

Testnet semver validation needs better error messages. #805

@geoknee

Description

@geoknee

A recent PR triggered a semver validation on OP Sepolia (because of the semver on one contract going backwards) which was misleading.

The backwards semver causes the check to fail and on failure we print a diff against the standard release:

=== FAIL: github.com/ethereum-optimism/superchain-registry/validation TestValidation/OP_Sepolia_Testnet_(11155420)/Standard_Contract_Versions (0.27s)
    superchain-version.go:266: 
                Error Trace:    /home/circleci/project/validation/superchain-version.go:266
                                                        /home/circleci/project/validation/superchain-version.go:41
                                                        /home/circleci/project/validation/validation_test.go:44
                Error:          Should be true
                Test:           TestValidation/OP_Sepolia_Testnet_(11155420)/Standard_Contract_Versions
                Messages:       contract versions do not match the standard versions for the op-contracts/v1.6.0 release 
                                 (-removed from standard / +added to actual):
                                   superchain.ContractVersions{
                                        ... // 5 identical fields
                                        OptimismPortal:  {Version: "3.10.0"},
                                        OptimismPortal2: {},
                                        SystemConfig: superchain.VersionedContract{
                                -               Version: "2.2.0",
                                +               Version: "2.3.0",
                                                ... // 2 ignored fields
                                        },
                                        ProtocolVersions: {},
                                        SuperchainConfig: {},
                                        ... // 2 identical fields
                                        PermissionedDelayedWETH: {},
                                        DisputeGameFactory:      {Version: "1.0.0"},
                                        FaultDisputeGame: superchain.VersionedContract{
                                -               Version: "1.3.0",
                                +               Version: "1.3.1",
                                                ... // 2 ignored fields
                                        },
                                        MIPS: superchain.VersionedContract{
                                -               Version: "1.1.0",
                                +               Version: "1.0.0-beta.7",
                                                ... // 2 ignored fields
                                        },
                                        PermissionedDisputeGame: superchain.VersionedContract{
                                -               Version: "1.3.0",
                                +               Version: "1.3.1",
                                                ... // 2 ignored fields
                                        },
                                        PreimageOracle:         {Version: "1.1.2"},
                                        CannonFaultDisputeGame: {},
                                  }

The error message is not helpful, it claims we are checking strictly against the standard release which we are not. We are checking that each contract semver is equal or greater than standard, and printing the diff if that isn't true. It's also possible that the -beta suffix isn't getting parsed properly, we should add some unit tests for this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-validationArea: validationM-needs-triageMeta: this issue needs to be labelled

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions