Skip to content

Commit

Permalink
Partially merge substrate-39 into mster (#454)
Browse files Browse the repository at this point in the history
* Remove 'uosmo' from filtered tokens (#433)

* Fix grandpa client required update usage (#432)

---------

Signed-off-by: Vladislav <[email protected]>
  • Loading branch information
vmarkushin authored Nov 10, 2023
1 parent 6843cb0 commit b5c735f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion hyperspace/core/src/packets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ pub async fn query_ready_and_timed_out_packets(
})?;

if list.iter().any(|skiped_denom| decoded_dara.token.denom.base_denom.as_str() == skiped_denom) {
log::info!(target: "hyperspace", "Skipping packet as uosmo packet: {:?}", packet);
log::info!(target: "hyperspace", "Skipping packet with ignored token: {:?}", packet);
return Ok(None)
}

Expand Down
6 changes: 2 additions & 4 deletions hyperspace/cosmos/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ pub struct CosmosClientConfig {
/// Common client config
#[serde(flatten)]
pub common: CommonClientConfig,
/// List of tokens to skip uosmo etc
/// Skip transfer packets with the following tokens base denoms
pub skip_tokens_list: Option<Vec<String>>,
}

Expand Down Expand Up @@ -306,9 +306,7 @@ where
initial_rpc_call_delay: rpc_call_delay,
misbehaviour_client_msg_queue: Arc::new(AsyncMutex::new(vec![])),
max_packets_to_process: config.common.max_packets_to_process as usize,
skip_tokens_list: config
.skip_tokens_list
.unwrap_or_else(|| vec!["uosmo".to_string()]),
skip_tokens_list: config.skip_tokens_list.unwrap_or_default(),
},
join_handles: Arc::new(TokioMutex::new(vec![ws_driver_jh])),
})
Expand Down
2 changes: 1 addition & 1 deletion hyperspace/cosmos/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,7 @@ where
client_id: ClientId,
client_height: Height,
) -> Result<(Height, Timestamp), Self::Error> {
log::debug!(
log::trace!(
target: "hyperspace_cosmos",
"Querying client update time and height for client {:?} at height {:?}",
client_id,
Expand Down
4 changes: 2 additions & 2 deletions hyperspace/parachain/src/finality_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ where
<T as subxt::Config>::AccountId: Send + Sync,
<T as subxt::Config>::Address: Send + Sync,
{
let _justification = match finality_event {
let latest_justification = match finality_event {
FinalityEvent::Grandpa(justification) => justification,
_ => panic!("Expected grandpa finality event"),
};
Expand Down Expand Up @@ -635,7 +635,7 @@ where
// checkpoints so we don't end up with a very large finality proof at the session end.
let is_update_required = source
.is_update_required(
justification.commit.target_number.into(),
latest_justification.commit.target_number.into(),
client_state.latest_relay_height.into(),
)
.await?;
Expand Down
3 changes: 1 addition & 2 deletions hyperspace/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ pub struct CommonClientState {
pub initial_rpc_call_delay: Duration,
pub misbehaviour_client_msg_queue: Arc<AsyncMutex<Vec<AnyClientMessage>>>,
pub max_packets_to_process: usize,

pub skip_tokens_list: Vec<String>,
}

Expand All @@ -146,7 +145,7 @@ impl Default for CommonClientState {
initial_rpc_call_delay: rpc_call_delay,
misbehaviour_client_msg_queue: Arc::new(Default::default()),
max_packets_to_process: 100,
skip_tokens_list: vec!["uosmo".to_string()],
skip_tokens_list: Default::default(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion hyperspace/testsuite/tests/parachain_cosmos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ async fn setup_clients() -> (AnyChain, AnyChain) {
skip_optional_client_updates: true,
max_packets_to_process: 200,
},
skip_tokens_list: Some(vec!["uosmo".to_string()]),
skip_tokens_list: None,
};

let chain_b = CosmosClient::<DefaultConfig>::new(config_b.clone()).await.unwrap();
Expand Down

0 comments on commit b5c735f

Please sign in to comment.