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

Conversation

@rphmeier
Copy link
Contributor

@rphmeier rphmeier commented Aug 13, 2020

Closes #1539

This also includes a couple auxiliary changes:

  • A few more guide updates that were missed before
  • Reducing the fields in ValidationParams

@rphmeier rphmeier 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. labels Aug 13, 2020
@rphmeier rphmeier force-pushed the rh-validation-data-refactor-impl branch from 573dcaf to 8b40845 Compare August 13, 2020 19:22
/// The validation data, persisted and transient.
validation_data: ValidationData,
/// The validation data, persisted.
validation_data: PersistedValidationData,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you elaborate on this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason is that the ValidateCandidateExhaustive API supports not providing the TransientValidationData if not desired. Then there would be no way to return it with the validation outputs.

However, this change also doesn't impact our other primary user of the CandidateValidation subsystem: candidate backing. Since Candidate Validation checks the transient validation data when validating from the runtime state, there isn't anything else that candidate backing could meaningfully do with that data.

Copy link
Contributor

@drahnr drahnr left a 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

head_data: _,
local_validation_data: _,
global_validation_data: _,
persisted_validation_data: _,
Copy link
Contributor

Choose a reason for hiding this comment

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

I was a little puzzled by the syntax here at first. Normally, for a partial destructuring, I'd expect something more like

let TestState {
  chain_ids,
  validator_public,
  ..
} = ...;

such that the .. notation replaces all the unused fields. It's not a big deal here, but it's a useful syntax for the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

That's on me

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just me fixing fallout and preserving consistency with the code that was already there. But the syntax you mention is better for this, yeah.

/// issued in this block after the first block
/// with `relay_chain_height` at least this value, if `Some`. if `None`, issue
/// no upgrade.
pub code_upgrade_allowed: Option<polkadot_core_primitives::BlockNumber>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you intentionally remove code_upgrade_allowed? If yes, then it's not clear why; there's no obvious connection to the validation data refactor.

[edit] Maybe this is related to the code_upgrade_allowed field in TransientValidationData? If so, then this is fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I did intentionally do it. Checking whether a code upgrade was submitted only when allowed is done by the relay-chain at inclusion, so it doesn't need to be kept as part of the persisted validation data.

Comment on lines +219 to +220
/// The validation data provide information about how to validate both the inputs and
/// outputs of a candidate.
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 for thorough documentation here.

@rphmeier
Copy link
Contributor Author

bot merge

@ghost
Copy link

ghost commented Aug 18, 2020

Waiting for commit status.

@ghost
Copy link

ghost commented Aug 18, 2020

Checks failed; merge aborted.

@rphmeier
Copy link
Contributor Author

bot merge

@ghost
Copy link

ghost commented Aug 18, 2020

Waiting for commit status.

@ghost
Copy link

ghost commented Aug 18, 2020

Checks failed; merge aborted.

@rphmeier rphmeier merged commit 8c881e4 into master Aug 18, 2020
@rphmeier rphmeier deleted the rh-validation-data-refactor-impl branch August 18, 2020 12:41
ordian pushed a commit that referenced this pull request Aug 20, 2020
* master:
  Companion for Substrate #6815 (Dynamic Whitelist) (#1612)
  Candidate backing respects scheduled collator (#1613)
  implementers-guide: in TOC move collators before backing, to match protocol pipeline (#1611)
  Initial guide text for approvals and especially approvals assignments  (#1518)
  Implement validation data refactor (#1585)
  Implementer's Guide: Make HRMP use upward message kinds (#1591)
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValidationData refactoring

6 participants