Closed github-actions[bot] closed 1 year ago
Comment from Optimism
Description: getL2OutputIndexAfter
can return a incorrect index
Reason: This report is false. The getL2OutputIndexAfter
function reverts if the provided l2 block number is greater than the latest block number within the L2OutputOracle
's l2Outputs
array. The intended behavior of the function is that, for all inputs <= the latest block number in the l2Outputs
array, the nearest index corresponding to a block number after or at the input block number will be returned. This is because the goal of the function is to find the "index of the first checkpoint that commits to the given L2 block number."
Handle
medium
getL2OutputIndexAfter
can return a incorrect indexSummary
The function
getL2OutputIndexAfter
can return a index that does not correspond to the paramater_l2BlockNumber
Vulnerability Detail
As said in L2OutputOracle.sol#L228-L235 the function
getL2OutputIndexAfter
Returns the index of the L2 output that checkpoints a given L2 block number however if the inputted parameter_l2BlockNumber
does not exist it will still return a index making it seem like the value of_l2BlockNumber
exist even though the index of the array will not correspond to the value of_l2BlockNumber
Impact
Code Snippet
Tool used
Manual Review
Recommendation