-
Notifications
You must be signed in to change notification settings - Fork 248
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
event subscription shouldn't dismiss events from other phases #283
Conversation
User @gregdhill, please sign the CLA here. |
I'm on holiday at the moment, back next week so can review properly then |
@ascjones Any update on this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delayed review.
I believe the original intention of this was to only return those events which were triggered by the extrinsic.
Obviously the code has evolved since then with the option to wait for the events from the finalized block, for which I assume this is a fix.
However does this mean that the extrinsic filter does not work for subscribing to finalized block events? Because the index is only included in the ApplyExtrinsic
phase.
As I understand, this means that subscribing with accept_weak_inclusion
has different behaviour in that it can only return those events which are triggered by the extrinsic, whereas for finalized blocks events for all extrinsics will be returned.
In any case I'd like to see a test for this fix, if possible.
I think we also need to consider how to address the different semantics of subscribing to non-finalized vs finalized block events. It certainly makes the ExtrinsicSuccess
API fairly useless, since it returns the first event which matches the event/module in that block. Think about how many Balances(Transfers)
you might have...
We emit events in
It does work for extrinsics, the purpose of this PR was for block events from other phases.
The behavior should be the same, in that both will return the appropriate events depending on whether the block has been finalized. |
26e0a7c
to
c545703
Compare
Signed-off-by: Gregory Hill <[email protected]>
c545703
to
614250d
Compare
While this would fix the issue of filtering out events as part of
At the moment this will only give the Perhaps we could change the first block so that if the
Would that still work for your use case? (I assume listening for events in
In any case I think this api needs changing to expose the |
Superseded by #321 |
Signed-off-by: Gregory Hill [email protected]