feat(solis-pending): add modification to starknet service to gather r…#12
Merged
kwiss merged 1 commit intosolis-v0.7.0-alphafrom May 28, 2024
Merged
Conversation
…ange block & then pending
|
Nice explanation of changes, and the code is all good from my perspective. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Enhance gather_messages function to handle pending and confirmed events
Pull Request Description
This pull request enhances the
gather_messagesfunction to ensure no events are missed by fetching and processing events from both confirmed and pending blocks within the Starknet blockchain.Summary of Changes
The
gather_messagesfunction now:from_blocktoto_block).Detailed Explanation
The function correctly handles errors in fetching the latest block number, logging a warning and returning an error.
from_blockAgainst Latest Block:This ensures the function does not process blocks that are not yet confirmed.
to_block:The
to_blockis determined correctly to avoid going beyond the latest block.Events are fetched and processed correctly, converting them into
L1HandlerTxtransactions if they meet the required criteria.A lock is acquired to ensure atomicity, and pending events are fetched and processed.
The latest block number is fetched again to ensure no new blocks were missed.
Confirmed events from the latest block are fetched and processed to ensure none are missed.
The cache is cleared, and pending events are fetched again to ensure no events are missed during cache clearing.
Complete Updated
gather_messagesFunction