Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/master' into bko-bridge-ro-wo
Browse files Browse the repository at this point in the history
  • Loading branch information
bkontur committed Sep 20, 2022
2 parents 36a212b + d24be3f commit 0673462
Show file tree
Hide file tree
Showing 14 changed files with 826 additions and 200 deletions.
59 changes: 25 additions & 34 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions bin/millau/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ parameter_types! {
pub type WithRialtoParachainsInstance = ();

impl pallet_bridge_parachains::Config<WithRialtoParachainsInstance> for Runtime {
type Event = Event;
type WeightInfo = pallet_bridge_parachains::weights::MillauWeight<Runtime>;
type BridgesGrandpaPalletInstance = RialtoGrandpaInstance;
type ParasPalletName = RialtoParasPalletName;
Expand All @@ -551,6 +552,7 @@ impl pallet_bridge_parachains::Config<WithRialtoParachainsInstance> for Runtime
pub type WithWestendParachainsInstance = pallet_bridge_parachains::Instance1;

impl pallet_bridge_parachains::Config<WithWestendParachainsInstance> for Runtime {
type Event = Event;
type WeightInfo = pallet_bridge_parachains::weights::MillauWeight<Runtime>;
type BridgesGrandpaPalletInstance = WestendGrandpaInstance;
type ParasPalletName = WestendParasPalletName;
Expand Down Expand Up @@ -592,10 +594,10 @@ construct_runtime!(

// Westend bridge modules.
BridgeWestendGrandpa: pallet_bridge_grandpa::<Instance1>::{Pallet, Call, Config<T>, Storage},
BridgeWestendParachains: pallet_bridge_parachains::<Instance1>::{Pallet, Call, Storage},
BridgeWestendParachains: pallet_bridge_parachains::<Instance1>::{Pallet, Call, Storage, Event<T>},

// RialtoParachain bridge modules.
BridgeRialtoParachains: pallet_bridge_parachains::{Pallet, Call, Storage},
BridgeRialtoParachains: pallet_bridge_parachains::{Pallet, Call, Storage, Event<T>},
BridgeRialtoParachainMessages: pallet_bridge_messages::<Instance1>::{Pallet, Call, Storage, Event<T>, Config<T>},

// Pallet for sending XCM.
Expand Down
10 changes: 7 additions & 3 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,21 @@ notice = "warn"
# A list of advisory IDs to ignore. Note that ignored advisories will still
# output a note when they are encountered.
ignore = [
"RUSTSEC-2020-0070",
# Comes from honggfuzz via storage-proof-fuzzer: 'memmap'
"RUSTSEC-2020-0077",
# net2 (origin: Substrate RPC crates)
"RUSTSEC-2020-0016",
# time (origin: Substrate RPC + benchmarking crates)
"RUSTSEC-2020-0071",
# chrono (origin: Substrate benchmarking + cli + ...)
"RUSTSEC-2020-0159",
# lru 0.6.6 (origin: libp2p)
"RUSTSEC-2021-0130",
# ansi_term (The maintainer has adviced that this crate is deprecated and will not receive any maintenance.
# Once other crates will move to some alternative, we'll do that too)
"RUSTSEC-2021-0139",
# rocksdb (origin: Substrate and Polkadot kvdb-rocksdb - we need to upgrade soon)
"RUSTSEC-2022-0046",
# owning_ref (origin: Substrate, libp2p)
"RUSTSEC-2022-0040",
]
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
# lower than the range specified will be ignored. Note that ignored advisories
Expand Down
12 changes: 9 additions & 3 deletions modules/parachains/src/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use crate::{Config, Pallet, RelayBlockHash, RelayBlockHasher, RelayBlockNumber};
use bp_runtime::FilterCall;
use frame_support::{dispatch::CallableCallFor, traits::IsSubType};
use sp_runtime::transaction_validity::{TransactionValidity, ValidTransaction};
use sp_runtime::transaction_validity::{InvalidTransaction, TransactionValidity, ValidTransaction};

/// Validate parachain heads in order to avoid "mining" transactions that provide
/// outdated bridged parachain heads. Without this validation, even honest relayers
Expand Down Expand Up @@ -57,13 +57,19 @@ where
};

let maybe_stored_best_head = crate::ParasInfo::<T, I>::get(parachain);
Self::validate_updated_parachain_head(
let is_valid = Self::validate_updated_parachain_head(
parachain,
&maybe_stored_best_head,
updated_at_relay_block_number,
parachain_head_hash,
"Rejecting obsolete parachain-head transaction",
)
);

if is_valid {
Ok(ValidTransaction::default())
} else {
InvalidTransaction::Stale.into()
}
}
}

Expand Down
Loading

0 comments on commit 0673462

Please sign in to comment.