Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dataworker): Don't permit out-of-order block ranges #1832

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

pxrl
Copy link
Contributor

@pxrl pxrl commented Sep 21, 2024

Without this check, the code produces a Lisk block range of [6063320, 6063319] when validating the proposal associated with dispute https://etherscan.io/tx/0x5255006f0a66f151d6a419b876dd673f94ec85a97cd3570bc54f7def7a6422a6.

This originally arose because the primary RPC provider used for determining the latest block number on Lisk had an outage and began severely lagging the head of the chain, such that the proposer was not able to increment its end block number past the previous proposal's end block number due to the Lisk block buffer imposed on new proposals.

@bmzig
Copy link
Contributor

bmzig commented Sep 21, 2024

Is this fine to do? It seems like we are permitting the block ranges to be out of order and just interpreting things differently if they are.

@pxrl
Copy link
Contributor Author

pxrl commented Sep 21, 2024

Is this fine to do? It seems like we are permitting the block ranges to be out of order and just interpreting things differently if they are.

The block ranges specified by widestPossibleExpectedBlockRange assume that the chain's start block should increment, and the range is [expectedStartBlockNumber, SpokePoolClient.latestBlockSearched]. This code is however swapping out SpokePoolClient.latestBlockSearched for the actual end block specified in the proposal that is being validated. Therefore, if the proposer chose not to increment the block range for this chain, this can result in an incoherent range.

This is OK as far as I can tell; provided that this new check is imposed to catch the out-of-order scenario.

It's also worth noting that per the UMIP, the proposer is permitted to soft-pause the chain if it can't reliably determine a valid block range: https://github.com/UMAprotocol/UMIPs/blob/master/UMIPs/umip-179.md#identifying-bundle-block-ranges. So the disputed proposal should actually be correct.

@pxrl pxrl merged commit 41d9d73 into master Sep 21, 2024
4 checks passed
@pxrl pxrl deleted the pxrl/blockRanges branch September 21, 2024 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants