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

paras: count upgrade delay from inclusion #7486

Merged
merged 7 commits into from
Jul 19, 2023

Conversation

slumber
Copy link
Contributor

@slumber slumber commented Jul 10, 2023

Resolves #4601

@slumber slumber added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited. labels Jul 10, 2023
@slumber slumber requested a review from bkchr July 17, 2023 11:34
Copy link
Member

@ordian ordian left a comment

Choose a reason for hiding this comment

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

Okay, so after this issue you will have the full validation_upgrade_delay instead of validation_upgrade_delay - 10 or 20. Sounds like we spent more time discussing here than the issue is worthwhile :D (sorry) But this also doesn't sound like a big problem or solves that much (as we theoretically can still run into this problem).

Yeah exactly! It's not a big issue.

This seems like a partial solution to a very contrived scenario, so not sure how helpful this change is.

I also have trouble following the example #4601 (comment)

Because the candidate with relay-parent 1939 is invalid nodes will dispute it, however, they won't be able since the new code is not available.

Wouldn't nodes disputing candidate with relay parent 1939 fetch PVF from that block or some recent block and not inclusion block?

runtime/parachains/src/paras/mod.rs Outdated Show resolved Hide resolved
@ordian ordian requested a review from pepyakin July 17, 2023 13:38
@slumber
Copy link
Contributor Author

slumber commented Jul 17, 2023

Wouldn't nodes disputing candidate with relay parent 1939 fetch PVF from that block or some recent block and not inclusion block?

The problem is it won't be available. The code gets stored on candidate's inclusion, however the delay for its enactment is counted from candidate's relay parent. So in total we're off by chain_availability_period + (with async backing) allowed_ancestry_len blocks. In numbers, that would mean that we're off by approx 10 + 5 blocks + another 1-2 for prechecking.

This seems like a partial solution to a very contrived scenario, so not sure how helpful this change is.

It is partial in a sense that validation_upgrade_delay is not deterministic value, or rather, it doesn't restrict chain from reverting past this number, but if we want to rely on it (i.e. assuming it is), we have to count from inclusion, otherwise (from the above paragraph) it's broken.

Copy link
Contributor

@rphmeier rphmeier left a comment

Choose a reason for hiding this comment

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

As mentioned in the original issue, this is strictly more correct now that code upgrades are handled with on-chain signals as opposed to coordinated block numbers. The GoAheadSignal infrastructure has been in place for over a year now, so all chains definitely make use of it.

@rphmeier
Copy link
Contributor

Nit: I really don't like the term "inclusion parent", since the 'parent' part isn't important for this case. included_at or included_in makes more sense.

@slumber
Copy link
Contributor Author

slumber commented Jul 17, 2023

bot merge

@paritytech-processbot
Copy link

Error: Statuses failed for 18f8932

@slumber
Copy link
Contributor Author

slumber commented Jul 17, 2023

bot merge

@paritytech-processbot
Copy link

Waiting for commit status.

@paritytech-processbot
Copy link

Merge cancelled due to error. Error: Statuses failed for 2654579

@slumber
Copy link
Contributor Author

slumber commented Jul 17, 2023

CI failure seems to be unrelated

@slumber
Copy link
Contributor Author

slumber commented Jul 19, 2023

bot merge

@paritytech-processbot
Copy link

Waiting for commit status.

@paritytech-processbot paritytech-processbot bot merged commit d005973 into master Jul 19, 2023
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. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D9-needsaudit 👮 PR contains changes to fund-managing logic that should be properly reviewed and externally audited.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Start counting expected_at from the inclusion
3 participants