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

Conversation

@bkchr
Copy link
Member

@bkchr bkchr commented Sep 10, 2020

This begins to make Polkadot usable from Cumulus.

This begins to make Polkadot usable from Cumulus.
@bkchr bkchr 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 Sep 10, 2020
@bkchr bkchr requested a review from rphmeier September 10, 2020 09:34
/// collate candidates that satisfy the criteria implied these transient validation data.
#[derive(PartialEq, Eq, Clone, Encode, Decode)]
#[cfg_attr(feature = "std", derive(Debug, Default))]
pub struct ValidationData<N = RelayChainBlockNumber> {
Copy link
Member Author

Choose a reason for hiding this comment

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

@rphmeier Essentially I will need all this data when validating the parachain PovBlock, so I copied that here. You think that this is okay? Or should I create some new struct for this? (Which would essentially contain all this data anyway).

Copy link
Contributor

@rphmeier rphmeier Sep 10, 2020

Choose a reason for hiding this comment

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

You should not need the TransientValidationData within the parachain runtime, at least not directly via ground truth.

ValidateFromExhaustive(
PersistedValidationData,
Option<TransientValidationData>,
TransientValidationData,
Copy link
Contributor

@rphmeier rphmeier Sep 10, 2020

Choose a reason for hiding this comment

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

The transient validation data is by definition transient. It literally won't be guaranteed available when this is called. That is why it is an Option.

Why does Cumulus need this? The role of this function should never need to cross the polkadot/cumulus boundary.

/// validation without needing to access the state of the relay-chain. Optionally provide the
/// `TransientValidationData` for further checks on the outputs.
/// Explicitly provide the `PersistedValidationData`, `TransientValidationData` and `ValidationCode`
/// so this can do full validation without needing to access the state of the relay-chain.
Copy link
Contributor

Choose a reason for hiding this comment

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

This docs change doesn't make sense, because the only way to access TransientValidationData is to access the state of the relay-chain.

pub hrmp_mqc_heads: Vec<(Id, Hash)>,
/// The validation data that was also available to the collator when
/// building the PoVBlock.
pub validation_data: ValidationData,
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe all of this info should go into ground truth.

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.

This completely erodes the distinction between Persisted and Transient validation data and alters the abstract parachain execution model without a clear reason.

@bkchr bkchr requested a review from rphmeier September 14, 2020 21:00
Arc<FullClient<RuntimeApi, Executor>>,
Arc<sc_network::NetworkService<Block, <Block as BlockT>::Hash>>,
RpcHandlers,
OverseerHandler,
Copy link
Contributor

Choose a reason for hiding this comment

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

:D

.collect()
impl primitives::v1::ParachainHost<Block, Hash, BlockNumber> for Runtime {
fn validators() -> Vec<ValidatorId> {
unimplemented!()
Copy link
Contributor

@rphmeier rphmeier Sep 15, 2020

Choose a reason for hiding this comment

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

I'm kind of worried what will happen if this is pushed to the chain and we have subsystems that query this runtime API. I think those subsystems may just fail and the node will go down. At the very least logs will get spammed a lot.

Yet we do need this implementation to actually get service to compile.

A different implementation where it just returns Vec::new() and None wherever possible would be better I think.

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.

Looks great except I'm worried about the unimplemented!() in the runtime.

@bkchr
Copy link
Member Author

bkchr commented Sep 15, 2020

Looks great except I'm worried about the unimplemented!() in the runtime.

I have done that, but now I'm more worried than you :P There will be 100% a timeframe where the new service will need to work with the old runtimes and if that is just for syncing. The services should not stop or print tons of data. We already had this with the availability system which printed a lot of data because it could not find required data and that is really bad for node operators, because they get spammed with useless warnings etc.

@bkchr bkchr requested a review from rphmeier September 15, 2020 10:29
@rphmeier rphmeier merged commit e75ae5b into master Sep 16, 2020
@rphmeier rphmeier deleted the bkchr-start-cumulus branch September 16, 2020 21:29
ordian pushed a commit that referenced this pull request Sep 17, 2020
* master:
  Unbreak master (#1729)
  Skeleton of the Router module (#1726)
  Companion for #6825 (#1552)
  Update Polkadot tokenDecimals & tokenSymbol (#1711)
  Prepare Polkadot to be used by Cumulus (#1697)
  Companion for #7103 (WeightInfo for Vesting) (#1721)
  Implementer's Guide: Router fixes (#1727)
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.

4 participants