Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/zksync-signer-strategy' int…
Browse files Browse the repository at this point in the history
…o feat/zksync-support
  • Loading branch information
ljankovic-txfusion committed Dec 12, 2024
2 parents b7e3c81 + b6fc019 commit b89aaa0
Show file tree
Hide file tree
Showing 179 changed files with 3,097 additions and 1,563 deletions.
8 changes: 8 additions & 0 deletions .changeset/big-squids-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@hyperlane-xyz/helloworld': patch
'@hyperlane-xyz/widgets': patch
'@hyperlane-xyz/cli': patch
'@hyperlane-xyz/sdk': patch
---

Bump registry version to v6.3.0.
5 changes: 0 additions & 5 deletions .changeset/clever-melons-sell.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/empty-lemons-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': minor
---

Add support for deploying Hooks using a HookConfig within a WarpConfig
6 changes: 6 additions & 0 deletions .changeset/fresh-fishes-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@hyperlane-xyz/sdk': major
---

Rename TokenConfig related types and utilities for clarity. E.g. `CollateralConfig` to `CollateralTokenConfig`.
Export more config types and zod schemas
5 changes: 0 additions & 5 deletions .changeset/nice-oranges-glow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/polite-beds-begin.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/seven-lemons-care.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/silver-peas-mate.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/sixty-plants-tie.md

This file was deleted.

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: 0 additions & 5 deletions .changeset/sour-wasps-own.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/ten-pigs-double.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tough-roses-allow.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tricky-clocks-retire.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/twenty-bulldogs-flash.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/warm-starfishes-carry.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/yellow-swans-join.md

This file was deleted.

2 changes: 1 addition & 1 deletion .registryrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1591e4a4438c9d5c979e3a400a9831b14e85eeee
c7891cdf0fc6a1541c41e19251611c9152ee8bf9
23 changes: 16 additions & 7 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ info: This is the version for the rustup toolchain manager, not the rustc compil
info: The currently active `rustc` version is `rustc 1.72.1 (d5c2e9c34 2023-09-13)`
```

### Overview of Rust Workspaces

There are two Rust workspaces in this directory:

- [main](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/main): The offchain agents workspace, most notably comprised of the relayer, validator, scraper and the Rust end-to-end tests (in `utils/run-locally`)
- [sealevel](https://github.com/hyperlane-xyz/hyperlane-monorepo/tree/main/rust/sealevel): Hyperlane smart contracts and tooling for the SVM, implemented in native Rust.

You can only run `cargo build` after `cd`-ing into one of these workspaces.

#### Apple Silicon

If your device has an Apple Silicon processor, you may need to install Rosetta 2:
Expand All @@ -23,7 +32,9 @@ If your device has an Apple Silicon processor, you may need to install Rosetta 2
softwareupdate --install-rosetta --agree-to-license
```

### Running Locally
### Running Agents Locally

Make sure you're in the `main` workspace.

To run the validator, run:

Expand Down Expand Up @@ -174,7 +185,7 @@ For Ethereum and Celo connections we use
We use the tokio async runtime environment. Please see the docs
[here](https://docs.rs/tokio/1.1.0/tokio/).

### Repo layout
### `main` workspace layout

- `hyperlane-base`
- lowest dependency hyperlane utilities
Expand All @@ -190,11 +201,9 @@ We use the tokio async runtime environment. Please see the docs
- traits (interfaces) for the on-chain contracts
- model implementations of the contracts in rust
- merkle tree implementations (for provers)
- `chains/hyperlane-ethereum`
- `chains/hyperlane-*`
- VM-specific integration of the agents
- depends on hyperlane-core (and transitively hyperlane-base)
- interfaces to the ethereum contracts
- `chains/hyperlane-fuel`
- depends on hyperlane-core
- interfaces to the fuel contracts
- interfaces with the contracts of that VM (e.g `ethereum`, `sealevel`, `cosmos`, `fuel`, etc)
- `agents`
- each of the off-chain agents implemented thus far
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
Loading

0 comments on commit b89aaa0

Please sign in to comment.