Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Bypass chain-selection subsystem until disputes are enabled. #3676

Merged
merged 13 commits into from
Aug 20, 2021

Conversation

drahnr
Copy link
Contributor

@drahnr drahnr commented Aug 20, 2021

The cfg!(feature = "fx") does not exist yet, but it does not matter for compilation. Uses the feature = "disputes" as gate for the relay chain selection rule.

@drahnr drahnr self-assigned this Aug 20, 2021
@drahnr drahnr added A1-needsburnin A0-please_review Pull request needs code review. C3-medium PR touches the given topic and has a medium impact on builders. labels Aug 20, 2021
@rphmeier rphmeier changed the title cleanup of rob's patch Bypass chain-selection subsystem until disputes are enabled. Aug 20, 2021
@s3krit s3krit added the B0-silent Changes should not be mentioned in any release notes label Aug 20, 2021
@rphmeier
Copy link
Contributor

(as discussed, needs to feature-gate disputes lag checking as well)

@drahnr
Copy link
Contributor Author

drahnr commented Aug 20, 2021

The check labels bot is wrong.

@s3krit s3krit added B1-releasenotes and removed B0-silent Changes should not be mentioned in any release notes labels Aug 20, 2021
@s3krit
Copy link
Contributor

s3krit commented Aug 20, 2021

check_labels should be happy now

TODO move the fallback into selection
.map_err(Error::OverseerDisconnected)
.map_err(|e| ConsensusError::Other(Box::new(e)))?
.unwrap_or_else(|| (subchain_number, subchain_head));
let lag = if cfg!(feature = "disputes") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

lag_disputes
} else {
lag
};

// 4. Apply the maximum safeguard to the finality lag.
if lag > MAX_FINALITY_LAG {
Copy link
Member

@shawntabrizi shawntabrizi Aug 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im reviewing without context of all the surrounding code, but the behavior here before and after is different.

This check before was always checking against lag, and with the new code, could check against lag_disputes with the feature flag.

Was this a bug before? or a bug now?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug before, addressed here. Approval and disputes both apply constraints to the finalizable chain and previously the disputes lag wasn't accounted for in the 'max' check.

@rphmeier rphmeier merged commit 1371cfc into master Aug 20, 2021
@rphmeier rphmeier deleted the bernhard-cleanup-robs-patch branch August 20, 2021 22:22
@eskimor eskimor mentioned this pull request Aug 21, 2021
5 tasks
GopherJ pushed a commit to parallel-finance/polkadot that referenced this pull request Aug 23, 2021
…ech#3676)

* cleanup of rob's patch

* depend on feature disputes, both lag and query

* typo

* make it work

TODO move the fallback into selection

* option

* Update node/service/src/relay_chain_selection.rs

* remove trait implementation and fix errors

* hotfix: tests

* fmt

* remove unused trait

* make pub(crate) for test

* disable tests with disputed blocks

* Fix warnings

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
Co-authored-by: Lldenaurois <Ljdenaurois@gmail.com>
bkchr pushed a commit that referenced this pull request Aug 23, 2021
* Bypass chain-selection subsystem until disputes are enabled. (#3676)

* cleanup of rob's patch

* depend on feature disputes, both lag and query

* typo

* make it work

TODO move the fallback into selection

* option

* Update node/service/src/relay_chain_selection.rs

* remove trait implementation and fix errors

* hotfix: tests

* fmt

* remove unused trait

* make pub(crate) for test

* disable tests with disputed blocks

* Fix warnings

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
Co-authored-by: Lldenaurois <Ljdenaurois@gmail.com>

* properly gate sanity check (#3684)

Co-authored-by: Bernhard Schuster <bernhard@ahoi.io>
Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
Co-authored-by: Lldenaurois <Ljdenaurois@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. C3-medium PR touches the given topic and has a medium impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants