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

Move events and subscriptions out of RawExecutionOutcome. #3309

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

afck
Copy link
Contributor

@afck afck commented Feb 12, 2025

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 from RawExecutionOutcome. Also remove subscribe and unsubscribe; the same argument applies to them.

Test Plan

Refactoring; CI should catch regressions.

Release Plan

  • Nothing to do / These changes follow the usual release cycle.

Links

@afck afck requested review from ma2bd, deuszx and bart-linera February 12, 2025 15:31
@@ -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 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just Event?

Copy link
Contributor Author

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…

Comment on lines +46 to +49
/// Subscribe chains to channels.
pub subscribe: Vec<(ChannelFullName, ChainId)>,
/// Unsubscribe chains from channels.
pub unsubscribe: Vec<(ChannelFullName, ChainId)>,
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@afck afck merged commit a9145d2 into linera-io:main Feb 12, 2025
23 checks passed
@afck afck deleted the raw-execution-outcome branch February 12, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants