Skip to content

Commit

Permalink
Fixed the wrong signature on authority set change for aura.
Browse files Browse the repository at this point in the history
  • Loading branch information
remz committed Sep 4, 2022
1 parent 3062e3a commit c92b1fa
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 27 deletions.
48 changes: 24 additions & 24 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,36 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
sp-application-crypto = { version = "6.0.0", path = "../../../primitives/application-crypto" }
sp-consensus-aura = { version = "0.10.0-dev", path = "../../../primitives/consensus/aura" }
sp-block-builder = { version = "4.0.0-dev", path = "../../../primitives/block-builder" }
sc-block-builder = { version = "0.10.0-dev", path = "../../block-builder" }
sc-client-api = { version = "4.0.0-dev", path = "../../api" }
sp-application-crypto = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
codec = { package = "parity-scale-codec", version = "3.0.0" }
sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/common" }
sc-consensus = { version = "0.10.0-dev", path = "../../../client/consensus/common" }
sp-consensus-slots = { version = "0.10.0-dev", path = "../../../primitives/consensus/slots" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
thiserror = "1.0"
futures = "0.3.21"
sp-inherents = { version = "4.0.0-dev", path = "../../../primitives/inherents" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
log = "0.4.8"
sp-core = { version = "6.0.0", path = "../../../primitives/core" }
sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" }
sc-consensus-slots = { version = "0.10.0-dev", path = "../slots" }
sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" }
sp-runtime = { version = "6.0.0", path = "../../../primitives/runtime" }
sp-keystore = { version = "0.12.0", path = "../../../primitives/keystore" }
sc-telemetry = { version = "4.0.0-dev", path = "../../telemetry" }
prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../../utils/prometheus", version = "0.10.0-dev" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-consensus-slots = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
async-trait = "0.1.50"

[dev-dependencies]
sp-timestamp = { version = "4.0.0-dev", path = "../../../primitives/timestamp" }
sp-keyring = { version = "6.0.0", path = "../../../primitives/keyring" }
sp-tracing = { version = "5.0.0", path = "../../../primitives/tracing" }
sc-keystore = { version = "4.0.0-dev", path = "../../keystore" }
sc-network = { version = "0.10.0-dev", path = "../../network" }
sc-network-test = { version = "0.8.0", path = "../../network/test" }
substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sp-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
sc-network-test = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
substrate-test-runtime-client = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.19" }
tempfile = "3.1.0"
parking_lot = "0.12.0"
12 changes: 9 additions & 3 deletions src/import_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use sc_consensus::{
};
use sc_consensus_slots::{check_equivocation, CheckedHeader, InherentDataProviderExt};
use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_TRACE};
use sp_api::{ApiExt, ProvideRuntimeApi};
use sp_api::{ApiExt, Core, ProvideRuntimeApi};
use sp_block_builder::BlockBuilder as BlockBuilderApi;
use sp_blockchain::{
well_known_cache_keys::{self, Id as CacheKeyId},
Expand Down Expand Up @@ -204,8 +204,14 @@ where
) -> Result<(BlockImportParams<B, ()>, Option<Vec<(CacheKeyId, Vec<u8>)>>), String> {
let hash = block.header.hash();
let parent_hash = *block.header.parent_hash();
let authorities = authorities(self.client.as_ref(), &BlockId::Hash(parent_hash))
.map_err(|e| format!("Could not fetch authorities at {:?}: {}", parent_hash, e))?;
let runtime_api = self.client.runtime_api();
let at = &BlockId::Hash(parent_hash);
runtime_api.initialize_block(at, &block.header)
.map_err(|e| format!("Error initializing block {:?}: {:?}", parent_hash, e))?;

let authorities=runtime_api
.authorities(at)
.map_err(|e| format!("Could not fetch authorities at {:?}: {:?}", parent_hash, e))?;

let create_inherent_data_providers = self
.create_inherent_data_providers
Expand Down

0 comments on commit c92b1fa

Please sign in to comment.