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

Add support for pending block ID in starknet_subscribeTransactionStatus #2366

Open
sistemd opened this issue Nov 12, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@sistemd
Copy link
Contributor

sistemd commented Nov 12, 2024

Right now we return an error when blockId: pending, but even with blockId: latest we do send pending updates for the current block. Instead blockId: latest should not return pending updates for the current block (i.e. current block at time of subscription), whereas pending should. I think this is what needs to change in the code:

  • This code should not run when block ID is pending.
  • If block ID is latest, we need to fetch the current block number n when starting the subscription, and add a special case so that this and this code only runs when the block number is larger than n+1 (note: this is only for the case where block ID is latest!). This ensures that a pending update for the upcoming block is not sent in the case where block ID is latest.
@sistemd sistemd self-assigned this Nov 12, 2024
@sistemd sistemd added the bug Something isn't working label Nov 12, 2024
@kkovaacs kkovaacs added this to the JSON-RPC 0.8.0 milestone Nov 14, 2024
@kkovaacs kkovaacs assigned kkovaacs and unassigned sistemd and kkovaacs Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants