Skip to content

Commit

Permalink
Merge branch 'main' into kunal/value-router
Browse files Browse the repository at this point in the history
  • Loading branch information
aroralanuk committed Dec 13, 2024
2 parents ec225b4 + ea75978 commit d996b3a
Show file tree
Hide file tree
Showing 40 changed files with 434 additions and 217 deletions.
5 changes: 5 additions & 0 deletions .changeset/chilly-balloons-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/utils': minor
---

Added `isPrivateKeyEvm` function for validating EVM private keys
9 changes: 9 additions & 0 deletions .changeset/dull-pianos-kiss.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@hyperlane-xyz/helloworld': minor
'@hyperlane-xyz/widgets': minor
'@hyperlane-xyz/infra': minor
'@hyperlane-xyz/cli': minor
'@hyperlane-xyz/sdk': minor
---

Add FeeHook and Swell to pz and ez eth config generator. Bump up Registry 6.6.0
5 changes: 5 additions & 0 deletions .changeset/hot-spies-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': minor
---

fix signer strategy init for broken cli commands
5 changes: 5 additions & 0 deletions .changeset/long-llamas-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': patch
---

Suppress help on CLI failures
5 changes: 5 additions & 0 deletions .changeset/nine-eyes-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/core': minor
---

Made releaseValueToRecipient internal
5 changes: 5 additions & 0 deletions .changeset/smooth-rocks-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/sdk': patch
---

Update default validator sets for alephzeroevmmainnet, appchain, lisk, lumiaprism, swell, treasure, vana, zklink.
5 changes: 5 additions & 0 deletions .changeset/spicy-gifts-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': minor
---

Added strategy management CLI commands and MultiProtocolSigner implementation for flexible cross-chain signer configuration and management
2 changes: 1 addition & 1 deletion .registryrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
c7891cdf0fc6a1541c41e19251611c9152ee8bf9
bde63f7c32e8d169d7e3163b14b5bb25bd3d5042
21 changes: 11 additions & 10 deletions rust/main/Cargo.lock

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

11 changes: 6 additions & 5 deletions rust/main/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ sha256 = "1.1.4"
sha3 = "0.10"
solana-account-decoder = "=1.14.13"
solana-client = "=1.14.13"
solana-program = "=1.14.13"
solana-sdk = "=1.14.13"
solana-transaction-status = "=1.14.13"
static_assertions = "1.1"
Expand Down Expand Up @@ -197,27 +198,27 @@ overflow-checks = true
[workspace.dependencies.ethers]
features = []
git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2024-12-03-3"
tag = "2024-12-10"

[workspace.dependencies.ethers-contract]
features = ["legacy"]
git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2024-12-03-3"
tag = "2024-12-10"

[workspace.dependencies.ethers-core]
features = []
git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2024-12-03-3"
tag = "2024-12-10"

[workspace.dependencies.ethers-providers]
features = []
git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2024-12-03-3"
tag = "2024-12-10"

[workspace.dependencies.ethers-signers]
features = ["aws"]
git = "https://github.com/hyperlane-xyz/ethers-rs"
tag = "2024-12-03-3"
tag = "2024-12-10"

[patch.crates-io.curve25519-dalek]
branch = "v3.2.2-relax-zeroize"
Expand Down
19 changes: 12 additions & 7 deletions rust/main/agents/relayer/src/msg/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,29 @@ impl ForwardBackwardIterator {
loop {
let high_nonce_message_status = self.high_nonce_iter.try_get_next_nonce(metrics)?;
let low_nonce_message_status = self.low_nonce_iter.try_get_next_nonce(metrics)?;
// Always prioritize the high nonce message

match (high_nonce_message_status, low_nonce_message_status) {
// Keep iterating if only processed messages are found
// Always prioritize advancing the the high nonce iterator, as
// we have a preference for higher nonces
(MessageStatus::Processed, _) => {
self.high_nonce_iter.iterate();
}
(_, MessageStatus::Processed) => {
self.low_nonce_iter.iterate();
}
// Otherwise return - either a processable message or nothing to process
(MessageStatus::Processable(high_nonce_message), _) => {
self.high_nonce_iter.iterate();
return Ok(Some(high_nonce_message));
}

// Low nonce messages are only processed if the high nonce iterator
// can't make any progress
(_, MessageStatus::Processed) => {
self.low_nonce_iter.iterate();
}
(_, MessageStatus::Processable(low_nonce_message)) => {
self.low_nonce_iter.iterate();
return Ok(Some(low_nonce_message));
}

// If both iterators give us unindexed messages, there are no messages at the moment
(MessageStatus::Unindexed, MessageStatus::Unindexed) => return Ok(None),
}
// This loop may iterate through millions of processed messages, blocking the runtime.
Expand Down Expand Up @@ -157,7 +162,7 @@ impl DirectionalNonceIterator {
}

fn try_get_next_nonce(
&mut self,
&self,
metrics: &MessageProcessorMetrics,
) -> Result<MessageStatus<HyperlaneMessage>> {
if let Some(message) = self.indexed_message_with_nonce()? {
Expand Down
24 changes: 15 additions & 9 deletions rust/main/agents/relayer/src/server/message_retry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,11 @@ mod tests {
let (addr, mut rx) = setup_test_server();

let client = reqwest::Client::new();
let mut message = HyperlaneMessage::default();
// Use a random destination domain
message.destination = 42;
let message = HyperlaneMessage {
// Use a random destination domain
destination: 42,
..Default::default()
};
let pending_operation = MockPendingOperation::with_message_data(message.clone());
let matching_list_body = json!([
{
Expand Down Expand Up @@ -127,9 +129,11 @@ mod tests {
let (addr, mut rx) = setup_test_server();

let client = reqwest::Client::new();
let mut message = HyperlaneMessage::default();
// Use a random origin domain
message.origin = 42;
let message = HyperlaneMessage {
// Use a random origin domain
origin: 42,
..Default::default()
};
let pending_operation = MockPendingOperation::with_message_data(message.clone());
let matching_list_body = json!([
{
Expand Down Expand Up @@ -216,9 +220,11 @@ mod tests {
let (addr, mut rx) = setup_test_server();

let client = reqwest::Client::new();
let mut message = HyperlaneMessage::default();
// Use a random origin domain
message.origin = 42;
let message = HyperlaneMessage {
// Use a random origin domain
origin: 42,
..Default::default()
};
let pending_operation = MockPendingOperation::with_message_data(message.clone());
let matching_list_body = json!([
{
Expand Down
12 changes: 5 additions & 7 deletions rust/main/agents/validator/src/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ mod test {
let unix_timestamp = chrono::Utc::now().timestamp() as u64;
let expected_reorg_period = 12;

let pre_reorg_merke_insertions = vec![
let pre_reorg_merke_insertions = [
MerkleTreeInsertion::new(0, H256::random()),
MerkleTreeInsertion::new(1, H256::random()),
MerkleTreeInsertion::new(2, H256::random()),
Expand All @@ -570,9 +570,9 @@ mod test {
}

// the last leaf is different post-reorg
let post_reorg_merkle_insertions = vec![
pre_reorg_merke_insertions[0].clone(),
pre_reorg_merke_insertions[1].clone(),
let post_reorg_merkle_insertions = [
pre_reorg_merke_insertions[0],
pre_reorg_merke_insertions[1],
MerkleTreeInsertion::new(2, H256::random()),
];
let mut mock_onchain_merkle_tree = IncrementalMerkle::default();
Expand All @@ -589,9 +589,7 @@ mod test {
// the db returns the pre-reorg merkle tree insertions
let mut db = MockDb::new();
db.expect_retrieve_merkle_tree_insertion_by_leaf_index()
.returning(move |sequence| {
Ok(Some(pre_reorg_merke_insertions[*sequence as usize].clone()))
});
.returning(move |sequence| Ok(Some(pre_reorg_merke_insertions[*sequence as usize])));

// boilerplate mocks
let mut mock_merkle_tree_hook = MockMerkleTreeHook::new();
Expand Down
8 changes: 4 additions & 4 deletions rust/main/chains/hyperlane-cosmos/src/libs/account/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ fn test_ethereum_style() {
fn compressed_public_key() -> PublicKey {
let hex = hex::decode(COMPRESSED_PUBLIC_KEY).unwrap();
let tendermint = tendermint::PublicKey::from_raw_secp256k1(&hex).unwrap();
let pub_key = PublicKey::from(tendermint);
pub_key

PublicKey::from(tendermint)
}

fn decompressed_public_key() -> PublicKey {
let hex = hex::decode(COMPRESSED_PUBLIC_KEY).unwrap();
let decompressed = decompress_public_key(&hex).unwrap();
let tendermint = tendermint::PublicKey::from_raw_secp256k1(&decompressed).unwrap();
let pub_key = PublicKey::from(tendermint);
pub_key

PublicKey::from(tendermint)
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ mod tests {

fn encode_proto(msg: &MsgRecvPacket) -> Any {
let mut buf = Vec::with_capacity(msg.encoded_len());
MsgRecvPacket::encode(&msg, &mut buf).unwrap();
MsgRecvPacket::encode(msg, &mut buf).unwrap();

Any {
type_url: "".to_string(),
Expand Down
17 changes: 14 additions & 3 deletions rust/main/chains/hyperlane-ethereum/src/tx.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::sync::Arc;
use std::time::Duration;
use std::{ops::Mul, sync::Arc};

use ethers::{
abi::Detokenize,
Expand Down Expand Up @@ -154,7 +154,7 @@ where
}

let Ok((base_fee, max_fee, max_priority_fee)) =
estimate_eip1559_fees(provider, None, &latest_block).await
estimate_eip1559_fees(provider, None, &latest_block, domain).await
else {
// Is not EIP 1559 chain
return Ok(tx.gas(gas_limit));
Expand Down Expand Up @@ -210,6 +210,7 @@ async fn estimate_eip1559_fees<M>(
provider: Arc<M>,
estimator: Option<FeeEstimator>,
latest_block: &Block<TxHash>,
domain: &HyperlaneDomain,
) -> ChainResult<(EthersU256, EthersU256, EthersU256)>
where
M: Middleware + 'static,
Expand All @@ -234,7 +235,17 @@ where
eip1559_default_estimator(base_fee_per_gas, fee_history.reward)
};

Ok((base_fee_per_gas, max_fee_per_gas, max_priority_fee_per_gas))
let mut gas_price_multiplier: u32 = 1;
// `treasure` chain gas estimation underestimates the actual gas price, so we add a multiplier to it
if domain.id() == 61166 {
gas_price_multiplier = 2;
}

Ok((
base_fee_per_gas.mul(gas_price_multiplier),
max_fee_per_gas.mul(gas_price_multiplier),
max_priority_fee_per_gas.mul(gas_price_multiplier),
))
}

pub(crate) async fn call_with_reorg_period<M, T>(
Expand Down
1 change: 1 addition & 0 deletions rust/main/chains/hyperlane-sealevel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ serde.workspace = true
serde_json.workspace = true
solana-account-decoder.workspace = true
solana-client.workspace = true
solana-program.workspace = true
solana-sdk.workspace = true
solana-transaction-status.workspace = true
thiserror.workspace = true
Expand Down
Loading

0 comments on commit d996b3a

Please sign in to comment.