Skip to content
This repository was archived by the owner on Aug 4, 2025. It is now read-only.
This repository was archived by the owner on Aug 4, 2025. It is now read-only.

Implement State Root Proof Caching for Reward Claims #146

@jackchuma

Description

@jackchuma

Problem Statement

Our system relies on storage proofs targeting destination chain Inbox contracts to verify cross-chain call delivery. Currently, if under high load, multiple fulfillers could be trying to claim against the same destination chain state root. Let's say we have three chains (Chain A, L1, Chain B) and 2 fulfillers (Fulfiller A, Fulfiller B).

  1. Fulfiller A and Fulfiller B both deliver a cross-chain call request from Chain A -> Chain B
  2. Chain B's state settles on L1
  3. Fulfiller A claims their compensation by submitting a nested storage proof that:
    a. Verifies Chain B's state root on L1 from chain A
    b. Verifies Chain B's Inbox contract storage against chain B's state root
  4. Fulfiller B then claims their compensation by submitting a nested storage proof that:
    a. Verifies Chain B's state root on L1 from chain A
    b. Verifies Chain B's Inbox contract storage against chain B's state root

After Fulfiller A successfully claims their compensation, the system should recognize that there is now a verified state root for chain B that does not need to be validated again, however, it currently does not and will require Fulfiller B to re-validate the state root (of course, assuming that Fulfiller B is using the same Chain B state root in their proof). This would be a redundant step in that case.

Expected Behavior

Once a specific destination chain state root has been proven by any fulfiller, the system should cache this verification result. Subsequent reward claimers referring to the same state root should be able to bypass the proving step, resulting in reduced gas costs for fulfillers.

Acceptance Criteria

  • A caching mechanism is implemented that stores previously proven state roots
  • Reward claimers referring to a cached state root bypass the proof verification step
  • Gas consumption for subsequent claimers is measurably reduced compared to the current implementation
  • Unit and integration tests verify correct behavior of the caching system
  • Documentation is updated to reflect the new caching behavior

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions