-
Notifications
You must be signed in to change notification settings - Fork 960
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
Move events and subscriptions out of RawExecutionOutcome
.
#3309
Conversation
@@ -1156,6 +1156,34 @@ impl<'a> Deserialize<'a> for Blob { | |||
} | |||
} | |||
|
|||
/// An event recorded in an executed block. | |||
#[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize, Deserialize, SimpleObject)] | |||
pub struct EventRecord { |
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.
Why not just Event
?
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.
Right… the original reason (from the original PR) was that we already had an Event
type with a different meaning. But now I can rename it…
/// Subscribe chains to channels. | ||
pub subscribe: Vec<(ChannelFullName, ChainId)>, | ||
/// Unsubscribe chains from channels. | ||
pub unsubscribe: Vec<(ChannelFullName, ChainId)>, |
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.
What happens if there are multiple actions to subscribe/unsubscribe for the same channel<>chainId? Will we try to "cancel them out" before handling?
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.
No, we just handle all of them.
These will go away anyway when we finally have event streams and remove pub-sub channels.
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.
It's wasteful to handle if they will cancel out each other... If you say we'll remove them then it doesn't matter though.
Motivation
The fact that events are in
RawExecutionOutcome
makes #365 more complicated. They also conceptually don't need to be in the structure whose purpose is mainly to associate messages with the correct application ID and authenticated signer.Proposal
Remove
events
fromRawExecutionOutcome
. Also removesubscribe
andunsubscribe
; the same argument applies to them.Test Plan
Refactoring; CI should catch regressions.
Release Plan
Links