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 Oct 13, 2020

No description provided.


Some(Collation {
//TODO: What should we do here?
fees: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

The fees member can just be removed. We don't have anything that fees are charged for anymore, now that we use channels for messages.

Copy link
Member Author

Choose a reason for hiding this comment

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

This comes from the Polkadot side.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, we can remove it there. It's plumbed everywhere but essentially it starts it's life here.

https://github.com/paritytech/polkadot/blob/4e5df2988ce13851faf56de4e2f85b68a5601b8c/node/core/candidate-validation/src/lib.rs#L494-L494

so it's just a constant

let inherent_data = self.inherent_data(
&validation_data,
// TODO get the downward messages
Vec::new(),
Copy link
Contributor

Choose a reason for hiding this comment

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

what was the blocker here so far? Is it not passed in to the collation pipeline at the moment?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, should it? I assumed the collator would call the runtime API for fetching those

Copy link
Member Author

Choose a reason for hiding this comment

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

Before it was passed to the collation. I think it would be nice to follow this pattern, as we pass ValidationData as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I also think it would be convenient. But I also think it would potentially be less flexible, because after all it's the collator who knows which messages it should pull, whereas the collation-generation doesn't necessary know about the specifics of the network.

Copy link
Member Author

Choose a reason for hiding this comment

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

Wouldn't it need to fetch all downward messages anyway?

whereas the collation-generation doesn't necessary know about the specifics of the network.

Can you explain what you mean?

Copy link
Contributor

Choose a reason for hiding this comment

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

Potentially, it might be many, esp. if you include all the HRMP queues. But not only that, imagine a parachain that doesn't need HRMP, then it can just avoid requesting HRMP data at all. I think that it may be fair for XCMP as well. A conclusion I draw from this, is that the collator knows about the target chain (= "the network") better than the collation-generation can do (unless, we complicate the interface way more). That's why I say that the pull model is more flexible, because the collator has more information on when and how to query this data.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay fine :)

inherent_data,
Default::default(),
//TODO: Fix this.
Duration::from_millis(500),
Copy link
Contributor

Choose a reason for hiding this comment

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

what would this fix look like?

Copy link
Member Author

Choose a reason for hiding this comment

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

This comment is old. However, I think that I will be able to improve this with the switch to the slot interface. In the end I just need a reasonable max time for the block production. However, we will probably stick to 500ms for block production? This gives us 1.5 seconds for propagating it to the parachain validators and validation on their end.

storage::unhashed::put(VALIDATION_FUNCTION_PARAMS, &vfp);
DidUpdateVFPs::put(true);
<T::OnValidationFunctionParams as OnValidationFunctionParams>::on_validation_function_params(vfp);
storage::unhashed::put(VALIDATION_DATA, &vfp);
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 explain the new relationship between ValidationData and ValidationParams and for which situations each is relevant?

Copy link
Member Author

Choose a reason for hiding this comment

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

ValidationData is passed using an inherent into the runtime, while ValidationParams are passed when validating the parachain.

We use the ValidationParams to validate the ValidationData while validating the PovBlock.

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.

The code changes look fine to me, but can you explain in a bit more detail the expected inputs to the validation function and how it interfaces with Polkadot?

Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
@bkchr
Copy link
Member Author

bkchr commented Oct 27, 2020

The code changes look fine to me, but can you explain in a bit more detail the expected inputs to the validation function and how it interfaces with Polkadot?

Hmm? We take the ValidationParams as given by Polkadot. How should I take more data? Or do you mean something else?

And with interfacing with Polkadot, do you mean the client side?

@bkchr bkchr mentioned this pull request Nov 8, 2020
@bkchr bkchr merged commit 76f9eca into master Nov 8, 2020
@bkchr bkchr deleted the bkchr-parachains-v1 branch November 8, 2020 21:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants