-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Ensure that we fetch another collation if the first collation was invalid #3362
Conversation
target: LOG_TARGET, | ||
?relay_parent, | ||
candidate = ?candidate_receipt.hash(), | ||
"Trying to insert a pending candidate failed, because there is already one!", |
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 should be unreachable, right?
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.
It should be unreachable, yes. I just added it to have some error if we fucked it up.
collations.status.back_to_waiting(); | ||
collations.get_next_collation_to_fetch() |
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.
these function are only called together, maybe it makes sense to merge them?
if let Some(collations) = state.collations_per_relay_parent.get_mut(&relay_parent) { | ||
collations.status = CollationStatus::WaitingOnValidation; |
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.
how can it be None
?
can the status be Seconded
?
I feel like the state transition function could use more type-safety and checked assumptions/invariants built-in
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.
It can not be none, but I also don't want to use an expect here.
I feel like the state transition function could use more type-safety and checked assumptions/invariants built-in
Not sure what you mean here.
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 feel like the state transition function could use more type-safety and checked assumptions/invariants built-in
Not sure what you mean here.
I don't have a suggestion how to refactor it yet, so nevermind.
if let Some(collations) = state.collations_per_relay_parent.get_mut(&relay_parent) { | ||
collations.status = CollationStatus::WaitingOnValidation; |
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 feel like the state transition function could use more type-safety and checked assumptions/invariants built-in
Not sure what you mean here.
I don't have a suggestion how to refactor it yet, so nevermind.
* master: (21 commits) cleanup stream polls (#3397) Staking Miner (#3141) Companion for Substrate#8953 (#3140) Bump version, specs & substrate in prep for v0.9.8 (#3387) Fix busy loops. (#3392) Minor refactor (#3386) add simnet tests (#3381) BEEFY: adjust gossip (#3372) Companion for #9193 (#3376) Companion for Decouple Staking and Election - Part 3: Signed Phase (#2793) Ensure that we fetch another collation if the first collation was invalid (#3362) Only send one collation per relay parent at a time to validators (#3360) disable approval-checking-grandpa on dev chain (#3364) Use associated constant for max (#3375) Use wasm-builder from git (#3354) Squashed 'bridges/' changes from b2099c5..23dda62 (#3369) Bump versions & spec_versions (#3368) Don't allow bids for a ParaId where there is an overlapping lease period (#3361) Companion for upgrade of transaction-payment to pallet macro (#3267) Do not allow any crowdloan contributions during the VRF period (#3346) ...
No description provided.