-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: allow subsystems to send only declared messages, generate graphviz #5314
Conversation
9dbbe64
to
a62b113
Compare
This already generates the desired graphs but still needs some attention to details and make it a bit more ergnomic
digraph {
0 [ label="CandidateValidation"]
1 [ label="PvfChecker"]
2 [ label="CandidateBacking"]
3 [ label="StatementDistribution"]
4 [ label="AvailabilityDistribution"]
5 [ label="AvailabilityRecovery"]
6 [ label="BitfieldSigning"]
7 [ label="BitfieldDistribution"]
8 [ label="Provisioner"]
9 [ label="RuntimeApi"]
10 [ label="AvailabilityStore"]
11 [ label="NetworkBridge"]
12 [ label="ChainApi"]
13 [ label="CollationGeneration"]
14 [ label="CollatorProtocol"]
15 [ label="ApprovalDistribution"]
16 [ label="ApprovalVoting"]
17 [ label="GossipSupport"]
18 [ label="DisputeCoordinator"]
19 [ label="DisputeDistribution"]
20 [ label="ChainSelection"]
2 -> 14 [ label="CollatorProtocolMessage"]
2 -> 3 [ label="StatementDistributionMessage"]
2 -> 4 [ label="AvailabilityDistributionMessage"]
2 -> 8 [ label="ProvisionerMessage"]
2 -> 0 [ label="CandidateValidationMessage"]
// yet to be completed, but needs some grunt work
} |
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.
Looks good to me, I can't hardly wait to see the dependency graph 😀
Remaining issue: Shared code consumes minimum viable trait bounds i.e. Solution: Create per subsystem |
eb9cfe3
to
db7dc7d
Compare
TODOs:
|
#4259 is needed (at least for backing, provisioner, so the rest is easy after that) for async backing. So either sidestepping or ignoring Job based subsystems would be good. Coincidentally, I started working on #5377 today, because it blocks the statement-distribution / candidate-backing refactorings for async backing. |
5a0ae03
to
499292a
Compare
Given the annotation pain, there will be
and the user will have to use generated types and "special" names, |
97ed4b5
to
f198355
Compare
b85757c
to
980dd0f
Compare
Hints to reviewers:
Review recommendation: There are two examples: Out of scope:
|
They are really nice to haves
…ender.rs Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
…m_attr.rs Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
Co-authored-by: Tsvetomir Dimitrov <tsvetomir@parity.io>
bot merge |
Waiting for commit status. |
Merge cancelled due to error. Error: Statuses failed for a4ab390 |
is there a companion to this? |
No. I just checked and cumulus |
cumulus wasn't compiling, but it seems it just needed that bump. ty |
@drahnr please look at the errors appearing here: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/1567984 |
Tracked in https://github.com/paritytech/ci_cd/issues/433 and workaround in #5530 . I'd have a preference to have these as issues. |
Specializes the subsystems with a generated type
${SubsystemName}OutgoingMessages
which is use for the sender instead of the generatedAllMessages
types. This way there is a compile time guarantee per subsystem that only the intended messages can be sentKnowing the enabled declared messages to be sent also allows to create a directed graph from the relationship between subsystems
closes #3774
closes #3826