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

feat: store the latest StarkNet block hash and number #113

Merged
merged 3 commits into from
Feb 6, 2024
Merged

feat: store the latest StarkNet block hash and number #113

merged 3 commits into from
Feb 6, 2024

Conversation

jbcaron
Copy link
Member

@jbcaron jbcaron commented Feb 5, 2024

Add tracking for StarkNet's highest block hash and number

This enhancement allows for real-time tracking of the StarkNet chain state, ensuring components have access to the most recent block info.

Pull Request type

Please add the labels corresponding to the type of changes your PR introduces:

  • Bugfix
  • Feature

What is the current behavior?

Resolves: #NA

What is the new behavior?

  • Implement a global, thread-safe variable using lazy_static to store the latest StarkNet block hash and number.
  • Add update_highest_block_hash_and_number async function to fetch and update the highest block information from the SequencerGatewayProvider.
  • Provide a get_highest_block_hash_and_number function to access the current highest block hash and number safely.

Does this introduce a breaking change?

No

Other information

Implement a global, thread-safe variable to store the latest StarkNet block hash and number.
@jbcaron jbcaron requested a review from antiyro February 5, 2024 21:49
@jbcaron jbcaron marked this pull request as ready for review February 6, 2024 09:28
@antiyro antiyro merged commit 2c6fb5b into KasarLabs:main Feb 6, 2024
5 of 7 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants