Skip to content

Commit

Permalink
build(deps): Bump substrate to polkadot-v1.9.0 (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
conr2d authored May 21, 2024
1 parent 03ef385 commit 089479f
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 116 deletions.
168 changes: 84 additions & 84 deletions Cargo.toml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion node/src/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::client::{FullBackend, FullClient};
pub use fc_consensus::FrontierBlockImport;
use fc_rpc::{EthTask, OverrideHandle};
pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool};
use futures::{future, prelude::*};
use futures::prelude::*;
use noir_core_primitives::Block;
use sc_client_api::BlockchainEvents;
use sc_executor::NativeExecutionDispatch;
Expand Down
11 changes: 5 additions & 6 deletions node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,12 +402,11 @@ where
None
} else {
net_config.add_notification_protocol(grandpa_protocol_config);
let warp_sync: Arc<dyn sc_network_sync::warp::WarpSyncProvider<Block>> =
Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
Vec::default(),
));
let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
grandpa_link.shared_authority_set().clone(),
Vec::default(),
));
Some(WarpSyncParams::WithProvider(warp_sync))
};

Expand Down
3 changes: 1 addition & 2 deletions primitives/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ base64ct = { workspace = true, optional = true }
hmac = { workspace = true, optional = true }
lazy_static = { workspace = true, optional = true }
parity-scale-codec = { workspace = true, features = ["derive", "max-encoded-len"] }
p256 = { workspace = true, optional = true }
p256 = { workspace = true }
regex = { workspace = true, optional = true }
scale-info = { workspace = true }
secp256k1 = { workspace = true, optional = true }
Expand Down Expand Up @@ -54,7 +54,6 @@ full_crypto = [
"array-bytes",
"base64ct",
"hmac",
"p256",
"sha2",
"secp256k1",
"sp-core/full_crypto",
Expand Down
2 changes: 1 addition & 1 deletion primitives/crypto/src/bip32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ use zeroize::{Zeroize, ZeroizeOnDrop};
use regex::Regex;
#[cfg(feature = "std")]
use sp_core::crypto::SecretStringError;
#[cfg(feature = "std")]
#[cfg(not(feature = "std"))]
use sp_std::vec::Vec;

#[cfg(feature = "std")]
Expand Down
27 changes: 8 additions & 19 deletions primitives/crypto/src/p256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use sp_runtime_interface::pass_by::PassByInner;

#[cfg(feature = "std")]
use bip39::{Language, Mnemonic, MnemonicType};
#[cfg(feature = "full_crypto")]
use p256::{
ecdsa::{
signature::hazmat::{PrehashSigner, PrehashVerifier},
Expand All @@ -35,19 +34,16 @@ use p256::{
};
#[cfg(feature = "std")]
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
#[cfg(feature = "full_crypto")]
use sp_core::crypto::DeriveError;
#[cfg(feature = "std")]
use sp_core::crypto::Ss58Codec;
use sp_core::crypto::{
ByteArray, CryptoType, CryptoTypeId, Derive, Public as TraitPublic, UncheckedFrom,
};
#[cfg(feature = "full_crypto")]
use sp_core::{
crypto::{DeriveJunction, Pair as TraitPair, SecretStringError},
crypto::{
ByteArray, CryptoType, CryptoTypeId, Derive, DeriveError, DeriveJunction,
Pair as TraitPair, Public as TraitPublic, SecretStringError, UncheckedFrom,
},
hashing::blake2_256,
};
#[cfg(feature = "full_crypto")]
#[cfg(not(feature = "std"))]
use sp_std::vec::Vec;

/// An identifier used to match public keys against ecdsa P-256 keys
Expand All @@ -56,11 +52,9 @@ pub const CRYPTO_ID: CryptoTypeId = CryptoTypeId(*b"p256");
/// A secret seed (which is bytewise essentially equivalent to a SecretKey).
///
/// We need it as a different type because `Seed` is expected to be AsRef<[u8]>.
#[cfg(feature = "full_crypto")]
type Seed = [u8; 32];

/// The ECDSA P-256 compressed public key.
#[cfg_attr(feature = "full_crypto", derive(Hash))]
#[derive(
Clone,
Copy,
Expand All @@ -73,6 +67,7 @@ type Seed = [u8; 32];
PartialEq,
PartialOrd,
Ord,
Hash,
)]
pub struct Public(pub [u8; 33]);

Expand Down Expand Up @@ -194,7 +189,6 @@ impl<'de> Deserialize<'de> for Public {
}

/// A signature (a 512-bit value).
#[cfg_attr(feature = "full_crypto", derive(Hash))]
#[derive(Encode, Decode, MaxEncodedLen, PassByInner, TypeInfo, PartialEq, Eq)]
pub struct Signature(pub [u8; 64]);

Expand Down Expand Up @@ -324,20 +318,17 @@ impl Signature {
}

/// Derive a single hard junction.
#[cfg(feature = "full_crypto")]
fn derive_hard_junction(secret_seed: &Seed, cc: &[u8; 32]) -> Seed {
("Secp256r1HDKD", secret_seed, cc).using_encoded(sp_core::hashing::blake2_256)
}

/// A key pair.
#[cfg(feature = "full_crypto")]
#[derive(Clone)]
pub struct Pair {
public: Public,
secret: SigningKey,
}

#[cfg(feature = "full_crypto")]
impl TraitPair for Pair {
type Public = Public;
type Seed = Seed;
Expand Down Expand Up @@ -414,6 +405,7 @@ impl TraitPair for Pair {
}

/// Sign a message.
#[cfg(feature = "full_crypto")]
fn sign(&self, message: &[u8]) -> Signature {
self.sign_prehashed(&blake2_256(message))
}
Expand All @@ -429,14 +421,14 @@ impl TraitPair for Pair {
}
}

#[cfg(feature = "full_crypto")]
impl Pair {
/// Get the seed for this key.
pub fn seed(&self) -> Seed {
Seed::from(self.secret.to_bytes())
}

/// Sign a pre-hashed message
#[cfg(feature = "full_crypto")]
pub fn sign_prehashed(&self, message: &[u8; 32]) -> Signature {
let sig: EcdsaSignature = self.secret.sign_prehash(message).unwrap();
Signature(sig.to_bytes().into())
Expand All @@ -460,16 +452,13 @@ impl Pair {
}

impl CryptoType for Public {
#[cfg(feature = "full_crypto")]
type Pair = Pair;
}

impl CryptoType for Signature {
#[cfg(feature = "full_crypto")]
type Pair = Pair;
}

#[cfg(feature = "full_crypto")]
impl CryptoType for Pair {
type Pair = Pair;
}
Expand Down
1 change: 1 addition & 0 deletions primitives/crypto/src/webauthn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use parity_scale_codec::{Decode, Encode};
use scale_info::TypeInfo;
use sp_runtime_interface::pass_by::PassByCodec;
#[cfg(not(feature = "std"))]
use sp_std::vec::Vec;

use crate::p256;
Expand Down
1 change: 1 addition & 0 deletions primitives/runtime/src/accountname.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

use parity_scale_codec::{Compact, CompactAs, Decode, Encode, Error, MaxEncodedLen};
use scale_info::TypeInfo;
#[cfg(not(feature = "std"))]
use sp_std::vec::Vec;

/// An account alias consisting of human readable string and 4-digit number.
Expand Down
1 change: 1 addition & 0 deletions primitives/runtime/src/universaladdress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use np_crypto::{ecdsa::EcdsaExt, p256};
use parity_scale_codec::{Decode, Encode, EncodeLike, Error, Input, MaxEncodedLen};
use scale_info::TypeInfo;
use sp_core::{ecdsa, ed25519, sr25519, H160, H256};
#[cfg(not(feature = "std"))]
use sp_std::vec::Vec;

#[cfg(feature = "serde")]
Expand Down
5 changes: 2 additions & 3 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ use sp_runtime::{
InvalidTransaction, TransactionSource, TransactionValidity, TransactionValidityError,
UnknownTransaction,
},
ApplyExtrinsicResult, ConsensusEngineId, Perbill, Permill,
ApplyExtrinsicResult, ConsensusEngineId, ExtrinsicInclusionMode, Perbill, Permill,
};
use sp_std::{marker::PhantomData, prelude::*};
#[cfg(feature = "std")]
Expand Down Expand Up @@ -454,7 +454,6 @@ impl pallet_balances::Config for Runtime {
type RuntimeHoldReason = ();
type RuntimeFreezeReason = ();
type FreezeIdentifier = ();
type MaxHolds = ();
type MaxFreezes = ();
}

Expand Down Expand Up @@ -1042,7 +1041,7 @@ impl_runtime_apis! {
fn execute_block(block: Block) {
Executive::execute_block(block);
}
fn initialize_block(header: &<Block as BlockT>::Header) {
fn initialize_block(header: &<Block as BlockT>::Header) -> ExtrinsicInclusionMode {
Executive::initialize_block(header)
}
}
Expand Down

0 comments on commit 089479f

Please sign in to comment.