Add finality status to EmittedEvent #326
Open
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.
Changes
It would be cool to return the finality status when returning events in
starknet_getEvents. In fact, I think it's really necessary, otherwise consumers of the jsonrpc API cannot know, when using getEvents for pre-confirmed whether a block is pre-confirmed or confirmed on l2.In addition, the info about whether the event is on L1 is really nice as well, although if the added complexity in the node implementation is too much,
is_preconfirmed: boolreplacing this finality status would be sufficient as well.This also affects websocket subscriptions in #323 - in fact, this is also very useful for the websocket API since it allows you to handle duplicated events properly.
Checklist:
npm run validate_allnpm run format(i'm using the github interface for these spec PRs, should I really clone the repo on my machine to test it there and check this checklist?)