-
Notifications
You must be signed in to change notification settings - Fork 803
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 candidate validation bounded again #2125
Merged
s0me0ne-unkn0wn
merged 19 commits into
master
from
s0me0ne/bounded-candidate-validation
Jan 21, 2024
Merged
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
092d6a3
Reorganize candidate processing
s0me0ne-unkn0wn 7f1698c
Re-implement using streams
s0me0ne-unkn0wn 4e64508
Merge remote-tracking branch 'origin/master' into s0me0ne/bounded-can…
s0me0ne-unkn0wn 6e0f461
Revert "Re-implement using streams"
s0me0ne-unkn0wn 83a0fe4
Add a semaphore lock
s0me0ne-unkn0wn 7e88b15
Merge remote-tracking branch 'origin/master' into s0me0ne/bounded-can…
s0me0ne-unkn0wn 0663ba0
`cargo fmt`
s0me0ne-unkn0wn 047cc03
Merge branch 'master' into s0me0ne/bounded-candidate-validation
s0me0ne-unkn0wn 52b5c5e
Handle messages in a separate fn
s0me0ne-unkn0wn a4cdcf8
Merge remote-tracking branch 'origin/master' into s0me0ne/bounded-can…
s0me0ne-unkn0wn b25eda0
Merge remote-tracking branch 'origin/master' into s0me0ne/bounded-can…
s0me0ne-unkn0wn 77aec82
Use overseer's new `recv_signal()`
s0me0ne-unkn0wn 6bcc212
Fix Malus
s0me0ne-unkn0wn fb20432
Fix tests
s0me0ne-unkn0wn ca97f47
Merge remote-tracking branch 'origin/master' into s0me0ne/bounded-can…
s0me0ne-unkn0wn a0e8065
Bump `orchestra` and dependencies
s0me0ne-unkn0wn 4c6e73d
Document the constant value
s0me0ne-unkn0wn 05e3b83
Implement `recv_signal` for test helper
s0me0ne-unkn0wn 92bacd3
Add `.prdoc`
s0me0ne-unkn0wn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 did we gave up on spawn I imagined we can do something like this, what am I missing ?
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.
Never mind :D I was dumb we need the select if don't want to block signals processing while the queue is full.
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.
AFAICT, in its current form, this PR will still not process signals while the queue is full. The
select
only helps with the other tasks being processed concurrently with the overseer messages (if we were using spawn, we wouldn't need the select)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.
True, and as far as I understand, that's exactly what we want. When the queue is full, signal processing stops, thus channeling the backpressure upstream.
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.
If we'd like to not block signal processing when the queue is full (which is really only for Conclude) we should add a separate task that handles
CandidateValidationMessage
s (and the main task sends work to it via a channel).Not having this would prevent the subsystem from shutting down if the queue is full I guess. Not sure if it's a real problem with a queue size of 10.. idk
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.
Maybe a dumb question but how exactly do signals and messages differ? Signals only notify of some change in state (i.e. shutdown, leaf update, etc)? Do they only originate from the overseer or from somewhere else as well?
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.
Exactly signals originate from the overseer and are prioritized.
The suggestion is to have an additional call recv_signal(), which only receives signals, but no messages ever. Indeed, we could make it three functions in total:
Then you would either use recv or the recv_signal/recv_msg combination, giving you more control
Prioritizing signals even more than what is done by default should not do any harm. The overseer already ensures that you are never receiving messages that have been sent after a leaf activation, before you have seen that signal as well.
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.
Is it possible to document this @s0me0ne-unkn0wn? Also, the docs for
OverseerSignal
are not very helpful: "Signals sent by an overseer to a subsystem".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.
Signals are sent as a form of broadcast to all subsystems by integration code, here it's (from memory) from the substrate block import pipeline (with a few intermediate steps).
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.
I think the better solution is to change orchestra to allow implementation of subsystems that don't really care about signals, maybe except
Conclude
. What I mean is that we either have a per subsystem configurableSIGNAL_TIMEOUT
, or annotate these subsystems such thatbroadcast_signal
only forwards themConclude
. Then we'd have to be careful to ensure nodes get stuck at shutdown because of this.