Skip to content

index BackwardLET event in bridge syncer #1359

@Stefan-Ethernal

Description

@Stefan-Ethernal

Handle the BackwardLET in the L2 bridge syncer.

Function signature

function backwardLET(
        uint256 newDepositCount,
        bytes32[_DEPOSIT_CONTRACT_TREE_DEPTH] calldata newFrontier,
        bytes32 nextLeaf,
        bytes32[_DEPOSIT_CONTRACT_TREE_DEPTH] calldata proof
    ) external virtual onlyGlobalExitRootRemover ifEmergencyState

Event signature

event BackwardLET(
        uint256 previousDepositCount,
        bytes32 previousRoot,
        uint256 newDepositCount,
        bytes32 newRoot
    );

Behavior

Once we index the event:

  • removing all the bridges that have the depositCount field greater than newDepositCount from the event in the bridge table, and moving them to a separate table.
    • TBD reorgs handling, in a way that if certain bridge that was affected by BackwardLET later on the BackwardLET gets reorged,
  • figure out how to update the exitTree, which is AppendOnlyTree
    exitTree *tree.AppendOnlyTree
    . Should it become the UpdateableTree? 🤔

Open questions

  1. (L2) reorgs handling, because it seems that bridges should be removed from bridge table,
  2. exitTree should be UpdatableTree, since now we should be able to update its content (namely remove leafs)?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions