Skip to content
Merged
Show file tree
Hide file tree
Changes from 237 commits
Commits
Show all changes
243 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
7e427ab
Add the unincluded-segment-store crate
mchristou May 12, 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
73ba894
Add the unincluded-segment-store crate
mchristou May 12, 2026
c4bbc20
Wire the write path into slot-based block import
mchristou May 12, 2026
1889955
finality cleanup
mchristou May 12, 2026
666464c
more tests
mchristou May 12, 2026
f32f366
dedupe finality helpers, more tests
mchristou May 13, 2026
485219b
drop session field, prune just finalized
mchristou May 18, 2026
0d5cec2
more changes
mchristou May 18, 2026
0dcabbf
minor changes
mchristou May 18, 2026
6ef9b4a
drop unused deps && simpler aux encode
mchristou May 19, 2026
d3bf254
wrap aux helpers in UnincludedSegmentStore
mchristou May 20, 2026
5f15329
renaming && prune_old_sessions method
mchristou Jun 9, 2026
d8a82ed
remove leftovers
mchristou Jun 9, 2026
20fa40d
cleanup
mchristou Jun 9, 2026
3273c89
prdoc
mchristou Jun 9, 2026
2a9af3f
Merge branch 'master' into mchr-unicluded-segment-store
mchristou Jun 10, 2026
c1e89b9
Merge remote-tracking branch 'origin/master' into mchr-unicluded-segm…
mchristou Jun 10, 2026
64a09c8
changes
mchristou Jun 10, 2026
6ba4c3c
rename crate
mchristou Jun 10, 2026
4e63c7c
update prdoc
mchristou Jun 10, 2026
829a33d
add core index/selector
mchristou Jun 10, 2026
2624859
umbrella fix
mchristou Jun 10, 2026
1c67422
use arc for proof
mchristou Jun 11, 2026
47225ef
drop session based pruning
mchristou Jun 12, 2026
ad2f154
add required fields in import and build path
mchristou Jun 16, 2026
ae37f87
fixes
mchristou Jun 17, 2026
c22464c
use block import handle for import path
mchristou Jun 24, 2026
cc7770c
prdoc update
mchristou Jun 24, 2026
333bc8c
review feedback
mchristou Jun 25, 2026
1fa3cc8
doc fix
mchristou Jun 25, 2026
473e635
review changes
mchristou Jun 26, 2026
ca52a5b
remove unused dep
mchristou Jun 26, 2026
2004ea4
Merge branch 'master' into mchr-unicluded-segment-store
iulianbarbu Jul 1, 2026
1f9b0f1
review feedback
mchristou Jul 2, 2026
684cea6
prune entries that finalized while node was down
mchristou Jul 3, 2026
c221bc6
changes from feedback
mchristou Jul 3, 2026
d846312
move the collect_for_resubmission logic in the fn
mchristou Jul 3, 2026
0a1039e
changes
mchristou Jul 3, 2026
8bb033c
keep pvd in its initial state
mchristou Jul 8, 2026
8984fb6
review changes
mchristou Jul 13, 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
19 changes: 19 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ members = [
"cumulus/client/relay-chain-minimal-node",
"cumulus/client/relay-chain-rpc-interface",
"cumulus/client/relay-chain-streams",
"cumulus/client/resubmission-store",
"cumulus/client/service",
"cumulus/pallets/ah-ops",
"cumulus/pallets/aura-ext",
Expand Down Expand Up @@ -777,6 +778,7 @@ cumulus-client-network = { path = "cumulus/client/network", default-features = f
cumulus-client-parachain-inherent = { path = "cumulus/client/parachain-inherent", default-features = false }
cumulus-client-pov-recovery = { path = "cumulus/client/pov-recovery", default-features = false }
cumulus-client-proof-size-recording = { path = "cumulus/client/proof-size-recording", default-features = false }
cumulus-client-resubmission-store = { path = "cumulus/client/resubmission-store", default-features = false }
cumulus-client-service = { path = "cumulus/client/service", default-features = false }
cumulus-pallet-aura-ext = { path = "cumulus/pallets/aura-ext", default-features = false }
cumulus-pallet-parachain-system = { path = "cumulus/pallets/parachain-system", default-features = false }
Expand Down
2 changes: 2 additions & 0 deletions cumulus/client/consensus/aura/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ codec = { features = ["derive"], workspace = true, default-features = true }
futures = { workspace = true }
parking_lot = { workspace = true }
schnellru = { workspace = true }
thiserror = { workspace = true }
tokio = { workspace = true, features = ["macros"] }
tracing = { workspace = true, default-features = true }

Expand Down Expand Up @@ -50,6 +51,7 @@ cumulus-client-collator = { workspace = true, default-features = true }
cumulus-client-consensus-common = { workspace = true, default-features = true }
cumulus-client-parachain-inherent = { workspace = true, default-features = true }
cumulus-client-proof-size-recording = { workspace = true, default-features = true }
cumulus-client-resubmission-store = { workspace = true, default-features = true }
cumulus-primitives-aura = { workspace = true, default-features = true }
cumulus-primitives-core = { workspace = true, default-features = true }
cumulus-relay-chain-interface = { workspace = true, default-features = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <https://www.gnu.org/licenses/>.

use super::CollatorMessage;
use super::{
resubmission::{resolve_pvd, resolve_session},
CollatorMessage,
};
use crate::{
collator::{self as collator_util, BuildBlockAndImportParams, Collator, SlotClaim},
collators::{
Expand All @@ -36,6 +39,7 @@ use cumulus_client_consensus_common::{
ParachainBlockImportMarker, ParentSearchParams,
};
use cumulus_client_proof_size_recording::prepare_proof_size_recording_aux_data;
use cumulus_client_resubmission_store::{now_unix_ms, prepare_resubmission_aux_data};
use cumulus_primitives_aura::{AuraUnincludedSegmentApi, Slot};
use cumulus_primitives_core::{
BlockBundleInfo, ClaimQueueOffset, CoreInfo, CoreSelector, CumulusDigestItem,
Expand Down Expand Up @@ -731,6 +735,29 @@ where
check_validation_code_or_log(&validation_code_hash, para_id, relay_client, relay_parent_hash)
.await;

let session = resolve_session(relay_client, relay_parent_hash)
.await
.inspect_err(|err| {
tracing::warn!(
target: LOG_TARGET,
?relay_parent_hash,
?err,
"Could not resolve relay-parent session; resubmission entry will be skipped.",
);
})
.ok();
let pvd = resolve_pvd(relay_client, relay_parent_hash, para_id)
.await
.inspect_err(|err| {
tracing::warn!(
target: LOG_TARGET,
?relay_parent_hash,
?err,
"Could not resolve persisted validation data; resubmission entry will be skipped.",
);
})
.ok();

let mut blocks = Vec::new();
let mut proofs = Vec::new();
let mut ignored_nodes = IgnoredNodes::default();
Expand Down Expand Up @@ -875,6 +902,23 @@ where
);
}

let time_ms = now_unix_ms();
let proof = Arc::new(built_block.proof);
if let (Some(relay_parent_session), Some(pvd)) = (session, pvd.clone()) {
prepare_resubmission_aux_data::<Block>(
parent_hash,
time_ms,
proof.clone(),
relay_parent_header.clone(),
relay_parent_session,
pvd,
Comment thread
iulianbarbu marked this conversation as resolved.
Outdated
core_info.selector,
)
.for_each(|(k, v)| {
import_block.auxiliary.push((k, Some(v)));
});
}

if let Err(error) = collator.import_block(import_block).await {
tracing::error!(target: LOG_TARGET, ?error, "Failed to import built block.");
return Ok(None);
Expand All @@ -884,7 +928,7 @@ where
collator.collator_service().announce_block(parent_hash, None);

blocks.push(built_block.block);
proofs.push(built_block.proof);
proofs.push(Arc::unwrap_or_clone(proof));

let full_core_digest = CumulusDigestItem::contains_use_full_core(parent_header.digest());
let runtime_upgrade_digest = parent_header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

use crate::LOG_TARGET;
use codec::{Decode, Encode};
use cumulus_client_consensus_common::old_finalized_hash;
use cumulus_client_proof_size_recording::prepare_proof_size_recording_aux_data;
use cumulus_primitives_core::{BlockBundleInfo, CoreInfo, CumulusDigestItem, RelayBlockIdentifier};
use futures::{stream::FusedStream, StreamExt};
Expand Down Expand Up @@ -73,14 +74,14 @@ fn load_ignored_nodes<Block: BlockT, B: AuxStore>(
/// This handle should be passed to [`Params`](super::Params) or can also be dropped if the node is
/// not running as collator.
pub struct SlotBasedBlockImportHandle<Block> {
receiver: TracingUnboundedReceiver<(Block, StorageProof)>,
receiver: TracingUnboundedReceiver<(Block, Arc<StorageProof>)>,
}

impl<Block> SlotBasedBlockImportHandle<Block> {
/// Returns the next item.
///
/// The future will never return when the internal channel is closed.
pub async fn next(&mut self) -> (Block, StorageProof) {
pub async fn next(&mut self) -> (Block, Arc<StorageProof>) {
loop {
if self.receiver.is_terminated() {
futures::pending!()
Expand All @@ -100,14 +101,11 @@ where
{
let client_for_closure = client.clone();
let on_finality = move |notification: &FinalityNotification<Block>| -> AuxDataOperations {
// The old finalized block is the parent of the first block in the tree route,
// or the parent of the finalized block if the tree route is empty.
let old_finalized_hash = notification
.tree_route
.first()
.and_then(|hash| client_for_closure.header(*hash).ok().flatten())
.map(|h| *h.parent_hash())
.unwrap_or_else(|| *notification.header.parent_hash());
let old_finalized = old_finalized_hash::<_, Block>(
&*client_for_closure,
&notification.tree_route,
*notification.header.parent_hash(),
);

notification
.stale_blocks
Expand All @@ -125,7 +123,7 @@ where
.copied()
.map(|hash| (ignored_nodes_key(hash), None)),
)
.chain(std::iter::once((ignored_nodes_key(old_finalized_hash), None)))
.chain(std::iter::once((ignored_nodes_key(old_finalized), None)))
.collect()
};

Expand All @@ -136,7 +134,7 @@ where
pub struct SlotBasedBlockImport<Block: BlockT, BI, Client> {
inner: BI,
client: Arc<Client>,
sender: TracingUnboundedSender<(Block, StorageProof)>,
sender: TracingUnboundedSender<(Block, Arc<StorageProof>)>,
}

impl<Block: BlockT, BI, Client> SlotBasedBlockImport<Block, BI, Client> {
Expand Down Expand Up @@ -209,10 +207,11 @@ impl<Block: BlockT, BI, Client> SlotBasedBlockImport<Block, BI, Client> {
/// The proof must be recorded in exactly the same manner as during block building, because the
/// proof size is tracked via `ProofSizeExt` and affects runtime state. Without identical proof
/// recording, the computed state root would differ and block import would fail.
fn execute_block_and_collect_storage_proof(
async fn execute_block_and_collect_storage_proof(
&self,
params: &mut sc_consensus::BlockImportParams<Block>,
) -> Result<(), sp_consensus::Error>
collect_for_resubmission: bool,
) -> Result<Option<(Block, Arc<StorageProof>)>, sp_consensus::Error>
where
Client: ProvideRuntimeApi<Block>
+ CallApiAt<Block>
Expand All @@ -236,7 +235,7 @@ impl<Block: BlockT, BI, Client> SlotBasedBlockImport<Block, BI, Client> {
number = ?params.header.number(),
"no bundle digests, skipping execute_block_and_collect_storage_proof",
);
return Ok(());
return Ok(None);
};

let parent_hash = *params.header.parent_hash();
Expand All @@ -256,7 +255,9 @@ impl<Block: BlockT, BI, Client> SlotBasedBlockImport<Block, BI, Client> {
runtime_api.record_proof_with_recorder(recorder.clone());
runtime_api.register_extension(ProofSizeExt::new(proof_size_recorder.clone()));

let block = Block::new(params.header.clone(), params.body.clone().unwrap_or_default());
let body = params.body.clone().unwrap_or_default();
let resubmission_body = collect_for_resubmission.then(|| body.clone());
let block = Block::new(params.header.clone(), body);

tracing::debug!(
target: LOG_TARGET,
Expand Down Expand Up @@ -318,7 +319,10 @@ impl<Block: BlockT, BI, Client> SlotBasedBlockImport<Block, BI, Client> {
params.state_action =
StateAction::ApplyChanges(sc_consensus::StorageChanges::Changes(gen_storage_changes));

Ok(())
let Some(resubmission_body) = resubmission_body else { return Ok(None) };

let block = Block::new(params.header.clone(), resubmission_body);
Comment thread
iulianbarbu marked this conversation as resolved.
Outdated
Ok(Some((block, Arc::new(storage_proof))))
}
}

Expand Down Expand Up @@ -352,13 +356,31 @@ where
&self,
mut params: sc_consensus::BlockImportParams<Block>,
) -> Result<sc_consensus::ImportResult, Self::Error> {
if !(params.origin == BlockOrigin::Own ||
let origin = params.origin;

// Only blocks imported at the tip (built by other collators) are forwarded to the
// resubmission backfill task. Sync/gap/warp imports are historical and never part of our
// unincluded segment, so recording resubmission data for them would be wasted work (and
// would buffer their potentially large storage proofs).
let collect_for_resubmission =
matches!(origin, BlockOrigin::NetworkBroadcast | BlockOrigin::ConsensusBroadcast);
Comment thread
mchristou marked this conversation as resolved.
Outdated

let imported = if !(origin == BlockOrigin::Own ||
params.with_state() ||
params.state_action.skip_execution_checks())
{
self.execute_block_and_collect_storage_proof(&mut params)?;
self.execute_block_and_collect_storage_proof(&mut params, collect_for_resubmission)
.await?
} else {
None
};

let result = self.inner.import_block(params).await.map_err(Into::into)?;

if let Some((block, proof)) = imported {
let _ = self.sender.unbounded_send((block, proof));
Comment thread
alindima marked this conversation as resolved.
}

self.inner.import_block(params).await.map_err(Into::into)
Ok(result)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ pub struct Params<Block: BlockT, RClient, CS> {
pub collator_service: CS,
/// Receiver channel for communication with the block builder task.
pub collator_receiver: TracingUnboundedReceiver<CollatorMessage<Block>>,
/// The handle from the special slot based block import.
pub block_import_handle: super::SlotBasedBlockImportHandle<Block>,
/// When set, the collator will export every produced `POV` to this folder.
pub export_pov: Option<PathBuf>,
}
Expand All @@ -70,7 +68,6 @@ pub async fn run_collation_task<Block, RClient, CS>(
reinitialize,
collator_service,
mut collator_receiver,
mut block_import_handle,
export_pov,
}: Params<Block, RClient, CS>,
) where
Expand All @@ -91,21 +88,15 @@ pub async fn run_collation_task<Block, RClient, CS>(
)
.await;

loop {
futures::select! {
collator_message = collator_receiver.next() => {
let Some(message) = collator_message else {
return;
};

handle_collation_message(message, &collator_service, &mut overseer_handle,relay_client.clone(),export_pov.clone()).await;
},
block_import_msg = block_import_handle.next().fuse() => {
// TODO: Implement me.
// Issue: https://github.com/paritytech/polkadot-sdk/issues/6495
let _ = block_import_msg;
}
}
while let Some(message) = collator_receiver.next().await {
handle_collation_message(
message,
&collator_service,
&mut overseer_handle,
relay_client.clone(),
export_pov.clone(),
)
.await;
}
}

Expand Down
Loading
Loading