-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
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.
Soundness of the fix checks out.
The test case itself needs attention.
Since modifying the subsystem in it's entirety is not feasible, there are a few things to do:
- add modification functions guarded behind
#[cfg(test)]
to modify the internal state as needed - modify
util::choose_random_subset
to consume animpl Rng
such that in test cases this can be modified as desired
With these changes in place the leading head comment of the test case can be removed in favor of the to be created issue link besides a few more notes inline, where the state is modified with the yet to be created functions.
An alternative approach would be, to not instantiate the full subsystem but only test the incoming messages, and update the view explicitly. The state is too complex though to do so imho.
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.
Good catch @vstakhov!
The change makes sense to me after following your explanation and commits but it does look tricky to catch,
bot merge |
Error: Checks failed for 9850839 |
* master: Try to fix out of view statements (#5177) Companion for Substrate#11107 (#5197) paras: `include_pvf_check_statement` rt bench (#4938) [ci] Run short benchmarks only in PR pipelines (#5200) Companion for paritytech/substrate#10242 (#4862) [ci] Add short benchmarks to the pipeline (#5188) upgrade coarsetime to 0.1.22 to fix a potential panic (#5193) Update docs and enable DOT-over-XCM (#4809) enable disputes on all chains (#5182) companion for validator self-vote in bags (#5088) Extract MAX_FINALITY_LAG constant from relay_chain_selection (#5159)
This issue happens when some peer sends a good but already known
Seconded
statement and the statement-distribution code does not update thestatements_received
field in thepeer_knowledge
structure. Subsequently, aValid
statement causesout-of-view
message that is incorrectly emitted and causes reputation lose.