Skip to content

Commit

Permalink
Merge branch 'main' of github.com:hyperlane-xyz/hyperlane-monorepo in…
Browse files Browse the repository at this point in the history
…to xeno/core-deploy-apply-admin-proxy-ownership-fixes
  • Loading branch information
xeno097 committed Nov 7, 2024
2 parents 7798c00 + 884b00c commit 52936e1
Show file tree
Hide file tree
Showing 216 changed files with 8,520 additions and 5,026 deletions.
5 changes: 0 additions & 5 deletions .changeset/cold-dingos-give.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/cuddly-baboons-drive.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/dirty-swans-drum.md

This file was deleted.

7 changes: 7 additions & 0 deletions .changeset/empty-needles-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@hyperlane-xyz/utils': major
'@hyperlane-xyz/sdk': major
---

Upgrade Viem to 2.2 and Solana Web3 to 1.9
Rename `chainMetadataToWagmiChain` to `chainMetadataToViemChain`
5 changes: 0 additions & 5 deletions .changeset/fresh-pigs-work.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/hip-mugs-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/sdk': minor
---

Deploy to alephzeroevmtestnet, update deployment for arcadiatestnet2.
7 changes: 7 additions & 0 deletions .changeset/lazy-carpets-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@hyperlane-xyz/cli': minor
'@hyperlane-xyz/sdk': minor
'@hyperlane-xyz/core': minor
---

Add storage based multisig ISM types
6 changes: 0 additions & 6 deletions .changeset/long-queens-deny.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/neat-sloths-agree.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/pink-bats-mix.md

This file was deleted.

11 changes: 0 additions & 11 deletions .changeset/plenty-pens-peel.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
'@hyperlane-xyz/utils': patch
---

fix median utils func + add test
Added a mustGet helper
5 changes: 0 additions & 5 deletions .changeset/silent-berries-attend.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/sixty-eggs-smoke.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/sweet-houses-type.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/thin-tips-explain.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tidy-meals-add.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/actions/yarn-build-with-cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ runs:
path: |
**/node_modules
.yarn
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
key: ${{ runner.os }}-yarn-4.5.1-cache-${{ hashFiles('./yarn.lock') }}

# Typically, the cache will be hit, but if there's a network error when
# restoring the cache, let's run the install step ourselves.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
path: |
**/node_modules
.yarn
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
key: ${{ runner.os }}-yarn-4.5.1-cache-${{ hashFiles('./yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-cache-
${{ runner.os }}-yarn-4.5.1.-cache-
- name: yarn-install
run: yarn install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/storage-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
path: |
**/node_modules
.yarn
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
key: ${{ runner.os }}-yarn-4.5.1-cache-${{ hashFiles('./yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-cache-
${{ runner.os }}-yarn-4.5.1-cache-
- name: yarn-install
run: yarn install
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ jobs:
path: |
**/node_modules
.yarn
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
key: ${{ runner.os }}-yarn-4.5.1-cache-${{ hashFiles('./yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-cache-
${{ runner.os }}-yarn-4.5.1-cache-
- name: yarn-install
run: |
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
path: |
**/node_modules
.yarn
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('./yarn.lock') }}
key: ${{ runner.os }}-yarn-4.5.1-cache-${{ hashFiles('./yarn.lock') }}
fail-on-cache-miss: true

- name: lint
Expand Down
2 changes: 1 addition & 1 deletion .registryrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
302be4817c063629cec70c0b02322b250df71122
4e52093acfe3dc75a35771905f3a7757b368ac50
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.0.2.cjs

This file was deleted.

934 changes: 934 additions & 0 deletions .yarn/releases/yarn-4.5.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ plugins:
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs
spec: "https://mskelton.dev/yarn-outdated/v3"

yarnPath: .yarn/releases/yarn-4.0.2.cjs
yarnPath: .yarn/releases/yarn-4.5.1.cjs
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /hyperlane-monorepo

RUN apk add --update --no-cache git g++ make py3-pip jq

RUN yarn set version 4.0.2
RUN yarn set version 4.5.1

# Copy package.json and friends
COPY package.json yarn.lock .yarnrc.yml ./
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"dependencies": {
"@changesets/cli": "^2.26.2"
},
"packageManager": "yarn@4.0.2",
"packageManager": "yarn@4.5.1",
"private": true,
"scripts": {
"agent-configs": "yarn --cwd typescript/infra/ update-agent-config:mainnet3 && yarn --cwd typescript/infra/ update-agent-config:testnet4 && yarn prettier",
Expand Down
1 change: 0 additions & 1 deletion rust/main/Cargo.lock

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

77 changes: 64 additions & 13 deletions rust/main/agents/relayer/src/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ use hyperlane_base::{
broadcast::BroadcastMpscSender,
db::{HyperlaneRocksDB, DB},
metrics::{AgentMetrics, MetricsUpdater},
settings::ChainConf,
settings::{ChainConf, IndexSettings},
AgentMetadata, BaseAgent, ChainMetrics, ContractSyncMetrics, ContractSyncer, CoreMetrics,
HyperlaneAgentCore, SyncOptions,
};
use hyperlane_core::{
rpc_clients::call_and_retry_n_times, ChainCommunicationError, ContractSyncCursor,
HyperlaneDomain, HyperlaneMessage, InterchainGasPayment, MerkleTreeInsertion, QueueOperation,
H512, U256,
};
Expand Down Expand Up @@ -50,6 +51,9 @@ use crate::{
};
use crate::{processor::Processor, server::ENDPOINT_MESSAGES_QUEUE_SIZE};

const CURSOR_BUILDING_ERROR: &str = "Error building cursor for origin";
const CURSOR_INSTANTIATION_ATTEMPTS: usize = 10;

#[derive(Debug, Hash, PartialEq, Eq, Copy, Clone)]
struct ContextKey {
origin: u32,
Expand Down Expand Up @@ -354,6 +358,7 @@ impl BaseAgent for Relayer {
}

for origin in &self.origin_chains {
self.chain_metrics.set_critical_error(origin.name(), false);
let maybe_broadcaster = self
.message_syncs
.get(origin)
Expand Down Expand Up @@ -412,17 +417,51 @@ impl BaseAgent for Relayer {
}

impl Relayer {
fn record_critical_error(
&self,
origin: &HyperlaneDomain,
err: ChainCommunicationError,
message: &str,
) {
error!(?err, origin=?origin, "{message}");
self.chain_metrics.set_critical_error(origin.name(), true);
}

async fn instantiate_cursor_with_retries<T: 'static>(
contract_sync: Arc<dyn ContractSyncer<T>>,
index_settings: IndexSettings,
) -> Result<Box<dyn ContractSyncCursor<T>>, ChainCommunicationError> {
call_and_retry_n_times(
|| {
let contract_sync = contract_sync.clone();
let index_settings = index_settings.clone();
Box::pin(async move {
let cursor = contract_sync.cursor(index_settings).await?;
Ok(cursor)
})
},
CURSOR_INSTANTIATION_ATTEMPTS,
)
.await
}

async fn run_message_sync(
&self,
origin: &HyperlaneDomain,
task_monitor: TaskMonitor,
) -> Instrumented<JoinHandle<()>> {
let index_settings = self.as_ref().settings.chains[origin.name()].index_settings();
let contract_sync = self.message_syncs.get(origin).unwrap().clone();
let cursor = contract_sync
.cursor(index_settings)
.await
.unwrap_or_else(|err| panic!("Error getting cursor for origin {origin}: {err}"));
let cursor_instantiation_result =
Self::instantiate_cursor_with_retries(contract_sync.clone(), index_settings.clone())
.await;
let cursor = match cursor_instantiation_result {
Ok(cursor) => cursor,
Err(err) => {
self.record_critical_error(origin, err, CURSOR_BUILDING_ERROR);
return tokio::spawn(async {}).instrument(info_span!("MessageSync"));
}
};
tokio::spawn(TaskMonitor::instrument(&task_monitor, async move {
contract_sync
.clone()
Expand All @@ -444,10 +483,16 @@ impl Relayer {
.get(origin)
.unwrap()
.clone();
let cursor = contract_sync
.cursor(index_settings)
.await
.unwrap_or_else(|err| panic!("Error getting cursor for origin {origin}: {err}"));
let cursor_instantiation_result =
Self::instantiate_cursor_with_retries(contract_sync.clone(), index_settings.clone())
.await;
let cursor = match cursor_instantiation_result {
Ok(cursor) => cursor,
Err(err) => {
self.record_critical_error(origin, err, CURSOR_BUILDING_ERROR);
return tokio::spawn(async {}).instrument(info_span!("IgpSync"));
}
};
tokio::spawn(TaskMonitor::instrument(&task_monitor, async move {
contract_sync
.clone()
Expand All @@ -468,10 +513,16 @@ impl Relayer {
) -> Instrumented<JoinHandle<()>> {
let index_settings = self.as_ref().settings.chains[origin.name()].index.clone();
let contract_sync = self.merkle_tree_hook_syncs.get(origin).unwrap().clone();
let cursor = contract_sync
.cursor(index_settings)
.await
.unwrap_or_else(|err| panic!("Error getting cursor for origin {origin}: {err}"));
let cursor_instantiation_result =
Self::instantiate_cursor_with_retries(contract_sync.clone(), index_settings.clone())
.await;
let cursor = match cursor_instantiation_result {
Ok(cursor) => cursor,
Err(err) => {
self.record_critical_error(origin, err, CURSOR_BUILDING_ERROR);
return tokio::spawn(async {}).instrument(info_span!("MerkleTreeHookSync"));
}
};
tokio::spawn(TaskMonitor::instrument(&task_monitor, async move {
contract_sync
.clone()
Expand Down
Loading

0 comments on commit 52936e1

Please sign in to comment.