-
Notifications
You must be signed in to change notification settings - Fork 139
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
Make all_messages_delivered_up_to take tracked_chains into account. #2562
base: main
Are you sure you want to change the base?
Conversation
tracing::debug!( | ||
"Messages left in {:.8}'s outbox: {:?}", | ||
self.chain_id(), | ||
self.outbox_counters.get() |
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.
Could we instead increment the counters right away for the messages to untracked chains?
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.
or just what you said: tracked_outbox_counters
perhaps we can also have: untracked_outbox_counters
to support future changes in the tracked chains
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.
Actually, maybe the outbox_counters
just need to refer only to the tracked chains. When those change, the counters have to be recomputed from the outboxes themselves anyway.
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.
…but then I wonder if we should move it from the (persisted) chain state view to the worker state?
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.
This works for me!
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.
(now that chain states are long lived)
Motivation
#2035 introduced a list of "tracked chains": In the local node, messages to non-tracked chains are not delivered and stay in the outbox.
However,
all_messages_delivered_up_to
doesn't take that into account yet, so if a chain is sending a message to a non-tracked chain, it would never returntrue
, and ifwait_for_outgoing_messages
istrue
,handle_certificate
could wait forever.Proposal
Return
true
fromall_messages_delivered_up_to
if all messages to tracked chains have been delivered, ignoring remaining outbox entries for untracked chains.TBD: This makes
wait_for_outgoing_messages
async and potentially much slower. We could instead addtracked_outbox_counters
that count only messages to tracked chains. This would need to be updated when the set of tracked chains changes, however.Test Plan
TBD: I should add a regression test for this.
Release Plan
devnet
branch, thentestnet
branch, thenLinks