-
Notifications
You must be signed in to change notification settings - Fork 5
feat(app): wire priority + infosync into the node #574
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -153,6 +153,9 @@ pub struct WireInputs { | |||||||||||||||||||||||||||||
| /// Optional per-slot subscriber; simnet wires the in-process validator | ||||||||||||||||||||||||||||||
| /// mock here. `None` in production and tests. | ||||||||||||||||||||||||||||||
| pub slot_tick: Option<SlotTickFn>, | ||||||||||||||||||||||||||||||
| /// Infosync component, triggered on each epoch's last slot to run the | ||||||||||||||||||||||||||||||
| /// cluster-wide priority exchange. `None` in tests. | ||||||||||||||||||||||||||||||
| pub infosync: Option<Arc<pluto_infosync::Component>>, | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| /// The wired components and long-lived handles produced by | ||||||||||||||||||||||||||||||
|
|
@@ -281,6 +284,7 @@ pub async fn wire_core_workflow( | |||||||||||||||||||||||||||||
| fetch_only_comm_idx0, | ||||||||||||||||||||||||||||||
| seen_pubkeys, | ||||||||||||||||||||||||||||||
| slot_tick, | ||||||||||||||||||||||||||||||
| infosync, | ||||||||||||||||||||||||||||||
| } = inputs; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // ---- Derived validator maps ---- | ||||||||||||||||||||||||||||||
|
|
@@ -608,6 +612,25 @@ pub async fn wire_core_workflow( | |||||||||||||||||||||||||||||
| if let Some(slot_tick) = slot_tick { | ||||||||||||||||||||||||||||||
| sched_builder.subscribe_slot(move |slot: &Slot| slot_tick(slot), "simnet.vmock"); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| // Per-epoch infosync trigger, fired on each epoch's last slot. A failure is | ||||||||||||||||||||||||||||||
| // logged by `subscribe_slot` and does not fail the node. | ||||||||||||||||||||||||||||||
| if let Some(infosync) = infosync { | ||||||||||||||||||||||||||||||
| let ct = ct.clone(); | ||||||||||||||||||||||||||||||
| sched_builder.subscribe_slot( | ||||||||||||||||||||||||||||||
| move |slot: &Slot| { | ||||||||||||||||||||||||||||||
| let infosync = Arc::clone(&infosync); | ||||||||||||||||||||||||||||||
| let ct = ct.clone(); | ||||||||||||||||||||||||||||||
| let slot = slot.clone(); | ||||||||||||||||||||||||||||||
| async move { | ||||||||||||||||||||||||||||||
| if slot.last_in_epoch() { | ||||||||||||||||||||||||||||||
| infosync.trigger(ct.child_token(), slot.slot).await?; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| Ok::<(), AppError>(()) | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
Comment on lines
+624
to
+629
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in 669fe0f — the trigger error now propagates via |
||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||
| "infosync", | ||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| // Slot subscriber: per-epoch validator cache trim + refresh (Charon's | ||||||||||||||||||||||||||||||
| // `wireCoreWorkflow`). | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
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.
Probably better to revisit this with the new set of arguments.
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.
Done in 669fe0f — replaced the 14 positional args (and the
too_many_argumentsallow) with aWireP2PParamsstruct destructured at the top ofwire_p2p.