The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
hyperlane-monorepo/rust
Trevor Porter c2a948fcc0
Wrap inner providers with RetryingProvider when using QuorumProvider, not the QuorumProvider itself (#1099)
2 years ago
..
.vscode [Chore] Fix VSCode formatting and prettier precommit (#501) 2 years ago
abacus-base Use anonymous client for reading (#1100) 2 years ago
abacus-core Gas enforcement policy requiring payment to meet estimated costs (#1083) 2 years ago
abacus-test Refactoring out redundant enums (#1060) 2 years ago
agents Gas enforcement policy requiring payment to meet estimated costs (#1083) 2 years ago
chains Wrap inner providers with RetryingProvider when using QuorumProvider, not the QuorumProvider itself (#1099) 2 years ago
config Chain Expansion 0: Goerli + Moonbase Alpha (#1053) 2 years ago
ethers-prometheus Fix metric ordering (#1043) 2 years ago
gelato Gas enforcement policy requiring payment to meet estimated costs (#1083) 2 years ago
helm/abacus-agent Hyperlane packages and typescript rebrand (#1077) 2 years ago
utils Update ethers (#1058) 2 years ago
.dockerignore Add rust .dockerignore (#14) 3 years ago
.gitignore Restore reverted PR to .gitignore run-locally-induced diffs. (#746) 2 years ago
Cargo.lock Gas enforcement policy requiring payment to meet estimated costs (#1083) 2 years ago
Cargo.toml Scraper DB generation and schema (#991) 2 years ago
Dockerfile Drop rust-Kathy (#713) 2 years ago
README.md Hyperlane packages and typescript rebrand (#1077) 2 years ago
build.sh Testnet2 agent deployment (#568) 2 years ago

README.md

Hyperlane Rust implementations

Setup

Note: You should be running >= version 1.63.0 of the rustc compiler, you can see that version with this command and should see similar output:

$ rustup --version
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.63.0 (4b91a6ea7 2022-08-08)`

Useful cargo commands

  • cargo doc --open
    • generate documentation and open it in a web browser
  • cargo build
    • compile the project
  • cargo run --example example
    • run the default executable for the current project
  • cargo test
    • run the tests

Useful cargo extensions

  • tree
    • show the dependency tree. Allows searching for specific packages
    • install: cargo install cargo-tree
    • invoke: cargo tree
  • clippy
    • search the codebase for a large number of lints and bad patterns
    • install: rustup component add clippy
    • invoke: cargo clippy
  • expand
    • expand macros and procedural macros. Show the code generated by the preprocessor
    • useful for debugging #[macros] and macros!()
    • install: cargo install cargo-expand
    • invoke cargo expand path::to::module

Architecture

The on-chain portions of Hyperlane are written in Solidity. The rust portions are exclusively off-chain. Later, there may be on-chain rust for Near/Solana/ Polkadot.

Hyperlane will be managed by a number of small off-chain programs ("agents"). Each of these will have a specific role. We want these roles to be simple, and easily described. Each of these agents will connect to a home chain and any number of replicas. They need to be configured with chain connection details and have access to a reliable node for each chain.

For Ethereum and Celo connections we use ethers-rs. Please see the docs here.

We use the tokio async runtime environment. Please see the docs here.

Repo layout

  • abacus-base
    • lowest dependency abacus utilities
    • contains shared utilities for building off-chain agents
    • this includes
      • trait implementations for different chains
      • shared configuration file formats
      • basic setup for an off-chain agent
  • abacus-core
    • depends on abacus-base
    • contains implementations of core primitives
    • this includes
      • traits (interfaces) for the on-chain contracts
      • model implementations of the contracts in rust
      • merkle tree implementations (for provers)
  • chains/abacus-ethereum
    • depends on abacus-core (and transitively abacus-base)
    • interfaces to the ethereum contracts
  • agents
    • each of the off-chain agents implemented thus far

Running Locally

From within the hyperlane-monorepo/rust directory, run

cargo run -r -p run-locally

or (long-form)

cargo run --release --package run-locally