fix: get rid of heavy DB query to start Arbitrum missed messages discovery process #10767
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
As per the approach introduced in #10374, the logic to start the discovery process of missing batches attempted to identify a rollup block where the first missed message was expected. Although this approach seemed intuitive, the corresponding query to the DB became very heavy with an increasing number of rollup transactions. For example, on the ArbitrumOne instance, the query takes hours (based on logs) and likely causes excessive resource consumption, leading to issues such as:
Changelog
Bug Fixes
To address the issue described above, a more simple approach has been implemented that starts looking for missed messages from the block before the latest indexed block.
While this new method may not be optimal for Blockscout instances without missed messages (which are assumed to be the majority), it offers several advantages:
missed_messages_blocks_depth
parameter.Checklist for your Pull Request (PR)
master
in the Version column. If I removed variable, I added it to Deprecated ENV Variables page. After merging docs PR, changes will be reflected in these pages.