Skip to content

Custom Additional Per-Task Validations #888

@sebastianst

Description

@sebastianst

We currently lack some validations with the new task framework that were happening with the old framework. I think we need a way to add back per-task custom validations, especially those which we now exclude as expected errors.

The new scops task framework works with template Solidity scripts that also define generic validations that run for all tasks. But then it is expected that the on-chain StandardValidator returns some errors. E.g. in the case of the Sepolia Unichain Isthmus prestate upgrade (U15), we define the following list of expected erros:

# The following are expected errors related to Base Sepolia having a different L1PAO
# PROXYA-10: ProxyAdmin owner is not set to L1 PAO multisig - expected
# DF-30: DisputeGameFactory owner is not set to L1 PAO multisig - expected
# PDDG-DWETH-30: Permissioned dispute game delayed WETH owner mismatch - expected
# PLDG-DWETH-30: Permissionless dispute game delayed WETH owner mismatch
# PDDG-120: Permissioned dispute game challenger address mismatch - expected, each chain has a different challenger
# PDDG-ANCHORP-40: Permissioned dispute game anchor state registry root hash mismatch - expected, this is not a fresh ASR
# PLDG-ANCHORP-40: Permissionless dispute game anchor state registry root hash mismatch - expected, this is not a fresh ASR

But what's now missing are assertions what these values should be instead. E.g. the first expected error is PROXYA-10: ProxyAdmin owner is not set to L1 PAO multisig - expected. But we don't have any assertions who should be the right PAO instead. Worst case, this can lead to us ignoring wrong values because we just dismiss this check as an expected error.

I see two solutions

  1. Add optional validation Solidity scripts to tasks, that would probably inherit the template so all fields and functions are available as they are in the template. So there would be a solidity script for a task like in the old framework, but only optionally. This option solves the problem very generically.
  2. Improve the StandardValidator errors to include contextual information, so that the asserted errors also assert on the alternative field values instead. E.g. in the above example, the error code PROXYA-10 could be extended to include the actually found owner in parenthesis, like PROXYA-10(0x<actual-address>). This would probably work for most errors and ensure when we expect errors, we also implicitly assert on the alternative value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions