Skip to content

Commit

Permalink
Merge branch 'master' into if-else-utility
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbow-promise authored Nov 29, 2024
2 parents ca8c072 + 6416b28 commit 898b5e1
Show file tree
Hide file tree
Showing 41 changed files with 2,361 additions and 407 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/command-backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: korthout/backport-action@v3
id: backport
with:
target_branches: stable2407 stable2409
target_branches: stable2407 stable2409 stable2412
merge_commits: skip
github_token: ${{ steps.generate_token.outputs.token }}
pull_description: |
Expand Down
39 changes: 26 additions & 13 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ frame-benchmarking-pallet-pov = { default-features = false, path = "substrate/fr
frame-election-provider-solution-type = { path = "substrate/frame/election-provider-support/solution-type", default-features = false }
frame-election-provider-support = { path = "substrate/frame/election-provider-support", default-features = false }
frame-executive = { path = "substrate/frame/executive", default-features = false }
frame-metadata = { version = "16.0.0", default-features = false }
frame-metadata = { version = "18.0.0", default-features = false }
frame-metadata-hash-extension = { path = "substrate/frame/metadata-hash-extension", default-features = false }
frame-support = { path = "substrate/frame/support", default-features = false }
frame-support-procedural = { path = "substrate/frame/support/procedural", default-features = false }
Expand Down Expand Up @@ -848,13 +848,13 @@ linked-hash-map = { version = "0.5.4" }
linked_hash_set = { version = "0.1.4" }
linregress = { version = "0.5.1" }
lite-json = { version = "0.2.0", default-features = false }
litep2p = { version = "0.8.1", features = ["websocket"] }
litep2p = { version = "0.8.2", features = ["websocket"] }
log = { version = "0.4.22", default-features = false }
macro_magic = { version = "0.5.1" }
maplit = { version = "1.0.2" }
memmap2 = { version = "0.9.3" }
memory-db = { version = "0.32.0", default-features = false }
merkleized-metadata = { version = "0.1.0" }
merkleized-metadata = { version = "0.1.2" }
merlin = { version = "3.0", default-features = false }
messages-relay = { path = "bridges/relays/messages" }
metered = { version = "0.6.1", default-features = false, package = "prioritized-metered-channel" }
Expand Down
18 changes: 12 additions & 6 deletions bridges/modules/relayers/src/extension/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ pub struct BridgeRelayersTransactionExtension<Runtime, Config, LaneId>(
impl<R, C, LaneId> BridgeRelayersTransactionExtension<R, C, LaneId>
where
Self: 'static + Send + Sync,
R: RelayersConfig<LaneId = LaneId>
R: RelayersConfig<C::BridgeRelayersPalletInstance, LaneId = LaneId>
+ BridgeMessagesConfig<C::BridgeMessagesPalletInstance, LaneId = LaneId>
+ TransactionPaymentConfig,
C: ExtensionConfig<Runtime = R, LaneId = LaneId>,
Expand Down Expand Up @@ -250,7 +250,7 @@ where
// let's also replace the weight of slashing relayer with the weight of rewarding relayer
if call_info.is_receive_messages_proof_call() {
post_info_weight = post_info_weight.saturating_sub(
<R as RelayersConfig>::WeightInfo::extra_weight_of_successful_receive_messages_proof_call(),
<R as RelayersConfig<C::BridgeRelayersPalletInstance>>::WeightInfo::extra_weight_of_successful_receive_messages_proof_call(),
);
}

Expand Down Expand Up @@ -278,7 +278,7 @@ impl<R, C, LaneId> TransactionExtension<R::RuntimeCall>
for BridgeRelayersTransactionExtension<R, C, LaneId>
where
Self: 'static + Send + Sync,
R: RelayersConfig<LaneId = LaneId>
R: RelayersConfig<C::BridgeRelayersPalletInstance, LaneId = LaneId>
+ BridgeMessagesConfig<C::BridgeMessagesPalletInstance, LaneId = LaneId>
+ TransactionPaymentConfig,
C: ExtensionConfig<Runtime = R, LaneId = LaneId>,
Expand Down Expand Up @@ -326,7 +326,9 @@ where
};

// we only boost priority if relayer has staked required balance
if !RelayersPallet::<R>::is_registration_active(&data.relayer) {
if !RelayersPallet::<R, C::BridgeRelayersPalletInstance>::is_registration_active(
&data.relayer,
) {
return Ok((Default::default(), Some(data), origin))
}

Expand Down Expand Up @@ -382,7 +384,11 @@ where
match call_result {
RelayerAccountAction::None => (),
RelayerAccountAction::Reward(relayer, reward_account, reward) => {
RelayersPallet::<R>::register_relayer_reward(reward_account, &relayer, reward);
RelayersPallet::<R, C::BridgeRelayersPalletInstance>::register_relayer_reward(
reward_account,
&relayer,
reward,
);

log::trace!(
target: LOG_TARGET,
Expand All @@ -394,7 +400,7 @@ where
);
},
RelayerAccountAction::Slash(relayer, slash_account) =>
RelayersPallet::<R>::slash_and_deregister(
RelayersPallet::<R, C::BridgeRelayersPalletInstance>::slash_and_deregister(
&relayer,
ExplicitOrAccountParams::Params(slash_account),
),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use serde_json::{json, Value};
use std::{process::Command, str};

const WASM_FILE_PATH: &str =
"../../../../../target/release/wbuild/chain-spec-guide-runtime/chain_spec_guide_runtime.wasm";
fn wasm_file_path() -> &'static str {
chain_spec_guide_runtime::runtime::WASM_BINARY_PATH
.expect("chain_spec_guide_runtime wasm should exist. qed")
}

const CHAIN_SPEC_BUILDER_PATH: &str = "../../../../../target/release/chain-spec-builder";

Expand All @@ -26,7 +28,7 @@ fn list_presets() {
let output = Command::new(get_chain_spec_builder_path())
.arg("list-presets")
.arg("-r")
.arg(WASM_FILE_PATH)
.arg(wasm_file_path())
.output()
.expect("Failed to execute command");

Expand All @@ -50,7 +52,7 @@ fn get_preset() {
let output = Command::new(get_chain_spec_builder_path())
.arg("display-preset")
.arg("-r")
.arg(WASM_FILE_PATH)
.arg(wasm_file_path())
.arg("-p")
.arg("preset_2")
.output()
Expand Down Expand Up @@ -83,7 +85,7 @@ fn generate_chain_spec() {
.arg("/dev/stdout")
.arg("create")
.arg("-r")
.arg(WASM_FILE_PATH)
.arg(wasm_file_path())
.arg("named-preset")
.arg("preset_2")
.output()
Expand Down Expand Up @@ -140,7 +142,7 @@ fn generate_para_chain_spec() {
.arg("-p")
.arg("1000")
.arg("-r")
.arg(WASM_FILE_PATH)
.arg(wasm_file_path())
.arg("named-preset")
.arg("preset_2")
.output()
Expand Down
Loading

0 comments on commit 898b5e1

Please sign in to comment.