|
14 | 14 | // You should have received a copy of the GNU General Public License |
15 | 15 | // along with Cumulus. If not, see <http://www.gnu.org/licenses/>. |
16 | 16 |
|
17 | | -// TODO [now]: docs |
| 17 | +//! A collator for Aura that looks ahead of the most recently included parachain block |
| 18 | +//! when determining what to build upon. |
| 19 | +//! |
| 20 | +//! This collator also builds additional blocks when the maximum backlog is not saturated. |
| 21 | +//! The size of the backlog is determined by invoking a runtime API. If that runtime API |
| 22 | +//! is not supported, this assumes a maximum backlog size of 1. |
| 23 | +//! |
| 24 | +//! This takes more advantage of asynchronous backing, though not complete advantage. |
| 25 | +//! When the backlog is not saturated, this approach lets the backlog temporarily 'catch up' |
| 26 | +//! with periods of higher throughput. When the backlog is saturated, we typically |
| 27 | +//! fall back to the limited cadence of a single parachain block per relay-chain block. |
| 28 | +//! |
| 29 | +//! Despite this, the fact that there is a backlog at all allows us to spend more time |
| 30 | +//! building the block, as there is some buffer before it can get posted to the relay-chain. |
| 31 | +//! The main limitation is block propagation time - i.e. the new blocks created by an author |
| 32 | +//! must be propagated to the next author before their turn. |
18 | 33 |
|
19 | 34 | use codec::{Decode, Encode}; |
20 | 35 | use cumulus_client_collator::service::ServiceInterface as CollatorServiceInterface; |
@@ -118,7 +133,9 @@ pub async fn run<Block, P, BI, CIDP, Client, RClient, SO, Proposer, CS>( |
118 | 133 | let relay_parent = relay_parent_header.hash(); |
119 | 134 |
|
120 | 135 | // TODO [now]: get asynchronous backing parameters from the relay-chain |
121 | | - // runtime. |
| 136 | + // runtime. why? |
| 137 | + |
| 138 | + // TOOD [now]: get slot from relay parent header |
122 | 139 |
|
123 | 140 | let parent_search_params = ParentSearchParams { |
124 | 141 | relay_parent, |
@@ -175,6 +192,7 @@ where |
175 | 192 | // all validators doing this every new relay-chain block. |
176 | 193 | // Actually, as long as sessions are based on slot number then they should |
177 | 194 | // be the same for all... |
| 195 | + // That is, blocks with the same relay-parent should have the same session. |
178 | 196 | // |
179 | 197 | // TODO [now]: new runtime API, |
180 | 198 | // AuraUnincludedSegmentApi::has_space(slot) or something like it. |
|
0 commit comments