Skip to content
Open
Show file tree
Hide file tree
Changes from 186 commits
Commits
Show all changes
203 commits
Select commit Hold shift + click to select a range
dfc51e2
Remove redundant implicit view from prospective parachains.
eskimor Dec 14, 2025
c7de64b
Move relay chain scope things to relay chain scope.
eskimor Dec 15, 2025
29276ed
Remove pointless GetMinimumRelayParents message
eskimor Dec 15, 2025
dcb2173
refactor: simplify backing implicit view to use per-relay-parent allowed
eskimor Dec 15, 2025
a7394aa
Fix tests
eskimor Dec 15, 2025
c57807f
Add prdoc
eskimor Dec 15, 2025
c1440a5
Fix statement-distribution tests
eskimor Dec 15, 2025
d268ed7
Fix benchmakrs + major version bumps
eskimor Dec 15, 2025
d1dc0da
Fix backing tests.
eskimor Dec 15, 2025
61f13f5
Remove performance difference note - unrelated.
eskimor Dec 16, 2025
d80f3f6
Fix tests.
eskimor Dec 17, 2025
44e74de
Reduce bits checked for v1 identification.
Nov 21, 2025
d548ee6
First attempt in introducing new CandidateDescriptor
eskimor Nov 24, 2025
ec09e00
Cleanup + simplerversion checking.
eskimor Nov 24, 2025
a640e54
Cleanup + make it typecheck.
eskimor Nov 25, 2025
1737e88
Remove yet unused SchedulingInfo.
eskimor Nov 25, 2025
42d5001
Drop v3 candidates in the runtime.
eskimor Nov 25, 2025
549244a
Code simplification + fixes.
eskimor Nov 25, 2025
f9ccd1b
Simplification + fixes
eskimor Nov 27, 2025
b2655fe
Better future upgrade behavior + better docs.
eskimor Nov 28, 2025
bd9ee57
Maintain old behavior when node feature is not set.
eskimor Nov 28, 2025
4cdf77e
v2 cleanup + fixes for v3.
eskimor Nov 28, 2025
c343c3f
Fixes
eskimor Dec 2, 2025
e1aaa39
Fixes.
eskimor Dec 2, 2025
f8dfbd1
Add new accessor functions
eskimor Dec 2, 2025
2611b50
Make it typecheck
eskimor Dec 2, 2025
851f950
Fix type without blowing up Debug
eskimor Dec 2, 2025
754eb8a
Compilation fixes
eskimor Dec 2, 2025
18af332
Fixes.
eskimor Dec 2, 2025
5813ea9
Fix runtime tests.
eskimor Dec 2, 2025
94eff27
Check scheduling session and scheduling parent in the runtime
eskimor Dec 2, 2025
f288d35
Towards V3 candidate descriptors with explicit scheduling_parent
eskimor Jan 9, 2026
1aba9f6
Candidate validation changes + collation generation comment
eskimor Jan 10, 2026
87559f0
Dispute coordinator goes scheduling parent
eskimor Jan 10, 2026
4754276
refactor: improve type safety and terminology for scheduling parent
eskimor Jan 10, 2026
4057523
collator-protocol: Support V3 collation protocol with explicit
eskimor Jan 14, 2026
a5c135d
More verified files.
eskimor Jan 15, 2026
c4ad28e
Introduce explicit scheduling_parent and pass to PVF via
eskimor Jan 16, 2026
12f19ba
Add comment about safety
eskimor Jan 16, 2026
e391bff
Remove runtime debug statements.
eskimor Jan 17, 2026
1fa7d33
Fix malus
eskimor Jan 22, 2026
53565cd
polkadot: fixes and cosmetic changes
iulianbarbu Feb 4, 2026
c84d49c
allowed_relay_parents_for -> allowed_relay_parents
eskimor Feb 9, 2026
12c24dc
Merge remote-tracking branch 'origin/master' into rk-prospective-para…
eskimor Feb 9, 2026
b188cc8
Fixes for merge
eskimor Feb 9, 2026
59867cc
Cleanup: Remove redundant node feature check
eskimor Feb 10, 2026
4fb5c86
Properly check session index of candidate
eskimor Feb 10, 2026
b3960e8
Merge remote-tracking branch 'origin/rk-prospective-parachains-cleanu…
eskimor Feb 10, 2026
9e4e529
Further fixes
eskimor Feb 10, 2026
4ccfe15
Fmt fixes
eskimor Feb 11, 2026
183b4fd
Remove unused imports
eskimor Feb 11, 2026
83dd94c
PVF fixes
eskimor Feb 17, 2026
1da3167
More fixes
eskimor Feb 17, 2026
aa4ab4f
More fixes
eskimor Feb 17, 2026
5a2d8f1
Fixes
eskimor Feb 17, 2026
deb6d35
Fmt fixes
eskimor Feb 18, 2026
3b3e310
Add tests for failure cases raised by Alin
eskimor Feb 19, 2026
968e6c3
Fix claim queue handling.
eskimor Feb 19, 2026
f5a418d
Fixes
eskimor Feb 20, 2026
d1ff88e
Test fixes
eskimor Feb 21, 2026
ade3224
Simpler algorithm
eskimor Feb 21, 2026
1daa156
Fixes.
eskimor Feb 24, 2026
8b1aea3
Somehow missed this
eskimor Feb 24, 2026
84fecfa
Make clippy happy
eskimor Feb 24, 2026
0ff2d90
Merge branch 'rk-prospective-parachains-cleanup' into rk-prep-new-can…
eskimor Feb 24, 2026
2bcfc51
Update docs, remove obsolete test.
eskimor Feb 25, 2026
6767af4
Address review feedbacks
eskimor Feb 25, 2026
d00a17b
polkadot: fix peer view update (#11183)
iulianbarbu Feb 25, 2026
76bf4d3
Cumulus: Add V3 ValidationParamsExtension support
eskimor Jan 1, 2026
c176f3e
Finished implementation with passing e2e test by Claude - not reviewed
eskimor Jan 2, 2026
e63cddf
Add resubmission support with SignedSchedulingInfo
eskimor Jan 4, 2026
4c10511
Add runtime-enforced MaxClaimQueueOffset for claim queue security
eskimor Jan 7, 2026
acd5818
Update cumulus/primitives/core/src/scheduling.rs
eskimor Jan 22, 2026
6d35516
Add Copy
eskimor Jan 22, 2026
9aec3b5
cumulus: implement scheduling related runtime APIs
iulianbarbu Feb 4, 2026
caf8305
polkadot(tests): fixes and added more logs
iulianbarbu Feb 4, 2026
783a5e6
cumulus: cosmetic changes
iulianbarbu Feb 4, 2026
83103b4
fix(cumulus): update omni-node runtime constraints
iulianbarbu Feb 4, 2026
85fe262
cumulus: add the peer_id field to SignedSchedulingInfo
iulianbarbu Feb 4, 2026
51ea583
docs: add mention about resubmission
iulianbarbu Feb 4, 2026
740be68
polkadot: fix collation-generation
iulianbarbu Feb 4, 2026
5f1374e
polkadot: fix primitives test-helpers
iulianbarbu Feb 4, 2026
9760d92
cumulus: fix cumulus test runtime
iulianbarbu Feb 4, 2026
b3b3d96
cumulus: reuse ApprovedPeerId instead of a new Multihash
iulianbarbu Feb 9, 2026
27e6867
polkadot: tests related changes
iulianbarbu Feb 24, 2026
1c8065a
cumulus: polish
iulianbarbu Feb 25, 2026
ec87cd2
cumulus: added scheduling v3 disabled runtime
iulianbarbu Feb 27, 2026
d0421a2
polkadot(tests): polish v3 candidate zn-sdk tests
iulianbarbu Feb 27, 2026
85c318b
polkadot: fix peer view updates
iulianbarbu Feb 27, 2026
c4212a1
fix: compilation issue
iulianbarbu Feb 27, 2026
9f7f85b
polkadot(tests): polish
iulianbarbu Feb 27, 2026
0ee0ad0
Merge branch 'master' of github.com:paritytech/polkadot-sdk into rk-c…
iulianbarbu Mar 13, 2026
f3e075e
polkadot: leftovers after merge
iulianbarbu Mar 13, 2026
44732c8
docs(sdk): fix identation & commenting
iulianbarbu Mar 13, 2026
4278fbc
cumulus: remove generated docs files
iulianbarbu Mar 13, 2026
8d8861f
Merge branch 'master' of github.com:paritytech/polkadot-sdk into rk-c…
iulianbarbu Mar 20, 2026
2140b1d
cumulus: add scheduling info for descendants start
iulianbarbu Mar 19, 2026
3a8f605
tests: check elastic scaling v2/v3 backwards compatiblity
iulianbarbu Mar 3, 2026
268be0a
Merge branch 'master' of github.com:paritytech/polkadot-sdk into rk-c…
iulianbarbu Mar 20, 2026
3229ce6
docs: fix comment indent
iulianbarbu Mar 23, 2026
1aeb2ef
cumulus: extract v3 scheduling validation to its own fn
iulianbarbu Mar 25, 2026
f3605ee
cumulus: apply cargo fmt to scheduling validation
iulianbarbu Mar 25, 2026
1383509
cumulus: deduce scheduling parent from scheduling proof
iulianbarbu Mar 25, 2026
9fbdded
Apply suggestions from code review
iulianbarbu Mar 26, 2026
f53307d
cumulus: skip relay parents only when rc tip is session change
iulianbarbu Mar 26, 2026
b48fc3f
cumulus: guard skipping removing by v3
iulianbarbu Mar 26, 2026
4991b9e
cumulus: lookahead & basic should not be V3 concerned
iulianbarbu Mar 27, 2026
85e98a8
cumulus: unite collation building for v3/v2 paths
iulianbarbu Mar 27, 2026
fbd8b61
cumulus: initialize vars closer to usage
iulianbarbu Mar 27, 2026
9166cbb
cumulus: remove MaxClaimQueueOffset config type
iulianbarbu Mar 28, 2026
531ab92
cumulus: simplify cqo usage & hash retrieval
iulianbarbu Mar 29, 2026
3067acd
cumulus: add comment to rp_data descedants
iulianbarbu Mar 29, 2026
caf6311
cumulus: cqo value determined base on v3 enabled
iulianbarbu Mar 29, 2026
826a50c
Merge branch 'master' of github.com:paritytech/polkadot-sdk into rk-c…
iulianbarbu Mar 29, 2026
b4ec301
ci: enable scheduling v3 tests
iulianbarbu Mar 29, 2026
bb6c6ee
cumulus(misc): polish comments and renamings
iulianbarbu Mar 29, 2026
ad6ea58
polkadot(tests): test with experimental validators too
iulianbarbu Mar 29, 2026
83ffe08
Update from github-actions[bot] running command 'fmt'
github-actions[bot] Mar 29, 2026
60265e5
ffix compilation issue
iulianbarbu Mar 29, 2026
964ea4e
fix some more clippy
iulianbarbu Mar 29, 2026
956df0f
templates: fix max_claim_queue_offset usage
iulianbarbu Mar 30, 2026
1329414
Merge branch 'master' into rk-cumulus-v3-integration
iulianbarbu Mar 30, 2026
7bfe1ad
yap: already has relay parent offset const
iulianbarbu Mar 30, 2026
0950d6e
staking-async: impl max_claim_queue_offset
iulianbarbu Mar 30, 2026
0fa1f7f
cumulus: support relay parent offset zero
iulianbarbu Mar 30, 2026
11b841d
cumulus: ignore slot offset when v3 enabled
iulianbarbu Mar 30, 2026
8c0d8ec
polkadot(tests): make backing groups bigger
iulianbarbu Mar 30, 2026
b464208
Update from github-actions[bot] running command 'fmt'
github-actions[bot] Mar 30, 2026
cc2e1be
polkadot(tests): fix es v3 test
iulianbarbu Mar 30, 2026
ce638c0
prdoc: add all modified crates
iulianbarbu Mar 30, 2026
2bba2c9
prdoc: update 10742 with the crates again
iulianbarbu Mar 30, 2026
a5a200d
prdoc: fix indent
iulianbarbu Mar 30, 2026
7a56e3e
prdoc: update bumps
iulianbarbu Mar 31, 2026
91229a7
Merge branch 'master' into rk-cumulus-v3-integration
iulianbarbu Mar 31, 2026
4d1c66b
prdoc: fix according to check-semver
iulianbarbu Mar 31, 2026
5704265
polkadot(tests): add v3 with relay parent offset collators test
iulianbarbu Mar 31, 2026
128b584
Cargo.toml: fix formatting
iulianbarbu Mar 31, 2026
325c48d
Merge branch 'master' into rk-cumulus-v3-integration
iulianbarbu Apr 1, 2026
12c6450
Merge branch 'master' into rk-cumulus-v3-integration
iulianbarbu Apr 1, 2026
88f499d
[branch rk-cumulus-v3-integration] SchedulingInfo: cosmetics (#11666)
serban300 Apr 7, 2026
6dc7dd7
Add V2 collator to scheduling_v3 tests for mixed fleet coverage (#11636)
mchristou Apr 7, 2026
e48f672
[rk-cumulus-v3-integration branch] offset_relay_parent_find_descendan…
serban300 Apr 10, 2026
86c47d5
CR comments
serban300 Apr 10, 2026
edbf49a
Merge remote-tracking branch 'upstream/master' into rk-cumulus-v3-int…
serban300 Apr 14, 2026
12af431
Fix conflicts
serban300 Apr 14, 2026
6832a93
Fix conflicts: polishing
serban300 Apr 15, 2026
5666cac
More polishing
serban300 Apr 16, 2026
09335ef
Adjust ParachainBlockData::new
serban300 Apr 20, 2026
0bfb273
build_collation() -> undo unneded change
serban300 Apr 20, 2026
7ea68dd
Merge commit 'fa31c1dbb23153fbfbae3e48143543af0fff6b0f' into rk-cumul…
serban300 Apr 21, 2026
4bf80bd
Merge commit '6e8ca55095e6bdb540f193c560cdc0419637a6d1' into rk-cumul…
serban300 Apr 21, 2026
bd78783
Polishing
serban300 Apr 21, 2026
2806bd9
Check if v3 is enabled on relay chain
serban300 Apr 22, 2026
6eab9ac
Merge branch 'master' into rk-cumulus-v3-integration
alindima Apr 30, 2026
6e6d82a
Addressing part of the CR comments
serban300 Apr 30, 2026
285b604
More CR comments
serban300 May 5, 2026
e0cab9f
scheduling_v3_es_collator_with_v3_validators -> 6 validators
serban300 May 5, 2026
671c8a9
offset_relay_parent_find_descendants fix
serban300 May 5, 2026
3f1a46e
Use max_relay_parent_session_age only when v3 is enabled
serban300 May 5, 2026
ddee4b5
More CR comments
serban300 May 5, 2026
26d3f20
fix
serban300 May 6, 2026
841ea47
Fix cumulus-test-runtime relay-parent-offset
serban300 May 6, 2026
672c454
fix
serban300 May 6, 2026
336b406
fix
serban300 May 6, 2026
e60861c
Merge branch 'master' into rk-cumulus-v3-integration
serban300 May 7, 2026
a76aaf3
Update prdoc
serban300 May 7, 2026
4c6a627
typo
serban300 May 7, 2026
ab50e41
prdoc fixes
serban300 May 7, 2026
ea9f0d5
More CR comments
serban300 May 7, 2026
79c0640
Apply suggestions from code review
serban300 May 12, 2026
b8f129d
simplification
serban300 May 12, 2026
5af100e
Some doc improvements (#12058)
eskimor May 12, 2026
f634ec9
More CR comments
serban300 May 12, 2026
d8deedf
Merge remote-tracking branch 'upstream/master' into rk-cumulus-v3-int…
serban300 May 12, 2026
a85d1cf
More CR comments
serban300 May 12, 2026
4a66485
More comments
serban300 May 13, 2026
d9670aa
fix
serban300 May 13, 2026
11b7746
cumulus: clean scheduling proof verifying primitive
iulianbarbu May 14, 2026
2b6f9d0
cumulus: make type bounded plain bytes
iulianbarbu May 14, 2026
fc162cd
More comments
serban300 May 14, 2026
951d242
Naming
serban300 May 15, 2026
a888450
cosmetics
serban300 May 15, 2026
0bf0e1d
cumulus: add SignedSchedulingInfo PVF verification
iulianbarbu May 18, 2026
0711917
verify scheduling signature from internal_scheduling_parent
mchristou May 22, 2026
112d3ab
fix resubmission verifier and peer overrides
mchristou May 25, 2026
5fc563f
review feedback
mchristou May 26, 2026
06b9862
Merge remote-tracking branch 'origin/master' into ib-signed-schedulin…
mchristou May 27, 2026
0b346e4
changes from feedback
mchristou May 27, 2026
420846a
fixes
mchristou May 27, 2026
b1f26a5
address review feedback
mchristou May 28, 2026
aaec6c3
prdoc
mchristou May 29, 2026
89ef822
add ed25519 coverage to the verifier tests
mchristou May 29, 2026
ab6ba86
Update Cargo.lock
mchristou May 29, 2026
ec17859
polishing
mchristou May 29, 2026
d1f5273
move the verify call into the seal-verification scope
mchristou May 29, 2026
34dc4b3
remove unused dep
mchristou May 29, 2026
0fa1474
Cleanup UMP signal handling (#12240)
eskimor Jun 3, 2026
2cd6fe6
review feedback
mchristou Jun 3, 2026
2d17025
ci fixes
mchristou Jun 3, 2026
5a5722c
address review feedback
mchristou Jun 4, 2026
6b97ec1
fixes
mchristou Jun 4, 2026
d79a10a
more fixes
mchristou Jun 4, 2026
cb7e905
ci fix
mchristou Jun 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/zombienet-tests/zombienet_polkadot_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,18 @@
runner-type: "default"
use-zombienet-sdk: true

- job-name: "zombienet-polkadot-scheduling-v2-and-v3-collator-with-v3-validators"
test-filter: "functional::scheduling_v3::scheduling_v2_and_v3_collator_with_v3_validators"
runner-type: "default"
use-zombienet-sdk: true
cumulus-image: "test-parachain"

- job-name: "zombienet-polkadot-scheduling-v3-es-collator-with-v3-validators"
test-filter: "functional::scheduling_v3::scheduling_v3_es_collator_with_v3_validators"
runner-type: "large"
use-zombienet-sdk: true
cumulus-image: "test-parachain"

- job-name: "zombienet-polkadot-scheduling-v3-dynamic-enablement"
test-filter: "functional::v3_dynamic_enablement::v3_dynamic_enablement_test"
runner-type: "default"
Expand Down
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 34 additions & 16 deletions cumulus/client/collator/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
//! operations used in parachain consensus/authoring.

use cumulus_client_network::WaitToAnnounce;
use cumulus_primitives_core::{CollationInfo, CollectCollationInfo, ParachainBlockData};
use cumulus_primitives_core::{
CollationInfo, CollectCollationInfo, ParachainBlockData, SchedulingProof,
};

use polkadot_primitives::UMP_SEPARATOR;
use sc_client_api::BlockBackend;
Expand Down Expand Up @@ -51,23 +53,31 @@ pub trait ServiceInterface<Block: BlockT> {
/// that the underlying block has been fully imported into the underlying client,
/// as implementations will fetch underlying runtime API data.
///
/// `scheduling_proof` is `Some` for V3 candidates (produces [`ParachainBlockData::V2`])
/// and `None` for legacy candidates (produces [`ParachainBlockData::V1`]).
///
/// This also returns the unencoded parachain block data, in case that is desired.
fn build_collation(
&self,
parent_header: &Block::Header,
block_hash: Block::Hash,
candidate: ParachainCandidate<Block>,
scheduling_proof: Option<SchedulingProof>,
) -> Option<(Collation, ParachainBlockData<Block>)>;

/// Build a multi-block collation.
///
/// Does the same as [`Self::build_collation`], but includes multiple blocks into one collation.
/// The given `parent_header` should be the header from the parent of the first block.
///
/// `scheduling_proof` is `Some` for V3 candidates (produces [`ParachainBlockData::V2`])
/// and `None` for legacy candidates (produces [`ParachainBlockData::V1`]).
fn build_multi_block_collation(
&self,
parent_header: &Block::Header,
blocks: Vec<Block>,
proof: StorageProof,
scheduling_proof: Option<SchedulingProof>,
) -> Option<(Collation, ParachainBlockData<Block>)>;

/// Inform networking systems that the block should be announced after a signal has
Expand Down Expand Up @@ -236,6 +246,7 @@ where
parent_header: &Block::Header,
blocks: Vec<Block>,
proof: StorageProof,
scheduling_proof: Option<SchedulingProof>,
) -> Option<(Collation, ParachainBlockData<Block>)> {
let compact_proof =
match proof.into_compact_proof::<HashingFor<Block>>(*parent_header.state_root()) {
Expand All @@ -246,7 +257,17 @@ where
},
};

let mut api_version = 0;
// We are always using the `api_version` of the parent block. The `api_version` can only
// change with a runtime upgrade and this is when we want to observe the old
// `api_version`. Because this old `api_version` is the one used to validate this
// block. Otherwise, we already assume the `api_version` is higher than what the relay
// chain will use and this will lead to validation errors.
let api_version = self
.runtime_api
.runtime_api()
.api_version::<dyn CollectCollationInfo<Block>>(parent_header.hash())
.ok()
.flatten()?;
let mut upward_messages = Vec::new();
let mut upward_message_signals = Vec::<Vec<u8>>::with_capacity(4);
let mut horizontal_messages = Vec::new();
Expand All @@ -269,18 +290,6 @@ where
.ok()
.flatten()?;

// We are always using the `api_version` of the parent block. The `api_version` can only
// change with a runtime upgrade and this is when we want to observe the old
// `api_version`. Because this old `api_version` is the one used to validate this
// block. Otherwise, we already assume the `api_version` is higher than what the relay
// chain will use and this will lead to validation errors.
api_version = self
.runtime_api
.runtime_api()
.api_version::<dyn CollectCollationInfo<Block>>(parent_header.hash())
.ok()
.flatten()?;

let (messages, signals) = Self::split_at_separator(collation_info.upward_messages);

upward_messages.extend(messages);
Expand All @@ -304,7 +313,7 @@ where
// Sort by recipient as required by the relay chain rules.
horizontal_messages.sort_by(|a, b| a.recipient.cmp(&b.recipient));

let block_data = ParachainBlockData::<Block>::new(blocks, compact_proof);
let block_data = ParachainBlockData::<Block>::new(blocks, compact_proof, scheduling_proof);

let pov = polkadot_node_primitives::maybe_compress_pov(PoV {
block_data: BlockData(if api_version >= 3 {
Expand Down Expand Up @@ -392,12 +401,14 @@ where
parent_header: &Block::Header,
_: Block::Hash,
candidate: ParachainCandidate<Block>,
scheduling_proof: Option<SchedulingProof>,
) -> Option<(Collation, ParachainBlockData<Block>)> {
CollatorService::build_multi_block_collation(
self,
parent_header,
vec![candidate.block],
candidate.proof,
scheduling_proof,
)
}

Expand All @@ -417,7 +428,14 @@ where
parent_header: &<Block as BlockT>::Header,
blocks: Vec<Block>,
proof: StorageProof,
scheduling_proof: Option<SchedulingProof>,
) -> Option<(Collation, ParachainBlockData<Block>)> {
CollatorService::build_multi_block_collation(self, parent_header, blocks, proof)
CollatorService::build_multi_block_collation(
self,
parent_header,
blocks,
proof,
scheduling_proof,
)
}
}
12 changes: 8 additions & 4 deletions cumulus/client/consensus/aura/src/collator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ where
inherent_data: (ParachainInherentData, InherentData),
proposal_duration: Duration,
max_pov_size: usize,
scheduling_proof: Option<cumulus_primitives_core::SchedulingProof>,
) -> Result<Option<(Collation, ParachainBlockData<Block>)>, Box<dyn Error + Send + 'static>> {
let maybe_candidate = self
.build_block_and_import(BuildBlockAndImportParams {
Expand All @@ -389,9 +390,12 @@ where
let Some(candidate) = maybe_candidate else { return Ok(None) };

let hash = candidate.block.header().hash();
if let Some((collation, block_data)) =
self.collator_service.build_collation(parent_header, hash, candidate.into())
{
if let Some((collation, block_data)) = self.collator_service.build_collation(
parent_header,
hash,
candidate.into(),
scheduling_proof,
) {
block_data.log_size_info();

if let MaybeCompressedPoV::Compressed(ref pov) = collation.proof_of_validity {
Expand Down Expand Up @@ -480,7 +484,7 @@ where
let authorities = runtime_api.authorities(parent_hash).map_err(Box::new)?;

// Determine the current slot and timestamp based on the relay-parent's.
let (slot_now, timestamp) = match consensus_common::relay_slot_and_timestamp(
let (slot_now, timestamp) = match consensus_common::get_relay_slot_and_timestamp(
relay_parent_header,
relay_chain_slot_duration,
) {
Expand Down
1 change: 1 addition & 0 deletions cumulus/client/consensus/aura/src/collators/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ where
(parachain_inherent_data, other_inherent_data),
params.authoring_duration,
allowed_pov_size,
None,
)
.await
);
Expand Down
14 changes: 9 additions & 5 deletions cumulus/client/consensus/aura/src/collators/lookahead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,10 @@ where

tracing::debug!(target: crate::LOG_TARGET, ?slot_duration, ?block_hash, "Parachain slot duration acquired");

let (relay_slot, timestamp) =
consensus_common::relay_slot_and_timestamp(relay_parent_header, relay_chain_slot_duration)?;
let (relay_slot, timestamp) = consensus_common::get_relay_slot_and_timestamp(
relay_parent_header,
relay_chain_slot_duration,
)?;

let slot_now = Slot::from_timestamp(timestamp, slot_duration);

Expand Down Expand Up @@ -476,17 +478,19 @@ where
validation_data.max_pov_size * 85 / 100
} as usize;

match collator
let collation_result = collator
.collate(
&parent_header,
&slot_claim,
None,
(parachain_inherent_data, other_inherent_data),
params.authoring_duration,
allowed_pov_size,
None,
)
.await
{
.await;

match collation_result {
Ok(Some((collation, block_data))) => {
let Some(new_block_header) =
block_data.blocks().first().map(|b| b.header().clone())
Expand Down
68 changes: 15 additions & 53 deletions cumulus/client/consensus/aura/src/collators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ use cumulus_primitives_core::{
relay_chain::Header as RelayHeader, BlockT, KeyToIncludeInRelayProof, RelayProofRequest,
};
use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface};
use polkadot_node_subsystem::messages::{CollatorProtocolMessage, RuntimeApiRequest};
use polkadot_node_subsystem::messages::CollatorProtocolMessage;
use polkadot_node_subsystem_util::runtime::ClaimQueueSnapshot;
use polkadot_primitives::{
Hash as RelayHash, Id as ParaId, OccupiedCoreAssumption, ValidationCodeHash,
DEFAULT_SCHEDULING_LOOKAHEAD,
};
use sc_client_api::HeaderBackend;
use sc_consensus_aura::{standalone as aura_internal, AuraApi};
use sp_api::{ApiExt, ProvideRuntimeApi, RuntimeApiInfo};
use sp_api::{ApiExt, ProvideRuntimeApi};
use sp_core::Pair;
use sp_keystore::KeystorePtr;
use sp_runtime::traits::Header;
Expand Down Expand Up @@ -152,49 +152,6 @@ async fn check_validation_code_or_log(
}
}

/// Fetch scheduling lookahead at given relay parent.
async fn scheduling_lookahead(
relay_parent: RelayHash,
relay_client: &impl RelayChainInterface,
) -> Option<u32> {
let runtime_api_version = relay_client
.version(relay_parent)
.await
.map_err(|e| {
tracing::error!(
target: super::LOG_TARGET,
error = ?e,
"Failed to fetch relay chain runtime version.",
)
})
.ok()?;

let parachain_host_runtime_api_version = runtime_api_version
.api_version(
&<dyn polkadot_primitives::runtime_api::ParachainHost<polkadot_primitives::Block>>::ID,
)
.unwrap_or_default();

if parachain_host_runtime_api_version <
RuntimeApiRequest::SCHEDULING_LOOKAHEAD_RUNTIME_REQUIREMENT
{
return None;
}

match relay_client.scheduling_lookahead(relay_parent).await {
Ok(scheduling_lookahead) => Some(scheduling_lookahead),
Err(err) => {
tracing::error!(
target: crate::LOG_TARGET,
?err,
?relay_parent,
"Failed to fetch scheduling lookahead from relay chain",
);
None
},
}
}

// Returns the claim queue at the given relay parent.
async fn claim_queue_at(
relay_parent: RelayHash,
Expand Down Expand Up @@ -290,14 +247,12 @@ async fn find_parent<Block>(
where
Block: BlockT,
{
let parent_search_params = ParentSearchParams {
relay_parent,
para_id,
ancestry_lookback: scheduling_lookahead(relay_parent, relay_client)
.await
.unwrap_or(DEFAULT_SCHEDULING_LOOKAHEAD)
.saturating_sub(1) as usize,
};
let ancestry_lookback = relay_client
.scheduling_lookahead(relay_parent)
.await
.unwrap_or(DEFAULT_SCHEDULING_LOOKAHEAD)
.saturating_sub(1) as usize;
let parent_search_params = ParentSearchParams { relay_parent, para_id, ancestry_lookback };

let mut result = match cumulus_client_consensus_common::find_parent_for_building::<Block>(
parent_search_params,
Expand Down Expand Up @@ -743,6 +698,13 @@ impl RelayParentData {
&self.relay_parent
}

/// Returns a reference to the descendants list.
///
/// List is ordered from oldest to newest.
pub fn descendants(&self) -> &[RelayHeader] {
&self.descendants
}

/// Returns the number of descendants.
#[cfg(test)]
pub fn descendants_len(&self) -> usize {
Expand Down
Loading