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

Implementer's guide: notes on contextual execution #1525

Merged
4 commits merged into from
Aug 3, 2020
Merged

Conversation

pepyakin
Copy link
Contributor

@pepyakin pepyakin commented Aug 3, 2020

plus clarification that validation_data_hash consists of the global and local validation data.

@pepyakin pepyakin added I7-documentation Documentation needs fixing, improving or augmenting. 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 3, 2020
@@ -63,6 +63,7 @@ All failed checks should lead to an unrecoverable error making the block invalid
1. check that `scheduled` is sorted ascending by `CoreIndex`, without duplicates.
1. check that there is no candidate pending availability for any scheduled `ParaId`.
1. check that each candidate's `validation_data_hash` corresponds to a `(LocalValidationData, GlobalValidationData)` computed from the current state.
> NOTE: With contextual execution in place, local and global validation data will be obtained as of the state of the context block. However, only the current state will be used for a such query.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
> NOTE: With contextual execution in place, local and global validation data will be obtained as of the state of the context block. However, only the current state will be used for a such query.
> NOTE: With contextual execution in place, local and global validation data will be obtained as of the state of the context block. However, only the current state will be used for such a query.

However, only the current state will be used for such a query

I also don't understand this. What does this means?

Copy link
Contributor

Choose a reason for hiding this comment

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

It means the current state needs to be able to provide LocalValidationData and GlobalValidationData for the last k ancestors.

Although, it can be done indirectly with a header-chain proof and a state proof from there.

Copy link
Contributor Author

@pepyakin pepyakin Aug 3, 2020

Choose a reason for hiding this comment

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

Well, it refers the same "current state" as the statement above. I.e. the current relay chain state. Stated differently: Let's only consider LocalValidationData. Currently, we have a function that looks roughly like this local_validation_data(para_id) that implicitly also takes the current relay-chain state. However, to support the contextual execution we will have to a function local_validation_data_at(para_id, ctx_block_num) where ctx_block_num is some past block. Note that this function also accepts the current relay-chain state implicitly. That basically translates that we need to be able to maintain required information around to be able to reconstruct that LocalValidationData.

Does it make sense now? If so, do you have an idea how to improve the wording?

UPD: ah @rphmeier beat me up to it

Copy link
Contributor Author

@pepyakin pepyakin Aug 3, 2020

Choose a reason for hiding this comment

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

Ok, I

  1. merged @bkchr 's suggestion
  2. changed the wording so that it says that we can only access the latest state (at most)
  3. I also added @rphmeier 's suggestion about the merkle proofs.

pepyakin and others added 2 commits August 3, 2020 21:07
@rphmeier
Copy link
Contributor

rphmeier commented Aug 3, 2020

🙏

@rphmeier
Copy link
Contributor

rphmeier commented Aug 3, 2020

bot merge

@ghost
Copy link

ghost commented Aug 3, 2020

Trying merge.

@ghost ghost merged commit b8d0c59 into master Aug 3, 2020
@ghost ghost deleted the ser-ctx-exec-notes branch August 3, 2020 19:30
ordian added a commit that referenced this pull request Aug 5, 2020
* master:
  Unalias Substrate Imports (#1530)
  Rewrite client handling (#1531)
  Integrate ChainApi with all messages (#1533)
  Add Rococo test network (#1363)
  Fix a typo parathreads -> parachains (#1529)
  Cleanup upcoming paras (#1527)
  Sudo wrapper for paras (#1517)
  Implementer's guide: notes on contextual execution (#1525)
  Companion for substrate/6782 (#1523)
  Sort out validation errors (#1516)
This pull request was closed.
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. I7-documentation Documentation needs fixing, improving or augmenting.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants