mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 01:41:09 +00:00
Move BEEFY code to consensus (#13484)
* Move beefy primitives to consensus dir * Move beefy gadget to client consensus folder * Rename beefy crates
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
[package]
|
||||
name = "beefy-gadget"
|
||||
version = "4.0.0-dev"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
repository = "https://github.com/paritytech/substrate"
|
||||
description = "BEEFY Client gadget for substrate"
|
||||
homepage = "https://substrate.io"
|
||||
|
||||
[dependencies]
|
||||
array-bytes = "4.1"
|
||||
async-trait = "0.1.57"
|
||||
codec = { package = "parity-scale-codec", version = "3.2.2", features = ["derive"] }
|
||||
fnv = "1.0.6"
|
||||
futures = "0.3"
|
||||
log = "0.4"
|
||||
parking_lot = "0.12.1"
|
||||
thiserror = "1.0"
|
||||
wasm-timer = "0.2.5"
|
||||
beefy-primitives = { version = "4.0.0-dev", path = "../../primitives/beefy", package = "sp-beefy" }
|
||||
prometheus = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../utils/prometheus" }
|
||||
sc-client-api = { version = "4.0.0-dev", path = "../api" }
|
||||
sc-consensus = { version = "0.10.0-dev", path = "../consensus/common" }
|
||||
sc-keystore = { version = "4.0.0-dev", path = "../keystore" }
|
||||
sc-network = { version = "0.10.0-dev", path = "../network" }
|
||||
sc-network-common = { version = "0.10.0-dev", path = "../network/common" }
|
||||
sc-network-gossip = { version = "0.10.0-dev", path = "../network-gossip" }
|
||||
sc-utils = { version = "4.0.0-dev", path = "../utils" }
|
||||
sp-api = { version = "4.0.0-dev", path = "../../primitives/api" }
|
||||
sp-application-crypto = { version = "7.0.0", path = "../../primitives/application-crypto" }
|
||||
sp-arithmetic = { version = "6.0.0", path = "../../primitives/arithmetic" }
|
||||
sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" }
|
||||
sp-consensus = { version = "0.10.0-dev", path = "../../primitives/consensus/common" }
|
||||
sp-core = { version = "7.0.0", path = "../../primitives/core" }
|
||||
sp-keystore = { version = "0.13.0", path = "../../primitives/keystore" }
|
||||
sp-mmr-primitives = { version = "4.0.0-dev", path = "../../primitives/merkle-mountain-range" }
|
||||
sp-runtime = { version = "7.0.0", path = "../../primitives/runtime" }
|
||||
|
||||
[dev-dependencies]
|
||||
serde = "1.0.136"
|
||||
tempfile = "3.1.0"
|
||||
tokio = "1.22.0"
|
||||
sc-block-builder = { version = "0.10.0-dev", path = "../block-builder" }
|
||||
sc-network-test = { version = "0.8.0", path = "../network/test" }
|
||||
sp-consensus-grandpa = { version = "4.0.0-dev", path = "../../primitives/consensus/grandpa" }
|
||||
sp-keyring = { version = "7.0.0", path = "../../primitives/keyring" }
|
||||
sp-tracing = { version = "6.0.0", path = "../../primitives/tracing" }
|
||||
substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" }
|
||||
@@ -0,0 +1,49 @@
|
||||
[package]
|
||||
name = "sc-consensus-beefy"
|
||||
version = "4.0.0-dev"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
|
||||
repository = "https://github.com/paritytech/substrate"
|
||||
description = "BEEFY Client gadget for substrate"
|
||||
homepage = "https://substrate.io"
|
||||
|
||||
[dependencies]
|
||||
array-bytes = "4.1"
|
||||
async-trait = "0.1.57"
|
||||
codec = { package = "parity-scale-codec", version = "3.2.2", features = ["derive"] }
|
||||
fnv = "1.0.6"
|
||||
futures = "0.3"
|
||||
log = "0.4"
|
||||
parking_lot = "0.12.1"
|
||||
thiserror = "1.0"
|
||||
wasm-timer = "0.2.5"
|
||||
prometheus = { package = "substrate-prometheus-endpoint", version = "0.10.0-dev", path = "../../../utils/prometheus" }
|
||||
sc-client-api = { version = "4.0.0-dev", path = "../../api" }
|
||||
sc-consensus = { version = "0.10.0-dev", path = "../../consensus/common" }
|
||||
sc-keystore = { version = "4.0.0-dev", path = "../../keystore" }
|
||||
sc-network = { version = "0.10.0-dev", path = "../../network" }
|
||||
sc-network-common = { version = "0.10.0-dev", path = "../../network/common" }
|
||||
sc-network-gossip = { version = "0.10.0-dev", path = "../../network-gossip" }
|
||||
sc-utils = { version = "4.0.0-dev", path = "../../utils" }
|
||||
sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" }
|
||||
sp-application-crypto = { version = "7.0.0", path = "../../../primitives/application-crypto" }
|
||||
sp-arithmetic = { version = "6.0.0", path = "../../../primitives/arithmetic" }
|
||||
sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" }
|
||||
sp-consensus = { version = "0.10.0-dev", path = "../../../primitives/consensus/common" }
|
||||
sp-consensus-beefy = { version = "4.0.0-dev", path = "../../../primitives/consensus/beefy" }
|
||||
sp-core = { version = "7.0.0", path = "../../../primitives/core" }
|
||||
sp-keystore = { version = "0.13.0", path = "../../../primitives/keystore" }
|
||||
sp-mmr-primitives = { version = "4.0.0-dev", path = "../../../primitives/merkle-mountain-range" }
|
||||
sp-runtime = { version = "7.0.0", path = "../../../primitives/runtime" }
|
||||
|
||||
[dev-dependencies]
|
||||
serde = "1.0.136"
|
||||
tempfile = "3.1.0"
|
||||
tokio = "1.22.0"
|
||||
sc-block-builder = { version = "0.10.0-dev", path = "../../block-builder" }
|
||||
sc-network-test = { version = "0.8.0", path = "../../network/test" }
|
||||
sp-consensus-grandpa = { version = "4.0.0-dev", path = "../../../primitives/consensus/grandpa" }
|
||||
sp-keyring = { version = "7.0.0", path = "../../../primitives/keyring" }
|
||||
sp-tracing = { version = "6.0.0", path = "../../../primitives/tracing" }
|
||||
substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" }
|
||||
+8
-10
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "beefy-gadget-rpc"
|
||||
name = "sc-consensus-beefy-rpc"
|
||||
version = "4.0.0-dev"
|
||||
authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2021"
|
||||
@@ -16,16 +16,14 @@ log = "0.4"
|
||||
parking_lot = "0.12.1"
|
||||
serde = { version = "1.0.136", features = ["derive"] }
|
||||
thiserror = "1.0"
|
||||
beefy-gadget = { version = "4.0.0-dev", path = "../." }
|
||||
beefy-primitives = { version = "4.0.0-dev", path = "../../../primitives/beefy", package = "sp-beefy" }
|
||||
sc-rpc = { version = "4.0.0-dev", path = "../../rpc" }
|
||||
sp-core = { version = "7.0.0", path = "../../../primitives/core" }
|
||||
sp-runtime = { version = "7.0.0", path = "../../../primitives/runtime" }
|
||||
sc-consensus-beefy = { version = "4.0.0-dev", path = "../" }
|
||||
sp-consensus-beefy = { version = "4.0.0-dev", path = "../../../../primitives/consensus/beefy" }
|
||||
sc-rpc = { version = "4.0.0-dev", path = "../../../rpc" }
|
||||
sp-core = { version = "7.0.0", path = "../../../../primitives/core" }
|
||||
sp-runtime = { version = "7.0.0", path = "../../../../primitives/runtime" }
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json = "1.0.85"
|
||||
sc-rpc = { version = "4.0.0-dev", features = [
|
||||
"test-helpers",
|
||||
], path = "../../rpc" }
|
||||
substrate-test-runtime-client = { version = "2.0.0", path = "../../../test-utils/runtime/client" }
|
||||
sc-rpc = { version = "4.0.0-dev", features = ["test-helpers"], path = "../../../rpc" }
|
||||
substrate-test-runtime-client = { version = "2.0.0", path = "../../../../test-utils/runtime/client" }
|
||||
tokio = { version = "1.22.0", features = ["macros"] }
|
||||
+6
-6
@@ -35,7 +35,7 @@ use jsonrpsee::{
|
||||
};
|
||||
use log::warn;
|
||||
|
||||
use beefy_gadget::communication::notification::{
|
||||
use sc_consensus_beefy::communication::notification::{
|
||||
BeefyBestBlockStream, BeefyVersionedFinalityProofStream,
|
||||
};
|
||||
|
||||
@@ -166,13 +166,13 @@ where
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
use beefy_gadget::{
|
||||
use codec::{Decode, Encode};
|
||||
use jsonrpsee::{types::EmptyServerParams as EmptyParams, RpcModule};
|
||||
use sc_consensus_beefy::{
|
||||
communication::notification::BeefyVersionedFinalityProofSender,
|
||||
justification::BeefyVersionedFinalityProof,
|
||||
};
|
||||
use beefy_primitives::{known_payloads, Payload, SignedCommitment};
|
||||
use codec::{Decode, Encode};
|
||||
use jsonrpsee::{types::EmptyServerParams as EmptyParams, RpcModule};
|
||||
use sp_consensus_beefy::{known_payloads, Payload, SignedCommitment};
|
||||
use sp_runtime::traits::{BlakeTwo256, Hash};
|
||||
use substrate_test_runtime_client::runtime::Block;
|
||||
|
||||
@@ -269,7 +269,7 @@ mod tests {
|
||||
let payload =
|
||||
Payload::from_single_entry(known_payloads::MMR_ROOT_ID, "Hello World!".encode());
|
||||
BeefyVersionedFinalityProof::<Block>::V1(SignedCommitment {
|
||||
commitment: beefy_primitives::Commitment {
|
||||
commitment: sp_consensus_beefy::Commitment {
|
||||
payload,
|
||||
block_number: 5,
|
||||
validator_set_id: 0,
|
||||
+2
-2
@@ -23,13 +23,13 @@ use sp_runtime::traits::Block as BlockT;
|
||||
|
||||
/// An encoded finality proof proving that the given header has been finalized.
|
||||
/// The given bytes should be the SCALE-encoded representation of a
|
||||
/// `beefy_primitives::VersionedFinalityProof`.
|
||||
/// `sp_consensus_beefy::VersionedFinalityProof`.
|
||||
#[derive(Clone, Serialize, Deserialize)]
|
||||
pub struct EncodedVersionedFinalityProof(sp_core::Bytes);
|
||||
|
||||
impl EncodedVersionedFinalityProof {
|
||||
pub fn new<Block>(
|
||||
finality_proof: beefy_gadget::justification::BeefyVersionedFinalityProof<Block>,
|
||||
finality_proof: sc_consensus_beefy::justification::BeefyVersionedFinalityProof<Block>,
|
||||
) -> Self
|
||||
where
|
||||
Block: BlockT,
|
||||
+2
-2
@@ -29,7 +29,7 @@ use parking_lot::{Mutex, RwLock};
|
||||
use wasm_timer::Instant;
|
||||
|
||||
use crate::{communication::peers::KnownPeers, keystore::BeefyKeystore, LOG_TARGET};
|
||||
use beefy_primitives::{
|
||||
use sp_consensus_beefy::{
|
||||
crypto::{Public, Signature},
|
||||
VoteMessage,
|
||||
};
|
||||
@@ -243,7 +243,7 @@ mod tests {
|
||||
use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};
|
||||
|
||||
use crate::keystore::BeefyKeystore;
|
||||
use beefy_primitives::{
|
||||
use sp_consensus_beefy::{
|
||||
crypto::Signature, known_payloads, Commitment, Keyring, MmrRootHash, Payload, VoteMessage,
|
||||
KEY_TYPE,
|
||||
};
|
||||
+1
-1
@@ -16,7 +16,6 @@
|
||||
|
||||
//! Helper for handling (i.e. answering) BEEFY justifications requests from a remote peer.
|
||||
|
||||
use beefy_primitives::BEEFY_ENGINE_ID;
|
||||
use codec::Decode;
|
||||
use futures::{
|
||||
channel::{mpsc, oneshot},
|
||||
@@ -26,6 +25,7 @@ use log::{debug, trace};
|
||||
use sc_client_api::BlockBackend;
|
||||
use sc_network::{config as netconfig, config::RequestResponseConfig, PeerId, ReputationChange};
|
||||
use sc_network_common::protocol::ProtocolName;
|
||||
use sp_consensus_beefy::BEEFY_ENGINE_ID;
|
||||
use sp_runtime::traits::Block;
|
||||
use std::{marker::PhantomData, sync::Arc};
|
||||
|
||||
+1
-1
@@ -18,7 +18,6 @@
|
||||
|
||||
//! Generating request logic for request/response protocol for syncing BEEFY justifications.
|
||||
|
||||
use beefy_primitives::{crypto::AuthorityId, ValidatorSet};
|
||||
use codec::Encode;
|
||||
use futures::channel::{oneshot, oneshot::Canceled};
|
||||
use log::{debug, warn};
|
||||
@@ -28,6 +27,7 @@ use sc_network_common::{
|
||||
request_responses::{IfDisconnected, RequestFailure},
|
||||
service::NetworkRequest,
|
||||
};
|
||||
use sp_consensus_beefy::{crypto::AuthorityId, ValidatorSet};
|
||||
use sp_runtime::traits::{Block, NumberFor};
|
||||
use std::{collections::VecDeque, result::Result, sync::Arc};
|
||||
|
||||
+1
-1
@@ -16,8 +16,8 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use beefy_primitives::{BeefyApi, BEEFY_ENGINE_ID};
|
||||
use log::debug;
|
||||
use sp_consensus_beefy::{BeefyApi, BEEFY_ENGINE_ID};
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use sp_api::{ProvideRuntimeApi, TransactionFor};
|
||||
+5
-5
@@ -17,17 +17,17 @@
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::keystore::BeefyKeystore;
|
||||
use beefy_primitives::{
|
||||
use codec::{Decode, Encode};
|
||||
use sp_consensus::Error as ConsensusError;
|
||||
use sp_consensus_beefy::{
|
||||
crypto::{AuthorityId, Signature},
|
||||
ValidatorSet, VersionedFinalityProof,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use sp_consensus::Error as ConsensusError;
|
||||
use sp_runtime::traits::{Block as BlockT, NumberFor};
|
||||
|
||||
/// A finality proof with matching BEEFY authorities' signatures.
|
||||
pub type BeefyVersionedFinalityProof<Block> =
|
||||
beefy_primitives::VersionedFinalityProof<NumberFor<Block>, Signature>;
|
||||
sp_consensus_beefy::VersionedFinalityProof<NumberFor<Block>, Signature>;
|
||||
|
||||
/// Decode and verify a Beefy FinalityProof.
|
||||
pub(crate) fn decode_and_verify_finality_proof<Block: BlockT>(
|
||||
@@ -80,7 +80,7 @@ fn verify_with_validator_set<Block: BlockT>(
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) mod tests {
|
||||
use beefy_primitives::{
|
||||
use sp_consensus_beefy::{
|
||||
known_payloads, Commitment, Keyring, Payload, SignedCommitment, VersionedFinalityProof,
|
||||
};
|
||||
use substrate_test_runtime_client::runtime::Block;
|
||||
+4
-4
@@ -22,7 +22,7 @@ use sp_keystore::{SyncCryptoStore, SyncCryptoStorePtr};
|
||||
|
||||
use log::warn;
|
||||
|
||||
use beefy_primitives::{
|
||||
use sp_consensus_beefy::{
|
||||
crypto::{Public, Signature},
|
||||
BeefyAuthorityId, KEY_TYPE,
|
||||
};
|
||||
@@ -89,8 +89,8 @@ impl BeefyKeystore {
|
||||
Ok(sig)
|
||||
}
|
||||
|
||||
/// Returns a vector of [`beefy_primitives::crypto::Public`] keys which are currently supported
|
||||
/// (i.e. found in the keystore).
|
||||
/// Returns a vector of [`sp_consensus_beefy::crypto::Public`] keys which are currently
|
||||
/// supported (i.e. found in the keystore).
|
||||
pub fn public_keys(&self) -> Result<Vec<Public>, error::Error> {
|
||||
let store = self.0.clone().ok_or_else(|| error::Error::Keystore("no Keystore".into()))?;
|
||||
|
||||
@@ -123,7 +123,7 @@ pub mod tests {
|
||||
use sc_keystore::LocalKeystore;
|
||||
use sp_core::{ecdsa, Pair};
|
||||
|
||||
use beefy_primitives::{crypto, Keyring};
|
||||
use sp_consensus_beefy::{crypto, Keyring};
|
||||
|
||||
use super::*;
|
||||
use crate::error::Error;
|
||||
@@ -32,10 +32,6 @@ use crate::{
|
||||
round::Rounds,
|
||||
worker::PersistedState,
|
||||
};
|
||||
use beefy_primitives::{
|
||||
crypto::AuthorityId, BeefyApi, MmrRootHash, PayloadProvider, ValidatorSet, BEEFY_ENGINE_ID,
|
||||
GENESIS_AUTHORITY_SET_ID,
|
||||
};
|
||||
use futures::{stream::Fuse, StreamExt};
|
||||
use log::{error, info};
|
||||
use parking_lot::Mutex;
|
||||
@@ -50,6 +46,10 @@ use sp_blockchain::{
|
||||
Backend as BlockchainBackend, Error as ClientError, HeaderBackend, Result as ClientResult,
|
||||
};
|
||||
use sp_consensus::{Error as ConsensusError, SyncOracle};
|
||||
use sp_consensus_beefy::{
|
||||
crypto::AuthorityId, BeefyApi, MmrRootHash, PayloadProvider, ValidatorSet, BEEFY_ENGINE_ID,
|
||||
GENESIS_AUTHORITY_SET_ID,
|
||||
};
|
||||
use sp_keystore::SyncCryptoStorePtr;
|
||||
use sp_mmr_primitives::MmrApi;
|
||||
use sp_runtime::traits::{Block, Zero};
|
||||
@@ -18,12 +18,12 @@
|
||||
|
||||
use crate::LOG_TARGET;
|
||||
|
||||
use beefy_primitives::{
|
||||
use codec::{Decode, Encode};
|
||||
use log::debug;
|
||||
use sp_consensus_beefy::{
|
||||
crypto::{AuthorityId, Public, Signature},
|
||||
Commitment, EquivocationProof, SignedCommitment, ValidatorSet, ValidatorSetId, VoteMessage,
|
||||
};
|
||||
use codec::{Decode, Encode};
|
||||
use log::debug;
|
||||
use sp_runtime::traits::{Block, NumberFor};
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
@@ -198,7 +198,7 @@ where
|
||||
mod tests {
|
||||
use sc_network_test::Block;
|
||||
|
||||
use beefy_primitives::{
|
||||
use sp_consensus_beefy::{
|
||||
crypto::Public, known_payloads::MMR_ROOT_ID, Commitment, EquivocationProof, Keyring,
|
||||
Payload, SignedCommitment, ValidatorSet, VoteMessage,
|
||||
};
|
||||
@@ -29,14 +29,6 @@ use crate::{
|
||||
load_or_init_voter_state, wait_for_runtime_pallet, BeefyRPCLinks, BeefyVoterLinks, KnownPeers,
|
||||
PersistedState,
|
||||
};
|
||||
use beefy_primitives::{
|
||||
crypto::{AuthorityId, Signature},
|
||||
known_payloads,
|
||||
mmr::MmrRootProvider,
|
||||
BeefyApi, Commitment, ConsensusLog, EquivocationProof, Keyring as BeefyKeyring, MmrRootHash,
|
||||
OpaqueKeyOwnershipProof, Payload, SignedCommitment, ValidatorSet, ValidatorSetId,
|
||||
VersionedFinalityProof, BEEFY_ENGINE_ID, KEY_TYPE as BeefyKeyType,
|
||||
};
|
||||
use futures::{future, stream::FuturesUnordered, Future, StreamExt};
|
||||
use parking_lot::Mutex;
|
||||
use sc_client_api::{Backend as BackendT, BlockchainEvents, FinalityNotifications, HeaderBackend};
|
||||
@@ -53,6 +45,14 @@ use sc_utils::notification::NotificationReceiver;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sp_api::{ApiRef, ProvideRuntimeApi};
|
||||
use sp_consensus::BlockOrigin;
|
||||
use sp_consensus_beefy::{
|
||||
crypto::{AuthorityId, Signature},
|
||||
known_payloads,
|
||||
mmr::MmrRootProvider,
|
||||
BeefyApi, Commitment, ConsensusLog, EquivocationProof, Keyring as BeefyKeyring, MmrRootHash,
|
||||
OpaqueKeyOwnershipProof, Payload, SignedCommitment, ValidatorSet, ValidatorSetId,
|
||||
VersionedFinalityProof, BEEFY_ENGINE_ID, KEY_TYPE as BeefyKeyType,
|
||||
};
|
||||
use sp_core::H256;
|
||||
use sp_keystore::{testing::KeyStore as TestKeystore, SyncCryptoStore, SyncCryptoStorePtr};
|
||||
use sp_mmr_primitives::{Error as MmrError, MmrApi};
|
||||
@@ -484,7 +484,7 @@ async fn wait_for_beefy_signed_commitments(
|
||||
let expected = expected.next();
|
||||
async move {
|
||||
let signed_commitment = match versioned_finality_proof {
|
||||
beefy_primitives::VersionedFinalityProof::V1(sc) => sc,
|
||||
sp_consensus_beefy::VersionedFinalityProof::V1(sc) => sc,
|
||||
};
|
||||
let commitment_block_num = signed_commitment.commitment.block_number;
|
||||
assert_eq!(expected, Some(commitment_block_num).as_ref());
|
||||
+10
-10
@@ -29,12 +29,6 @@ use crate::{
|
||||
round::{Rounds, VoteImportResult},
|
||||
BeefyVoterLinks, LOG_TARGET,
|
||||
};
|
||||
use beefy_primitives::{
|
||||
check_equivocation_proof,
|
||||
crypto::{AuthorityId, Signature},
|
||||
BeefyApi, Commitment, ConsensusLog, EquivocationProof, PayloadProvider, ValidatorSet,
|
||||
VersionedFinalityProof, VoteMessage, BEEFY_ENGINE_ID,
|
||||
};
|
||||
use codec::{Codec, Decode, Encode};
|
||||
use futures::{stream::Fuse, FutureExt, StreamExt};
|
||||
use log::{debug, error, info, log_enabled, trace, warn};
|
||||
@@ -45,6 +39,12 @@ use sc_utils::notification::NotificationReceiver;
|
||||
use sp_api::{BlockId, ProvideRuntimeApi};
|
||||
use sp_arithmetic::traits::{AtLeast32Bit, Saturating};
|
||||
use sp_consensus::SyncOracle;
|
||||
use sp_consensus_beefy::{
|
||||
check_equivocation_proof,
|
||||
crypto::{AuthorityId, Signature},
|
||||
BeefyApi, Commitment, ConsensusLog, EquivocationProof, PayloadProvider, ValidatorSet,
|
||||
VersionedFinalityProof, VoteMessage, BEEFY_ENGINE_ID,
|
||||
};
|
||||
use sp_runtime::{
|
||||
generic::OpaqueDigestItemId,
|
||||
traits::{Block, ConstU32, Header, NumberFor, Zero},
|
||||
@@ -1062,10 +1062,6 @@ pub(crate) mod tests {
|
||||
},
|
||||
BeefyRPCLinks, KnownPeers,
|
||||
};
|
||||
use beefy_primitives::{
|
||||
generate_equivocation_proof, known_payloads, known_payloads::MMR_ROOT_ID,
|
||||
mmr::MmrRootProvider, Keyring, Payload, SignedCommitment,
|
||||
};
|
||||
use futures::{future::poll_fn, task::Poll};
|
||||
use parking_lot::Mutex;
|
||||
use sc_client_api::{Backend as BackendT, HeaderBackend};
|
||||
@@ -1073,6 +1069,10 @@ pub(crate) mod tests {
|
||||
use sc_network_test::TestNetFactory;
|
||||
use sp_api::HeaderT;
|
||||
use sp_blockchain::Backend as BlockchainBackendT;
|
||||
use sp_consensus_beefy::{
|
||||
generate_equivocation_proof, known_payloads, known_payloads::MMR_ROOT_ID,
|
||||
mmr::MmrRootProvider, Keyring, Payload, SignedCommitment,
|
||||
};
|
||||
use sp_runtime::traits::One;
|
||||
use substrate_test_runtime_client::{
|
||||
runtime::{Block, Digest, DigestItem, Header, H256},
|
||||
@@ -14,10 +14,10 @@ homepage = "https://substrate.io"
|
||||
codec = { package = "parity-scale-codec", version = "3.2.2" }
|
||||
futures = "0.3"
|
||||
log = "0.4"
|
||||
beefy-primitives = { version = "4.0.0-dev", path = "../../primitives/beefy", package = "sp-beefy" }
|
||||
sc-client-api = { version = "4.0.0-dev", path = "../api" }
|
||||
sp-api = { version = "4.0.0-dev", path = "../../primitives/api" }
|
||||
sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" }
|
||||
sc-client-api = { version = "4.0.0-dev", path = "../api" }
|
||||
sp-consensus-beefy = { version = "4.0.0-dev", path = "../../primitives/consensus/beefy" }
|
||||
sp-consensus = { version = "0.10.0-dev", path = "../../primitives/consensus/common" }
|
||||
sp-core = { version = "7.0.0", path = "../../primitives/core" }
|
||||
sp-mmr-primitives = { version = "4.0.0-dev", path = "../../primitives/merkle-mountain-range" }
|
||||
|
||||
@@ -43,13 +43,13 @@ mod offchain_mmr;
|
||||
pub mod test_utils;
|
||||
|
||||
use crate::offchain_mmr::OffchainMmr;
|
||||
use beefy_primitives::MmrRootHash;
|
||||
use futures::StreamExt;
|
||||
use log::{debug, error, trace, warn};
|
||||
use sc_client_api::{Backend, BlockchainEvents, FinalityNotification, FinalityNotifications};
|
||||
use sc_offchain::OffchainDb;
|
||||
use sp_api::ProvideRuntimeApi;
|
||||
use sp_blockchain::{HeaderBackend, HeaderMetadata};
|
||||
use sp_consensus_beefy::MmrRootHash;
|
||||
use sp_mmr_primitives::{utils, LeafIndex, MmrApi};
|
||||
use sp_runtime::traits::{Block, Header, NumberFor};
|
||||
use std::{marker::PhantomData, sync::Arc};
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
#![warn(missing_docs)]
|
||||
|
||||
use crate::{aux_schema, MmrClient, LOG_TARGET};
|
||||
use beefy_primitives::MmrRootHash;
|
||||
use log::{debug, error, info, warn};
|
||||
use sc_client_api::{Backend, FinalityNotification};
|
||||
use sc_offchain::OffchainDb;
|
||||
use sp_blockchain::{CachedHeaderMetadata, ForkBackend};
|
||||
use sp_consensus_beefy::MmrRootHash;
|
||||
use sp_core::offchain::{DbExternalities, StorageKind};
|
||||
use sp_mmr_primitives::{utils, utils::NodesUtils, MmrApi, NodeIndex};
|
||||
use sp_runtime::{
|
||||
|
||||
Reference in New Issue
Block a user