Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Latest commit

 

History

History
59 lines (41 loc) · 2.03 KB

077.md

File metadata and controls

59 lines (41 loc) · 2.03 KB

csanuragjain

medium

Network lag increases with Challenger intervention

Summary

If challenger deletes a l2Output root which is say 1 day old, then network will start lagging in

Vulnerability Detail

  1. Proposer needs to submit an output everyone 120 seconds (or 60 L2 blocks)

  2. Lets say Proposer submitted output root R1,R2,....RN at l2Outputs indexes x,y,......z on Day 1

function proposeL2Output(
        bytes32 _outputRoot,
        uint256 _l2BlockNumber,
        bytes32 _l1BlockHash,
        uint256 _l1BlockNumber
    ) external payable {
	...
	emit OutputProposed(_outputRoot, nextOutputIndex(), _l2BlockNumber, block.timestamp);

        l2Outputs.push(
            Types.OutputProposal({
                outputRoot: _outputRoot,
                timestamp: uint128(block.timestamp),
                l2BlockNumber: uint128(_l2BlockNumber)
            })
        );
    }
  1. On Day 2, Challenger sees an issue with the output generated by Proposer

  2. Challenger stops proposer so that proposer cannot keep on submitting new proposals

  3. Challenger uses deleteL2Outputs and delete the roots from index x

  4. Challenger analysis the issue which caused this, lets say it took 1 day

  5. Post 1 day, proposer is resumed

  6. Proposer will restart with index x which means it will already be delayed by 2 days in output creation. Since output creation is delayed the withdrawal processing also gets delayed causing a network lag

  7. If these issues are frequent then network lag will become large enough impacting the withdrawal timeline

Impact

Network lag will cause withdrawal delay

Code Snippet

https://github.com/sherlock-audit/2023-01-optimism/blob/main/optimism/packages/contracts-bedrock/contracts/L1/L2OutputOracle.sol#L128-L148

Tool used

Manual Review

Recommendation

If such a case arrives, proposer should be configurable to catch up the delay by submitting output more frequently