diff --git a/.github/workflows/staging.yaml b/.github/workflows/staging.yaml index 845d17b51..19b601904 100644 --- a/.github/workflows/staging.yaml +++ b/.github/workflows/staging.yaml @@ -20,12 +20,10 @@ jobs: matrix: package: - bridger - # - darwinia-ethereum - # - pangolin-goerli - # - darwinia-crab - # - pangolin-pangoro + - darwinia-ethereum + - darwinia-crab + - pangolin-pangoro - pangoro-goerli - # - pangoro-chapel steps: - uses: actions/checkout@v2 diff --git a/assistants/bin-s2s/src/bridge/config/generic.rs b/assistants/bin-s2s/src/bridge/config/generic.rs index a382fae94..057730e84 100644 --- a/assistants/bin-s2s/src/bridge/config/generic.rs +++ b/assistants/bin-s2s/src/bridge/config/generic.rs @@ -22,7 +22,7 @@ pub struct SoloWithParaConfig { pub para_id: u32, } -#[cfg(any(feature = "para-with-para"))] +#[cfg(feature = "para-with-para")] #[derive(Clone, Debug, Deserialize, Serialize)] pub struct ParaWithParaConfig { pub source_para_id: u32, diff --git a/assistants/bin-s2s/src/service/para_with_para/header/source_to_target/parachain_parahead_relay.rs b/assistants/bin-s2s/src/service/para_with_para/header/source_to_target/parachain_parahead_relay.rs index 5c7dc7f92..144a033a7 100644 --- a/assistants/bin-s2s/src/service/para_with_para/header/source_to_target/parachain_parahead_relay.rs +++ b/assistants/bin-s2s/src/service/para_with_para/header/source_to_target/parachain_parahead_relay.rs @@ -65,7 +65,7 @@ impl< while let Err(e) = Self::start(bridge_config.clone()).await { tracing::error!( target: "bin-s2s", - "[header-relay] [{}-to-{}] an error occurred for header relay {:?}", + "[parahead-header-relay] [{}-to-{}] an error occurred for header relay {:?}", config_chain.source_relay.chain().name(), config_chain.target_para.chain().name(), e, @@ -74,7 +74,7 @@ impl< tokio::time::sleep(duration).await; tracing::error!( target: "bin-s2s", - "[header-relay] [{}-to-{}] many errors occurred, wait {} seconds", + "[parahead-header-relay] [{}-to-{}] many errors occurred, wait {} seconds", config_chain.source_relay.chain().name(), config_chain.target_para.chain().name(), duration.as_secs(), @@ -83,7 +83,7 @@ impl< tokio::time::sleep(std::time::Duration::from_secs(5)).await; tracing::info!( target: "bin-s2s", - "[header-relay] [{}-to-{}] try to restart header relay service.", + "[parahead-header-relay] [{}-to-{}] try to restart header relay service.", config_chain.source_relay.chain().name(), config_chain.target_para.chain().name(), ); @@ -114,7 +114,7 @@ impl< let config_chain = bridge_config.chain; tracing::info!( target: "bin-s2s", - "[header-{}-to-{}] SERVICE RESTARTING...", + "[parahead-header-{}-to-{}] SERVICE RESTARTING...", config_chain.source_relay.chain().name(), config_chain.target_para.chain().name(), ); diff --git a/assistants/bin-s2s/src/service/para_with_para/header/source_to_target/relaychain_grandpa_relay.rs b/assistants/bin-s2s/src/service/para_with_para/header/source_to_target/relaychain_grandpa_relay.rs index f50a71b0c..a76562448 100644 --- a/assistants/bin-s2s/src/service/para_with_para/header/source_to_target/relaychain_grandpa_relay.rs +++ b/assistants/bin-s2s/src/service/para_with_para/header/source_to_target/relaychain_grandpa_relay.rs @@ -65,7 +65,7 @@ impl< while let Err(e) = Self::start(bridge_config.clone()).await { tracing::error!( target: "bin-s2s", - "[header-relay] [{}-to-{}] an error occurred for header relay {:?}", + "[relayhead-header-relay] [{}-to-{}] an error occurred for header relay {:?}", config_chain.source_relay.chain().name(), config_chain.target_para.chain().name(), e, @@ -74,7 +74,7 @@ impl< tokio::time::sleep(duration).await; tracing::error!( target: "bin-s2s", - "[header-relay] [{}-to-{}] many errors occurred, wait {} seconds", + "[relayhead-header-relay] [{}-to-{}] many errors occurred, wait {} seconds", config_chain.source_relay.chain().name(), config_chain.target_para.chain().name(), duration.as_secs(), @@ -83,7 +83,7 @@ impl< tokio::time::sleep(std::time::Duration::from_secs(5)).await; tracing::info!( target: "bin-s2s", - "[header-relay] [{}-to-{}] try to restart header relay service.", + "[relayhead-header-relay] [{}-to-{}] try to restart header relay service.", config_chain.source_relay.chain().name(), config_chain.target_para.chain().name(), ); diff --git a/assistants/client-kusama/src/fastapi/common/mod.rs b/assistants/client-kusama/src/fastapi/common/mod.rs index 2d23a2449..b052e1ff2 100644 --- a/assistants/client-kusama/src/fastapi/common/mod.rs +++ b/assistants/client-kusama/src/fastapi/common/mod.rs @@ -1,2 +1,2 @@ -#[cfg(any(feature = "bridge-s2s"))] +#[cfg(feature = "bridge-s2s")] mod client_common; diff --git a/assistants/client-moonbase/src/fastapi/common/mod.rs b/assistants/client-moonbase/src/fastapi/common/mod.rs index 2d23a2449..b052e1ff2 100644 --- a/assistants/client-moonbase/src/fastapi/common/mod.rs +++ b/assistants/client-moonbase/src/fastapi/common/mod.rs @@ -1,2 +1,2 @@ -#[cfg(any(feature = "bridge-s2s"))] +#[cfg(feature = "bridge-s2s")] mod client_common; diff --git a/assistants/client-polkadot/src/fastapi/common/mod.rs b/assistants/client-polkadot/src/fastapi/common/mod.rs index 2d23a2449..b052e1ff2 100644 --- a/assistants/client-polkadot/src/fastapi/common/mod.rs +++ b/assistants/client-polkadot/src/fastapi/common/mod.rs @@ -1,2 +1,2 @@ -#[cfg(any(feature = "bridge-s2s"))] +#[cfg(feature = "bridge-s2s")] mod client_common; diff --git a/assistants/client-rococo/src/fastapi/common/mod.rs b/assistants/client-rococo/src/fastapi/common/mod.rs index 2d23a2449..b052e1ff2 100644 --- a/assistants/client-rococo/src/fastapi/common/mod.rs +++ b/assistants/client-rococo/src/fastapi/common/mod.rs @@ -1,2 +1,2 @@ -#[cfg(any(feature = "bridge-s2s"))] +#[cfg(feature = "bridge-s2s")] mod client_common; diff --git a/assistants/feemarket-s2s/src/relay/basic.rs b/assistants/feemarket-s2s/src/relay/basic.rs index 0a35d836a..35dde6d30 100644 --- a/assistants/feemarket-s2s/src/relay/basic.rs +++ b/assistants/feemarket-s2s/src/relay/basic.rs @@ -89,6 +89,28 @@ impl RelayStrategy for BasicRelayStrategy { .await .map_err(|e| S2SClientError::Custom(format!("[feemarket]: {:?}", e)))?; + // ----- + // If the order timeout, anyone can relay this. + let ranges = relayers + .iter() + .map(|item| item.valid_range.clone()) + .collect::::BlockNumber>>>(); + + let mut maximum_timeout: ::BlockNumber = Default::default(); + for range in ranges { + maximum_timeout = std::cmp::max(maximum_timeout, range.end); + } + // If this order has timed out, decide to relay + if finalized_block_number > maximum_timeout { + tracing::info!( + target: "feemarket", + "{} this nonce is timeout. so the decide is relay this nonce: {}", + logk::prefix_with_relation("feemarket", "relay", A::CHAIN, "::"), + nonce, + ); + return Ok(true); + } + // If you are assigned relayer, you must relay this nonce. // If you don't do that, the fee market pallet will slash your deposit. // Even though it is a timeout, although it will slash your deposit after the timeout is delivered, @@ -128,27 +150,6 @@ impl RelayStrategy for BasicRelayStrategy { return Ok(false); } - // ----- - // If you aren't assigned relayer, only participate in the part about time out, earn more rewards - let ranges = relayers - .iter() - .map(|item| item.valid_range.clone()) - .collect::::BlockNumber>>>(); - - let mut maximum_timeout: ::BlockNumber = Default::default(); - for range in ranges { - maximum_timeout = std::cmp::max(maximum_timeout, range.end); - } - // If this order has timed out, decide to relay - if finalized_block_number > maximum_timeout { - tracing::info!( - target: "feemarket", - "{} you aren't assigned relayer. but this nonce is timeout. so the decide is relay this nonce: {}", - logk::prefix_with_relation("feemarket", "relay", A::CHAIN, "::"), - nonce, - ); - return Ok(true); - } tracing::info!( target: "feemarket", "{} you aren't assigned relay. and this nonce({}) is on-time. so don't relay this", diff --git a/assistants/relay-e2e/src/ecdsa/ecdsa_scanner.rs b/assistants/relay-e2e/src/ecdsa/ecdsa_scanner.rs index 5189f5d7b..b30c8fd9a 100644 --- a/assistants/relay-e2e/src/ecdsa/ecdsa_scanner.rs +++ b/assistants/relay-e2e/src/ecdsa/ecdsa_scanner.rs @@ -74,7 +74,7 @@ pub trait EcdsaScanner { return Ok(()); } - let mut source = self.get_ecdsa_source(); + let source = self.get_ecdsa_source(); loop { let from = tracker .current()