Skip to content

op-challenger: interop - Handle transition to invalid state correctly when an optimistic block can’t be derived from data available on L1 #13903

@ajsutton

Description

@ajsutton

(ie block was not local-safe at the game’s L1 head) - need to ensure challenger's top-half trace provider transitions to the keccak('invalid') state correctly.

The fault dispute game state transition says that if it tries to derive an optimistic block for a chain but can’t because it reached the game’s L1 head before finding the necessary data, the transition goes to the invalid transition hash (keccak256(”invalid”)).

op-challenger needs to know exactly when this transition will occur. To do this it will need information from the supervisor’s database about when blocks become local safe or cross safe. It will use the following rules when calculating the claim for a specific step.

  • If this is step 0 (ie we are at a timestamp boundary), request the super root for that timestamp. If it was cross safe at the game’s L1 head, use the super root, otherwise use invalid.
    • Reasoning: If the super root isn’t cross safe, then an earlier step deriving an optimistic block must have had insufficient data. Thus we would have transitioned to the invalid state at an earlier step and thus the current claim must also be the invalid state.
  • If not step 0, fetch the super root for the previous timestamp transition (ie the timestamp we are transitioning from). If it was not cross safe at the game’s L1 head, the expected claim is the invalid state
    • Reasoning: The prior timestamp boundary was not cross safe so by the reasoning above, we must have transitioned to the invalid state before then and are thus still at the invalid state.
  • Fetch the super root for the next timestamp transition (ie the timestamp we are transitioning to). If it was cross safe at the game’s L1 head then all optimistic blocks must be able to be derived successfully. Do not use the invalid state for this claim.
  • If the previous timestamp was cross safe and the next timestamp was not cross safe, then one of the optimistic blocks in this timestamp transition cannot be derived and we must find which. Request the local safe block number at the game’s L1 head for each chain from op-supervisor. Iterate in chain ID order to find the first game which is not local safe at the game’s L1 head. The step which derives that chain’s optimistic block is when the game transitions to the invalid state. If our step is at or after that step we should use the invalid sate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-op-challengerArea: op-challengerH-interopHardfork: change planned for interop upgrade

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions