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

Update collation-generation for asynchronous backing #5056

Closed
rphmeier opened this issue Mar 7, 2022 · 5 comments
Closed

Update collation-generation for asynchronous backing #5056

rphmeier opened this issue Mar 7, 2022 · 5 comments
Assignees
Labels
I8-refactor Code needs refactoring.

Comments

@rphmeier
Copy link
Contributor

rphmeier commented Mar 7, 2022

Once asynchronous backing is enabled, collation will be decoupled from the progress of the relay-chain. This subsystem should receive collations without pulling from the collator. It should give the collator-side hints about what to build upon, but no more than that.

@rphmeier rphmeier added the I8-refactor Code needs refactoring. label Mar 7, 2022
@bkchr
Copy link
Member

bkchr commented Mar 8, 2022

These hints should be "pull based". Aka the collation logic will ask collation generation on what to build on. Do you have any idea what kind of logic would be used there? Before I thought that the collation logic should use the select chain logic of the relay chain and that should be enough?

@rphmeier
Copy link
Contributor Author

rphmeier commented Mar 8, 2022

About pull-based: This means that we should add some message to the CollatorProtocol where the collator just queries and gets some data. Unless collators fully participate in statement gossip for their parachain, though, there's not much that the CollatorProtocol can tell the outer code except what the best relay-parent is and what the base block is at that parent.

Authoring strategies will probably have to get a bit more intricate. I have some ideas, but nothing that minimizes orphan blocks.

There are conflicting goals with collation, which need to be reconciled:

  1. When the prospective chain has space in it, build blocks faster than the relay chain
  2. When the prospective chain does not have space in it, build blocks as slow as or slower than the relay chain.

For example, with Aura, here are is a possible changeset:

  1. Slot is calculated as relay-chain block number + parachain block number
  2. Every block must prove its depth against the head-data in the relay-parent.
  3. Depth > N (2 or 3 probably) disallowed by parachain runtime
  4. This means that collators can either author blocks when the relay-chain advances or immediately when the depth of the longest-chain is low. this ensures we have a full prospective buffer

@bkchr
Copy link
Member

bkchr commented Mar 9, 2022

I have some ideas, but nothing that minimizes orphan blocks.

How do we get orphan blocks? Because we build on some "old" block that already has some other prospective blocks build on it?

@rphmeier
Copy link
Contributor Author

Yeah. Forks, races, and skipped slots due to full backlog

@rphmeier
Copy link
Contributor Author

@slumber any status update on this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
I8-refactor Code needs refactoring.
Projects
None yet
Development

No branches or pull requests

3 participants