Skip to content

Improve parachains_paras_inherent and Coretime benchmarks initialization #8869

@bkontur

Description

@bkontur

Identified in the fellows repo: https://github.com/polkadot-fellows/runtimes/actions/runs/15685983106/job/44189322905

2025-06-17T05:37:17.691857Z  WARN runtime::parachains: Took active validators from set with wrong size    
2025-06-17T05:37:17.691942Z ERROR runtime::parachains::coretime: Sending `NotifyCoreCount` to coretime chain failed: Unroutable    
2025-06-17T05:37:20.845511Z  WARN runtime::inclusion-inherent: ParentBlockRandomness did not provide entropy    
2025-06-17T05:37:22.418110Z  WARN runtime::parachains: Took active validators from set with wrong size    
2025-06-17T05:37:22.418187Z  WARN runtime::parachains: Took active validators from set with wrong size    
2025-06-17T05:37:22.418190Z  WARN runtime::parachains: Took active validators from set with wrong size.    
2025-06-17T05:37:22.418208Z  WARN runtime::parachains: Took active validators from set with wrong size    
2025-06-17T05:37:22.418487Z  WARN runtime::parachains: Took active validators from set with wrong size    
2025-06-17T05:37:22.418531Z  WARN runtime::parachains: Took active validators from set with wrong size    
2025-06-17T05:37:22.418533Z  WARN runtime::parachains: Took active validators from set with wrong size.    
2025-06-17T05:37:22.418550Z  WARN runtime::parachains: Took active validators from set with wrong size    
2025-06-17T05:37:22.418893Z  WARN runtime::parachains: Took active validators from set with wrong size    
2025-06-17T05:37:22.418950Z  WARN runtime::parachains: Took active validators from set with wrong size    
2025-06-17T05:37:22.418956Z  WARN runtime::parachains: Took active validators from set with wrong size.    
2025-06-17T05:37:22.418979Z  WARN runtime::parachains: Took active validators from set with wrong size    
2025-06-17T05:37:22.419068Z ERROR runtime::parachains::coretime: Sending `NotifyCoreCount` to coretime chain failed: Unroutable    
2025-06-17T05:37:25.623200Z  WARN runtime::inclusion-inherent: ParentBlockRandomness did not provide entropy    

There are couple of errors:

Sending `NotifyCoreCount` to coretime chain failed: Unroutable`

which are caused by coretime::Config module used as type CoretimeOnNewSession = Coretime;. The error is generated by this code:
https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/runtime/parachains/src/coretime/mod.rs#L271-L275, when sending XCMs with send_xcm, this coretime module sends also other XCMs, but all to the same location: Location::new(0, [Junction::Parachain(T::BrokerId::get())]),.

So as the possible fix, would be to trigger for benchmarks:

coretime/mod.rs

<T as coretime::Contig>::SendXcm::ensure_successful_delivery(
        Some(
                Location::new(0, [Junction::Parachain(<T as coretime::Contig>::BrokerId::get())])
        )
);

or alternatively:

// This could is exactly triggered with `ensure_successful_delivery` above - I prefere the above solution
Dmp::make_parachain_reachable(<T as coretime::Contig>::BrokerId);

But the problem is that, we need to find a best place where to trigger mentioned above solutions.
For paras::inherent benchmarks looks like the best place is BenchBuilder::build function here,
but paras::inherent::Config does not have direct reference to the coretime::Config (only through initialiezer's CoretimeOnNewSession), so we cannot access neither coretime::Config::SendXcm nor coretime::Config::BrokerId.

TODO

  • fix paras::inherent benchmarking error - potential issue that ChildParachainRouter or Dmp weights might not be included in the total weights
  • fix/check all other benchmarks that use/hit coretime::Config::SendXcm

Metadata

Metadata

Assignees

Labels

C1-mentorA task where a mentor is available. Please indicate in the issue who the mentor could be.T12-benchmarksThis PR/Issue is related to benchmarking and weights.

Type

No type

Projects

Status

No status

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions