fix: docker agent build (#4481)

fix: docker agent build
- update image from 1.72.1 -> 1.80.1

drive-by: update more `rust/` --> `rust/main/`

drive-by: consolidate e2e non-cosmwasm cache, multiple cache steps per
job can get in the way of each other

---------

Signed-off-by: pbio <10051819+paulbalaji@users.noreply.github.com>
kunal/verifiedMessageId-param
Paul Balaji 2 months ago committed by GitHub
parent 096aeff13e
commit 1ab8751afb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .gitattributes
  2. 18
      .github/workflows/agent-release-artifacts.yml
  3. 14
      .github/workflows/test.yml
  4. 7
      .husky/pre-commit
  5. 9
      rust/Dockerfile
  6. 2
      rust/README.md
  7. 2
      rust/main/hyperlane-base/src/settings/loader/mod.rs
  8. 2
      rust/main/hyperlane-base/tests/chain_config.rs
  9. 2
      rust/main/utils/run-locally/src/cosmos/mod.rs
  10. 4
      solidity/update_abis.sh
  11. 2
      typescript/infra/scripts/funding/fund-keys-from-deployer.ts
  12. 6
      typescript/infra/src/config/agent/agent.ts
  13. 4
      typescript/infra/src/config/agent/relayer.ts
  14. 2
      typescript/sdk/src/ism/metadata/aggregation.ts

2
.gitattributes vendored

@ -1,4 +1,4 @@
typescript/sdk/src/cw-types/*.types.ts linguist-generated=true typescript/sdk/src/cw-types/*.types.ts linguist-generated=true
rust/chains/hyperlane-ethereum/abis/*.abi.json linguist-generated=true rust/main/chains/hyperlane-ethereum/abis/*.abi.json linguist-generated=true
solidity/contracts/interfaces/avs/*.sol linguist-vendored=true solidity/contracts/interfaces/avs/*.sol linguist-vendored=true
solidity/contracts/avs/ECDSA*.sol linguist-vendored=true solidity/contracts/avs/ECDSA*.sol linguist-vendored=true

@ -65,23 +65,23 @@ jobs:
target: ${{ matrix.TARGET }} target: ${{ matrix.TARGET }}
- name: setup target - name: setup target
run: rustup target add ${{ matrix.TARGET }} run: rustup target add ${{ matrix.TARGET }}
working-directory: ./rust working-directory: ./rust/main
- name: build - name: build
run: cargo build --release --target ${{ matrix.TARGET }} --bin relayer --bin scraper --bin validator run: cargo build --release --target ${{ matrix.TARGET }} --bin relayer --bin scraper --bin validator
working-directory: ./rust working-directory: ./rust/main
- name: make executable - name: make executable
if: ${{ matrix.OS == 'larger-runner' || matrix.OS == 'macos-latest' }} if: ${{ matrix.OS == 'larger-runner' || matrix.OS == 'macos-latest' }}
run: chmod ug+x,-w relayer scraper validator run: chmod ug+x,-w relayer scraper validator
working-directory: rust/target/${{ matrix.TARGET }}/release working-directory: rust/main/target/${{ matrix.TARGET }}/release
- name: upload binaries - name: upload binaries
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.TARGET }}-${{ needs.prepare.outputs.tag_sha }}-${{ needs.prepare.outputs.tag_date }} name: ${{ matrix.TARGET }}-${{ needs.prepare.outputs.tag_sha }}-${{ needs.prepare.outputs.tag_date }}
path: | path: |
rust/target/${{ matrix.TARGET }}/release/relayer rust/main/target/${{ matrix.TARGET }}/release/relayer
rust/target/${{ matrix.TARGET }}/release/relayer.exe rust/main/target/${{ matrix.TARGET }}/release/relayer.exe
rust/target/${{ matrix.TARGET }}/release/scraper rust/main/target/${{ matrix.TARGET }}/release/scraper
rust/target/${{ matrix.TARGET }}/release/scraper.exe rust/main/target/${{ matrix.TARGET }}/release/scraper.exe
rust/target/${{ matrix.TARGET }}/release/validator rust/main/target/${{ matrix.TARGET }}/release/validator
rust/target/${{ matrix.TARGET }}/release/validator.exe rust/main/target/${{ matrix.TARGET }}/release/validator.exe
if-no-files-found: error if-no-files-found: error

@ -172,23 +172,13 @@ jobs:
- name: rust cache - name: rust cache
uses: Swatinem/rust-cache@v2 uses: Swatinem/rust-cache@v2
with: with:
prefix-key: 'v2-rust-main' prefix-key: 'v2-rust-e2e'
shared-key: ${{ matrix.e2e-type }} shared-key: ${{ matrix.e2e-type }}
cache-provider: 'buildjet' cache-provider: 'buildjet'
save-if: ${{ !startsWith(github.ref, 'refs/heads/gh-readonly-queue') }} save-if: ${{ !startsWith(github.ref, 'refs/heads/gh-readonly-queue') }}
workspaces: | workspaces: |
./rust/main ./rust/main
${{ matrix.e2e-type == 'non-cosmwasm' && './rust/sealevel' || '' }}
- name: rust cache
uses: Swatinem/rust-cache@v2
if: matrix.e2e-type == 'non-cosmwasm'
with:
prefix-key: 'v2-rust-sealevel'
shared-key: ${{ matrix.e2e-type }}
cache-provider: 'buildjet'
save-if: ${{ !startsWith(github.ref, 'refs/heads/gh-readonly-queue') }}
workspaces: |
./rust/sealevel
- name: Free disk space - name: Free disk space
run: | run: |

@ -7,6 +7,9 @@ echo "📝 If you haven't yet, please add a changeset for your changes via 'yarn
# if any *.rs files have changed # if any *.rs files have changed
if git diff --staged --exit-code --name-only | grep -q -E ".*\.rs$"; then if git diff --staged --exit-code --name-only | grep -q -E ".*\.rs$"; then
echo "Running cargo fmt pre-commit hook" echo "Running cargo fmt pre-commit hook for rust/main"
cargo fmt --all --check --manifest-path rust/Cargo.toml cargo fmt --all --check --manifest-path rust/main/Cargo.toml
echo "Running cargo fmt pre-commit hook for rust/sealevel"
cargo fmt --all --check --manifest-path rust/sealevel/Cargo.toml
fi fi

@ -1,6 +1,6 @@
# syntax=docker/dockerfile:experimental # syntax=docker/dockerfile:experimental
FROM rust:1.72.1 as builder FROM rust:1.80.1 as builder
WORKDIR /usr/src WORKDIR /usr/src
# 1a: Prepare for static linking # 1a: Prepare for static linking
@ -23,18 +23,13 @@ COPY rust/main/utils rust/main/utils
COPY rust/sealevel rust/sealevel COPY rust/sealevel rust/sealevel
COPY rust/main/Cargo.toml rust/main/. COPY rust/main/Cargo.toml rust/main/.
COPY rust/main/Cargo.toml rust/main/. COPY rust/main/Cargo.lock rust/main/.
COPY rust/sealevel/Cargo.lock rust/sealevel/.
COPY rust/sealevel/Cargo.lock rust/sealevel/.
WORKDIR /usr/src/rust/main WORKDIR /usr/src/rust/main
# Build binaries # Build binaries
RUN \ RUN \
--mount=id=cargo,type=cache,sharing=locked,target=/usr/src/target \
--mount=id=cargo-home-registry,type=cache,sharing=locked,target=/usr/local/cargo/registry \
--mount=id=cargo-home-git,type=cache,sharing=locked,target=/usr/local/cargo/git \
RUSTFLAGS="--cfg tokio_unstable" cargo build --release --bin validator --bin relayer --bin scraper && \ RUSTFLAGS="--cfg tokio_unstable" cargo build --release --bin validator --bin relayer --bin scraper && \
mkdir -p /release && \ mkdir -p /release && \
cp /usr/src/rust/main/target/release/validator /release && \ cp /usr/src/rust/main/target/release/validator /release && \

@ -117,7 +117,7 @@ cd rust
### Deploy Procedure ### Deploy Procedure
The contract addresses of each deploy can be found in `rust/config`. The agents will The contract addresses of each deploy can be found in `rust/main/config`. The agents will
automatically pull in all configs in this directory. automatically pull in all configs in this directory.
When agents are deployed to point at a new environment, they cease to point at When agents are deployed to point at a new environment, they cease to point at

@ -27,7 +27,7 @@ where
let mut base_config_sources = vec![]; let mut base_config_sources = vec![];
let mut builder = Config::builder(); let mut builder = Config::builder();
// Always load the default config files (`rust/config/*.json`) // Always load the default config files (`rust/main/config/*.json`)
for entry in PathBuf::from("./config") for entry in PathBuf::from("./config")
.read_dir() .read_dir()
.context("Failed to open config directory") .context("Failed to open config directory")

@ -6,7 +6,7 @@ use hyperlane_base::settings::{parser::RawAgentConf, Settings};
use hyperlane_core::{config::*, KnownHyperlaneDomain}; use hyperlane_core::{config::*, KnownHyperlaneDomain};
use walkdir::WalkDir; use walkdir::WalkDir;
/// Relative path to the `hyperlane-monorepo/rust/config/` /// Relative path to the `hyperlane-monorepo/rust/main/config/`
/// directory, which is where the agent's config files /// directory, which is where the agent's config files
/// currently live. /// currently live.
const AGENT_CONFIG_PATH_ROOT: &str = "../config"; const AGENT_CONFIG_PATH_ROOT: &str = "../config";

@ -581,7 +581,7 @@ fn run_locally() {
postgres, postgres,
}; };
// Mostly copy-pasta from `rust/utils/run-locally/src/main.rs` // Mostly copy-pasta from `rust/main/utils/run-locally/src/main.rs`
// TODO: refactor to share code // TODO: refactor to share code
let loop_start = Instant::now(); let loop_start = Instant::now();
let mut failure_occurred = false; let mut failure_occurred = false;

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/sh
# Must be ran from the `solidity` directory # Must be ran from the `solidity` directory
@ -6,7 +6,7 @@ copy() {
# Optionally allow path to be passed in, and extract the contract name # Optionally allow path to be passed in, and extract the contract name
# as the string following the last instance of `/` # as the string following the last instance of `/`
CONTRACT_NAME="${1##*/}" CONTRACT_NAME="${1##*/}"
jq .abi < artifacts/contracts/"$1".sol/"$CONTRACT_NAME".json > ../rust/chains/hyperlane-ethereum/abis/"$CONTRACT_NAME".abi.json jq .abi < artifacts/contracts/"$1".sol/"$CONTRACT_NAME".json > ../rust/main/chains/hyperlane-ethereum/abis/"$CONTRACT_NAME".abi.json
} }
copy interfaces/IMailbox && \ copy interfaces/IMailbox && \

@ -72,7 +72,7 @@ const constMetricLabels = {
const metricsRegister = new Registry(); const metricsRegister = new Registry();
const walletBalanceGauge = new Gauge({ const walletBalanceGauge = new Gauge({
// Mirror the rust/ethers-prometheus `wallet_balance` gauge metric. // Mirror the rust/main/ethers-prometheus `wallet_balance` gauge metric.
name: 'hyperlane_wallet_balance', name: 'hyperlane_wallet_balance',
help: 'Current balance of eth and other tokens in the `tokens` map for the wallet addresses in the `wallets` set', help: 'Current balance of eth and other tokens in the `tokens` map for the wallet addresses in the `wallets` set',
registers: [metricsRegister], registers: [metricsRegister],

@ -30,7 +30,7 @@ export type DeepPartial<T> = T extends object
} }
: T; : T;
// See rust/helm/values.yaml for the full list of options and their defaults. // See rust/main/helm/values.yaml for the full list of options and their defaults.
// This is the root object in the values file. // This is the root object in the values file.
export interface HelmRootAgentValues { export interface HelmRootAgentValues {
image: HelmImageValues; image: HelmImageValues;
@ -38,7 +38,7 @@ export interface HelmRootAgentValues {
nameOverride?: string; nameOverride?: string;
} }
// See rust/helm/values.yaml for the full list of options and their defaults. // See rust/main/helm/values.yaml for the full list of options and their defaults.
// This is at `.hyperlane` in the values file. // This is at `.hyperlane` in the values file.
interface HelmHyperlaneValues { interface HelmHyperlaneValues {
runEnv: DeployEnvironment; runEnv: DeployEnvironment;
@ -54,7 +54,7 @@ interface HelmHyperlaneValues {
scraper?: HelmScraperValues; scraper?: HelmScraperValues;
} }
// See rust/helm/values.yaml for the full list of options and their defaults. // See rust/main/helm/values.yaml for the full list of options and their defaults.
// This is at `.hyperlane.chains` in the values file. // This is at `.hyperlane.chains` in the values file.
export interface HelmAgentChainOverride export interface HelmAgentChainOverride
extends DeepPartial<AgentChainMetadata> { extends DeepPartial<AgentChainMetadata> {

@ -51,14 +51,14 @@ export interface BaseRelayerConfig {
// Full relayer-specific agent config for a single chain // Full relayer-specific agent config for a single chain
export type RelayerConfig = Omit<RelayerAgentConfig, keyof AgentConfig>; export type RelayerConfig = Omit<RelayerAgentConfig, keyof AgentConfig>;
// See rust/helm/values.yaml for the full list of options and their defaults. // See rust/main/helm/values.yaml for the full list of options and their defaults.
// This is at `.hyperlane.relayer` in the values file. // This is at `.hyperlane.relayer` in the values file.
export interface HelmRelayerValues extends HelmStatefulSetValues { export interface HelmRelayerValues extends HelmStatefulSetValues {
aws: boolean; aws: boolean;
config?: RelayerConfig; config?: RelayerConfig;
} }
// See rust/helm/values.yaml for the full list of options and their defaults. // See rust/main/helm/values.yaml for the full list of options and their defaults.
// This is at `.hyperlane.relayerChains` in the values file. // This is at `.hyperlane.relayerChains` in the values file.
export interface HelmRelayerChainValues { export interface HelmRelayerChainValues {
name: string; name: string;

@ -26,7 +26,7 @@ export interface AggregationMetadata<T = string> {
const RANGE_SIZE = 4; const RANGE_SIZE = 4;
// adapted from rust/agents/relayer/src/msg/metadata/aggregation.rs // adapted from rust/main/agents/relayer/src/msg/metadata/aggregation.rs
export class AggregationMetadataBuilder implements MetadataBuilder { export class AggregationMetadataBuilder implements MetadataBuilder {
protected logger = rootLogger.child({ protected logger = rootLogger.child({
module: 'AggregationIsmMetadataBuilder', module: 'AggregationIsmMetadataBuilder',

Loading…
Cancel
Save