Update dependecies (#2277) (#2281)

* cargo update -p parachain-info

* flush

* it compiles

* clippy

* temporary add more logging to cargo deny

* Revert "temporary add more logging to cargo deny"

This reverts commit 20daa88bca6d9a01dbe933579b1d57ae5c3a7bd8.

* list installed Rust binaries before running cargo deny

* changed prev commit

* once again

* try cargo update?

* post-update fixes (nothing important)
This commit is contained in:
Svyatoslav Nikolsky
2023-07-19 18:18:05 +03:00
committed by Bastian Köcher
parent b4c7ffd3d3
commit 4d42bb22f3
69 changed files with 409 additions and 486 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive", "bit-vec"] }
scale-info = { version = "2.9.0", default-features = false, features = ["bit-vec", "derive"] }
serde = { version = "1.0", optional = true }
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
# Bridge Dependencies
@@ -34,7 +34,7 @@ std = [
"pallet-beefy-mmr/std",
"pallet-mmr/std",
"scale-info/std",
"serde",
"serde/std",
"sp-consensus-beefy/std",
"sp-runtime/std",
"sp-std/std"
+2 -2
View File
@@ -37,6 +37,7 @@ use bp_runtime::{BasicOperatingMode, BlockNumberOf, Chain, HashOf};
use codec::{Decode, Encode};
use frame_support::Parameter;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use sp_runtime::{
traits::{Convert, MaybeSerializeDeserialize},
RuntimeAppPublic, RuntimeDebug,
@@ -127,8 +128,7 @@ pub type BeefyMmrLeafOf<C> = sp_consensus_beefy::mmr::MmrLeaf<
///
/// Provides the initial context that the bridge needs in order to know
/// where to start the sync process from.
#[derive(Encode, Decode, RuntimeDebug, PartialEq, Clone, TypeInfo)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
#[derive(Encode, Decode, RuntimeDebug, PartialEq, Clone, TypeInfo, Serialize, Deserialize)]
pub struct InitializationData<BlockNumber, Hash> {
/// Pallet operating mode.
pub operating_mode: BasicOperatingMode,
@@ -18,7 +18,7 @@
pub use bp_polkadot_core::{
AccountId, AccountInfoStorageMapKeyProvider, AccountPublic, Balance, BlockNumber, Hash, Hasher,
Hashing, Header, Index, Nonce, Perbill, Signature, SignedBlock, UncheckedExtrinsic,
Hashing, Header, Nonce, Perbill, Signature, SignedBlock, UncheckedExtrinsic,
EXTRA_STORAGE_PROOF_SIZE, TX_EXTRA_BYTES,
};
@@ -53,7 +53,7 @@ pub const NORMAL_DISPATCH_RATIO: Perbill = Perbill::from_percent(75);
/// This is a copy-paste from the cumulus repo's `parachains-common` crate.
const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(constants::WEIGHT_REF_TIME_PER_SECOND, 0)
.saturating_div(2)
.set_proof_size(polkadot_primitives::v4::MAX_POV_SIZE as u64);
.set_proof_size(polkadot_primitives::v5::MAX_POV_SIZE as u64);
/// All cumulus bridge hubs assume that about 5 percent of the block weight is consumed by
/// `on_initialize` handlers. This is used to limit the maximal weight of a single extrinsic.
@@ -140,7 +140,7 @@ pub type SignedExtra = (
CheckTxVersion,
CheckGenesis<Hash>,
CheckEra<Hash>,
CheckNonce<Index>,
CheckNonce<Nonce>,
CheckWeight,
ChargeTransactionPayment<Balance>,
BridgeRejectObsoleteHeadersAndMessages,
@@ -159,12 +159,12 @@ pub trait BridgeHubSignedExtension {
transaction_version: u32,
era: bp_runtime::TransactionEra<BlockNumber, Hash>,
genesis_hash: Hash,
nonce: Index,
nonce: Nonce,
tip: Balance,
) -> Self;
/// Return transaction nonce.
fn nonce(&self) -> Index;
fn nonce(&self) -> Nonce;
/// Return transaction tip.
fn tip(&self) -> Balance;
@@ -177,7 +177,7 @@ impl BridgeHubSignedExtension for SignedExtension {
transaction_version: u32,
era: bp_runtime::TransactionEra<BlockNumber, Hash>,
genesis_hash: Hash,
nonce: Index,
nonce: Nonce,
tip: Balance,
) -> Self {
GenericSignedExtension::new(
@@ -209,7 +209,7 @@ impl BridgeHubSignedExtension for SignedExtension {
}
/// Return transaction nonce.
fn nonce(&self) -> Index {
fn nonce(&self) -> Nonce {
self.payload.5 .0
}
@@ -43,7 +43,7 @@ impl Chain for BridgeHubKusama {
type AccountId = AccountId;
type Balance = Balance;
type Index = Index;
type Nonce = Nonce;
type Signature = Signature;
fn max_extrinsic_size() -> u32 {
@@ -39,7 +39,7 @@ impl Chain for BridgeHubPolkadot {
type AccountId = AccountId;
type Balance = Balance;
type Index = Index;
type Nonce = Nonce;
type Signature = Signature;
fn max_extrinsic_size() -> u32 {
@@ -43,7 +43,7 @@ impl Chain for BridgeHubRococo {
type AccountId = AccountId;
type Balance = Balance;
type Index = Index;
type Nonce = Nonce;
type Signature = Signature;
fn max_extrinsic_size() -> u32 {
@@ -39,7 +39,7 @@ impl Chain for BridgeHubWococo {
type AccountId = AccountId;
type Balance = Balance;
type Index = Index;
type Nonce = Nonce;
type Signature = Signature;
fn max_extrinsic_size() -> u32 {
+1 -1
View File
@@ -35,7 +35,7 @@ impl Chain for Kusama {
type AccountId = <PolkadotLike as Chain>::AccountId;
type Balance = <PolkadotLike as Chain>::Balance;
type Index = <PolkadotLike as Chain>::Index;
type Nonce = <PolkadotLike as Chain>::Nonce;
type Signature = <PolkadotLike as Chain>::Signature;
fn max_extrinsic_size() -> u32 {
+4 -4
View File
@@ -11,10 +11,10 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0"
fixed-hash = { version = "0.8.0", default-features = false }
hash256-std-hasher = { version = "0.15.2", default-features = false }
impl-codec = { version = "0.6", default-features = false }
impl-serde = { version = "0.4.0", optional = true }
impl-serde = { version = "0.4.0", default-features = false }
parity-util-mem = { version = "0.12.0", default-features = false, features = ["primitive-types"] }
scale-info = { version = "2.9.0", default-features = false, features = ["derive"] }
serde = { version = "1.0", optional = true, features = ["derive"] }
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"] }
# Bridge Dependencies
@@ -46,10 +46,10 @@ std = [
"frame-system/std",
"hash256-std-hasher/std",
"impl-codec/std",
"impl-serde",
"impl-serde/std",
"parity-util-mem/std",
"scale-info/std",
"serde",
"serde/std",
"sp-api/std",
"sp-core/std",
"sp-io/std",
+5 -7
View File
@@ -33,6 +33,7 @@ use frame_support::{
};
use frame_system::limits;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use sp_core::{storage::StateVersion, Hasher as HasherT};
use sp_runtime::{
traits::{IdentifyAccount, Verify},
@@ -41,8 +42,6 @@ use sp_runtime::{
use sp_std::prelude::*;
use sp_trie::{LayoutV0, LayoutV1, TrieConfiguration};
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
use sp_runtime::traits::Keccak256;
pub use millau_hash::MillauHash;
@@ -145,8 +144,8 @@ pub type AccountSigner = MultiSigner;
/// Balance of an account.
pub type Balance = u64;
/// Index of a transaction in the chain.
pub type Index = u32;
/// Nonce of a transaction in the chain.
pub type Nonce = u32;
/// Weight-to-Fee type used by Millau.
pub type WeightToFee = IdentityFee<Balance>;
@@ -163,7 +162,7 @@ impl Chain for Millau {
type AccountId = AccountId;
type Balance = Balance;
type Index = Index;
type Nonce = Nonce;
type Signature = Signature;
fn max_extrinsic_size() -> u32 {
@@ -197,8 +196,7 @@ impl ChainWithBeefy for Millau {
}
/// Millau Hasher (Blake2-256 ++ Keccak-256) implementation.
#[derive(PartialEq, Eq, Clone, Copy, RuntimeDebug, TypeInfo)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(PartialEq, Eq, Clone, Copy, RuntimeDebug, TypeInfo, Serialize, Deserialize)]
pub struct BlakeTwoAndKeccak256;
impl sp_core::Hasher for BlakeTwoAndKeccak256 {
@@ -27,9 +27,7 @@ fixed_hash::construct_fixed_hash! {
pub struct MillauHash(64);
}
#[cfg(feature = "std")]
impl_serde::impl_fixed_hash_serde!(MillauHash, 64);
impl_codec::impl_fixed_hash_codec!(MillauHash, 64);
impl CheckEqual for MillauHash {
+1 -1
View File
@@ -35,7 +35,7 @@ impl Chain for Polkadot {
type AccountId = <PolkadotLike as Chain>::AccountId;
type Balance = <PolkadotLike as Chain>::Balance;
type Index = <PolkadotLike as Chain>::Index;
type Nonce = <PolkadotLike as Chain>::Nonce;
type Signature = <PolkadotLike as Chain>::Signature;
fn max_extrinsic_size() -> u32 {
@@ -96,8 +96,8 @@ pub type Balance = u128;
/// An instant or duration in time.
pub type Moment = u64;
/// Index of a transaction in the parachain.
pub type Index = u32;
/// Nonce of a transaction in the parachain.
pub type Nonce = u32;
/// Weight-to-Fee type used by Rialto parachain.
pub type WeightToFee = IdentityFee<Balance>;
@@ -114,7 +114,7 @@ impl Chain for RialtoParachain {
type AccountId = AccountId;
type Balance = Balance;
type Index = Index;
type Nonce = Nonce;
type Signature = Signature;
fn max_extrinsic_size() -> u32 {
+3 -3
View File
@@ -149,8 +149,8 @@ pub type Balance = u128;
/// An instant or duration in time.
pub type Moment = u64;
/// Index of a transaction in the chain.
pub type Index = u32;
/// Nonce of a transaction in the chain.
pub type Nonce = u32;
/// Weight-to-Fee type used by Rialto.
pub type WeightToFee = IdentityFee<Balance>;
@@ -167,7 +167,7 @@ impl Chain for Rialto {
type AccountId = AccountId;
type Balance = Balance;
type Index = Index;
type Nonce = Nonce;
type Signature = Signature;
fn max_extrinsic_size() -> u32 {
+1 -1
View File
@@ -35,7 +35,7 @@ impl Chain for Rococo {
type AccountId = <PolkadotLike as Chain>::AccountId;
type Balance = <PolkadotLike as Chain>::Balance;
type Index = <PolkadotLike as Chain>::Index;
type Nonce = <PolkadotLike as Chain>::Nonce;
type Signature = <PolkadotLike as Chain>::Signature;
fn max_extrinsic_size() -> u32 {
+2 -2
View File
@@ -35,7 +35,7 @@ impl Chain for Westend {
type AccountId = <PolkadotLike as Chain>::AccountId;
type Balance = <PolkadotLike as Chain>::Balance;
type Index = <PolkadotLike as Chain>::Index;
type Nonce = <PolkadotLike as Chain>::Nonce;
type Signature = <PolkadotLike as Chain>::Signature;
fn max_extrinsic_size() -> u32 {
@@ -70,7 +70,7 @@ impl Chain for Westmint {
type AccountId = AccountId;
type Balance = Balance;
type Index = Nonce;
type Nonce = Nonce;
type Signature = Signature;
fn max_extrinsic_size() -> u32 {
+1 -1
View File
@@ -38,7 +38,7 @@ impl Chain for Wococo {
type AccountId = <PolkadotLike as Chain>::AccountId;
type Balance = <PolkadotLike as Chain>::Balance;
type Index = <PolkadotLike as Chain>::Index;
type Nonce = <PolkadotLike as Chain>::Nonce;
type Signature = <PolkadotLike as Chain>::Signature;
fn max_extrinsic_size() -> u32 {
@@ -56,7 +56,7 @@ impl<H: HeaderT> GrandpaJustification<H> {
/// any precise calculations - that's just an estimation.
pub fn max_reasonable_size<C>(required_precommits: u32) -> u32
where
C: Chain<Header = H> + ChainWithGrandpa,
C: Chain + ChainWithGrandpa,
{
// we don't need precise results here - just estimations, so some details
// are removed from computations (e.g. bytes required to encode vector length)
@@ -144,10 +144,7 @@ pub fn verify_and_optimize_justification<Header: HeaderT>(
authorities_set_id: SetId,
authorities_set: &VoterSet<AuthorityId>,
justification: &mut GrandpaJustification<Header>,
) -> Result<(), Error>
where
Header::Number: finality_grandpa::BlockNumberOps,
{
) -> Result<(), Error> {
let mut optimizer = OptimizationCallbacks {
extra_precommits: vec![],
redundant_votes_ancestries: Default::default(),
@@ -170,10 +167,7 @@ pub fn verify_justification<Header: HeaderT>(
authorities_set_id: SetId,
authorities_set: &VoterSet<AuthorityId>,
justification: &GrandpaJustification<Header>,
) -> Result<(), Error>
where
Header::Number: finality_grandpa::BlockNumberOps,
{
) -> Result<(), Error> {
verify_justification_with_callbacks(
finalized_target,
authorities_set_id,
@@ -295,10 +289,7 @@ fn verify_justification_with_callbacks<Header: HeaderT, C: VerificationCallbacks
authorities_set: &VoterSet<AuthorityId>,
justification: &GrandpaJustification<Header>,
callbacks: &mut C,
) -> Result<(), Error>
where
Header::Number: finality_grandpa::BlockNumberOps,
{
) -> Result<(), Error> {
// ensure that it is justification for the expected header
if (justification.commit.target_hash, justification.commit.target_number) != finalized_target {
return Err(Error::InvalidJustificationTarget)
+3 -3
View File
@@ -27,7 +27,6 @@ use codec::{Codec, Decode, Encode, EncodeLike, MaxEncodedLen};
use core::{clone::Clone, cmp::Eq, default::Default, fmt::Debug};
use frame_support::PalletError;
use scale_info::TypeInfo;
#[cfg(feature = "std")]
use serde::{Deserialize, Serialize};
use sp_consensus_grandpa::{AuthorityList, ConsensusLog, SetId, GRANDPA_ENGINE_ID};
use sp_runtime::{traits::Header as HeaderT, Digest, RuntimeDebug};
@@ -110,8 +109,9 @@ impl AuthoritySet {
/// Data required for initializing the GRANDPA bridge pallet.
///
/// The bridge needs to know where to start its sync from, and this provides that initial context.
#[derive(Default, Encode, Decode, RuntimeDebug, PartialEq, Eq, Clone, TypeInfo)]
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(
Default, Encode, Decode, RuntimeDebug, PartialEq, Eq, Clone, TypeInfo, Serialize, Deserialize,
)]
pub struct InitializationData<H: HeaderT> {
/// The header from which we should start syncing.
pub header: Box<H>,
@@ -104,8 +104,8 @@ pub fn make_default_justification(header: &TestHeader) -> GrandpaJustification<T
// the `finality_grandpa::validate_commit` function has two ways to report an unsuccessful
// commit validation:
//
// 1) to return `Err()` (which only may happen if `finality_grandpa::Chain` implementation
// returns an error);
// 1) to return `Err()` (which only may happen if `finality_grandpa::Chain` implementation returns
// an error);
// 2) to return `Ok(validation_result)` if `validation_result.is_valid()` is false.
//
// Our implementation would just return error in both cases.
+14 -2
View File
@@ -30,6 +30,7 @@ use frame_support::{PalletError, RuntimeDebug};
// Weight is reexported to avoid additional frame-support dependencies in related crates.
pub use frame_support::weights::Weight;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use source_chain::RelayersRewards;
use sp_core::TypeId;
use sp_std::{collections::vec_deque::VecDeque, ops::RangeInclusive, prelude::*};
@@ -39,8 +40,19 @@ pub mod storage_keys;
pub mod target_chain;
/// Messages pallet operating mode.
#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
#[derive(
Encode,
Decode,
Clone,
Copy,
PartialEq,
Eq,
RuntimeDebug,
TypeInfo,
MaxEncodedLen,
Serialize,
Deserialize,
)]
pub enum MessagesOperatingMode {
/// Basic operating mode (Normal/Halted)
Basic(BasicOperatingMode),
+2 -5
View File
@@ -181,9 +181,6 @@ pub type BlockNumber = u32;
/// Hash type used in Polkadot-like chains.
pub type Hash = <BlakeTwo256 as HasherT>::Out;
/// Account Index (a.k.a. nonce).
pub type Index = u32;
/// Hashing type.
pub type Hashing = BlakeTwo256;
@@ -205,7 +202,7 @@ pub type AccountId = <AccountPublic as IdentifyAccount>::AccountId;
/// Address of account on Polkadot-like chains.
pub type AccountAddress = MultiAddress<AccountId, ()>;
/// Index of a transaction on the Polkadot-like chains.
/// Nonce of a transaction on the Polkadot-like chains.
pub type Nonce = u32;
/// Block type of Polkadot-like chains.
@@ -236,7 +233,7 @@ impl Chain for PolkadotLike {
type AccountId = AccountId;
type Balance = Balance;
type Index = Index;
type Nonce = Nonce;
type Signature = Signature;
fn max_extrinsic_size() -> u32 {
+5 -5
View File
@@ -170,8 +170,8 @@ pub trait Chain: Send + Sync + 'static {
+ Zero
+ TryFrom<sp_core::U256>
+ MaxEncodedLen;
/// Index of a transaction used by the chain.
type Index: Parameter
/// Nonce of a transaction used by the chain.
type Nonce: Parameter
+ Member
+ MaybeSerialize
+ Debug
@@ -206,7 +206,7 @@ where
type Header = <T::Chain as Chain>::Header;
type AccountId = <T::Chain as Chain>::AccountId;
type Balance = <T::Chain as Chain>::Balance;
type Index = <T::Chain as Chain>::Index;
type Nonce = <T::Chain as Chain>::Nonce;
type Signature = <T::Chain as Chain>::Signature;
fn max_extrinsic_size() -> u32 {
@@ -261,8 +261,8 @@ pub type AccountIdOf<C> = <C as Chain>::AccountId;
/// Balance type used by the chain.
pub type BalanceOf<C> = <C as Chain>::Balance;
/// Transaction index type used by the chain.
pub type IndexOf<C> = <C as Chain>::Index;
/// Transaction nonce type used by the chain.
pub type NonceOf<C> = <C as Chain>::Nonce;
/// Signature type used by the chain.
pub type SignatureOf<C> = <C as Chain>::Signature;
+15 -3
View File
@@ -25,13 +25,14 @@ use frame_support::{
};
use frame_system::RawOrigin;
use scale_info::TypeInfo;
use serde::{Deserialize, Serialize};
use sp_core::storage::StorageKey;
use sp_runtime::traits::{BadOrigin, Header as HeaderT, UniqueSaturatedInto};
use sp_std::{convert::TryFrom, fmt::Debug, ops::RangeInclusive, vec, vec::Vec};
pub use chain::{
AccountIdOf, AccountPublicOf, BalanceOf, BlockNumberOf, Chain, EncodedOrDecodedCall, HashOf,
HasherOf, HeaderOf, IndexOf, Parachain, ParachainIdOf, SignatureOf, TransactionEraOf,
HasherOf, HeaderOf, NonceOf, Parachain, ParachainIdOf, SignatureOf, TransactionEraOf,
UnderlyingChainOf, UnderlyingChainProvider,
};
pub use frame_support::storage::storage_prefix as storage_value_final_key;
@@ -373,8 +374,19 @@ pub trait OperatingMode: Send + Copy + Debug + FullCodec {
}
/// Basic operating modes for a bridges module (Normal/Halted).
#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)]
#[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
#[derive(
Encode,
Decode,
Clone,
Copy,
PartialEq,
Eq,
RuntimeDebug,
TypeInfo,
MaxEncodedLen,
Serialize,
Deserialize,
)]
pub enum BasicOperatingMode {
/// Normal mode, when all operations are allowed.
Normal,
+2 -2
View File
@@ -26,8 +26,8 @@ pub struct MessageDispatchResult<DispatchLevelResult> {
/// Unspent dispatch weight. This weight that will be deducted from total delivery transaction
/// weight, thus reducing the transaction cost. This shall not be zero in (at least) two cases:
///
/// 1) if message has been dispatched successfully, but post-dispatch weight is less than
/// the weight, declared by the message sender;
/// 1) if message has been dispatched successfully, but post-dispatch weight is less than the
/// weight, declared by the message sender;
/// 2) if message has not been dispatched at all.
pub unspent_weight: Weight,
/// Fine-grained result of single message dispatch (for better diagnostic purposes)