Skip to content

Eliminate extra runtime calls used for DHT bootnode advertisement #8377

@dmitry-markin

Description

@dmitry-markin

This is a follow-up issue to #8072.

Currently, the epoch randomness for current and next epochs is fetched using runtime calls:

async fn current_epoch(&self, hash: RelayHash) -> RelayChainResult<Epoch> {
let res = self
.relay_chain_interface
.call_runtime_api("BabeApi_current_epoch", hash, &[])
.await?;
Decode::decode(&mut &*res).map_err(Into::into)
}
async fn next_epoch(&self, hash: RelayHash) -> RelayChainResult<Epoch> {
let res = self
.relay_chain_interface
.call_runtime_api("BabeApi_next_epoch", hash, &[])
.await?;
Decode::decode(&mut &*res).map_err(Into::into)
}

This can be optimized by only using runtime calls on startup, and later getting the randomness from the next epoch descriptor at the first block of every epoch.

Metadata

Metadata

Assignees

Labels

T0-nodeThis PR/Issue is related to the topic “node”.T9-cumulusThis PR/Issue is related to cumulus.

Type

No type
No fields configured for issues without a type.

Projects

Status
Blocked ⛔️

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions