diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 46a9c83dd9..28d07a88b6 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,6 +10,9 @@ on: - "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" - "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" - "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" + pull_request: + branches: + - astria env: REGISTRY: ghcr.io diff --git a/Cargo.lock b/Cargo.lock index a7aa63c819..1318a2d619 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -409,7 +409,7 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "astria-core" version = "0.1.0" -source = "git+https://github.com/astriaorg/astria?tag=sequencer-v0.16.0#6251eaae61cb0f22b4c9f1f6cf6dcbf980a8c95f" +source = "git+https://github.com/astriaorg/astria?rev=812960f713d07d7aeed479c5e805d6238fe20312#812960f713d07d7aeed479c5e805d6238fe20312" dependencies = [ "astria-merkle", "base64 0.21.7", @@ -433,10 +433,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "astria-eyre" +version = "0.1.0" +source = "git+https://github.com/astriaorg/astria?rev=812960f713d07d7aeed479c5e805d6238fe20312#812960f713d07d7aeed479c5e805d6238fe20312" +dependencies = [ + "eyre", + "itoa", +] + [[package]] name = "astria-merkle" version = "0.1.0" -source = "git+https://github.com/astriaorg/astria?tag=sequencer-v0.16.0#6251eaae61cb0f22b4c9f1f6cf6dcbf980a8c95f" +source = "git+https://github.com/astriaorg/astria?rev=812960f713d07d7aeed479c5e805d6238fe20312#812960f713d07d7aeed479c5e805d6238fe20312" dependencies = [ "sha2 0.10.8", ] @@ -444,13 +453,15 @@ dependencies = [ [[package]] name = "astria-sequencer-client" version = "0.1.0" -source = "git+https://github.com/astriaorg/astria?tag=sequencer-v0.16.0#6251eaae61cb0f22b4c9f1f6cf6dcbf980a8c95f" +source = "git+https://github.com/astriaorg/astria?rev=812960f713d07d7aeed479c5e805d6238fe20312#812960f713d07d7aeed479c5e805d6238fe20312" dependencies = [ "astria-core", + "astria-eyre", "async-trait", "futures", "futures-util", "hex", + "humantime", "prost 0.12.6", "tendermint", "tendermint-proto", @@ -459,6 +470,7 @@ dependencies = [ "tokio", "tokio-stream", "tracing", + "tryhard", ] [[package]] @@ -5591,6 +5603,17 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "tryhard" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9f0a709784e86923586cff0d872dba54cd2d2e116b3bc57587d15737cfce9d" +dependencies = [ + "futures", + "pin-project-lite", + "tokio", +] + [[package]] name = "tungstenite" version = "0.20.1" diff --git a/ci/release/hermes.Dockerfile b/ci/release/hermes.Dockerfile index fdec4ac082..77b78f605f 100644 --- a/ci/release/hermes.Dockerfile +++ b/ci/release/hermes.Dockerfile @@ -3,7 +3,7 @@ # Usage: (from the root of the working copy) # $ docker build . -t informalsystems/hermes -f ci/release/hermes.Dockerfile -FROM rust:1-buster AS build-env +FROM rust:1.81-bookworm AS build-env ARG TAG diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 6b252fe9d4..fee06a9953 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] repository = "https://github.com/informalsystems/hermes" authors = ["Informal Systems "] -rust-version = "1.71" +rust-version = "1.81" description = """ Implementation of an IBC Relayer in Rust, as a library """ @@ -24,8 +24,8 @@ ibc-proto = { version = "0.41.0", features = ["serde"] } ibc-telemetry = { version = "0.26.4", path = "../telemetry", optional = true } ibc-relayer-types = { version = "0.26.4", path = "../relayer-types", features = ["mocks"] } -astria-core = { git = "https://github.com/astriaorg/astria", tag = "sequencer-v0.16.0" } -astria-sequencer-client = { git = "https://github.com/astriaorg/astria", tag = "sequencer-v0.16.0", features = [ "http" ] } +astria-core = { git = "https://github.com/astriaorg/astria", rev = "812960f713d07d7aeed479c5e805d6238fe20312" } +astria-sequencer-client = { git = "https://github.com/astriaorg/astria", rev = "812960f713d07d7aeed479c5e805d6238fe20312", features = [ "http" ] } ed25519-consensus = "2.1.0" ibc-types = "0.12.0" jmt = "0.6" diff --git a/crates/relayer/src/chain/astria/endpoint.rs b/crates/relayer/src/chain/astria/endpoint.rs index e4bebbde63..64306fe15f 100644 --- a/crates/relayer/src/chain/astria/endpoint.rs +++ b/crates/relayer/src/chain/astria/endpoint.rs @@ -235,13 +235,12 @@ impl AstriaEndpoint { SigningKey, VerificationKey, }, - generated::protocol::transactions::v1alpha1::Ics20Withdrawal as RawIcs20Withdrawal, + generated::protocol::transaction::v1::Ics20Withdrawal as RawIcs20Withdrawal, primitive::v1::Address, - protocol::transaction::v1alpha1::{ + protocol::transaction::v1::{ action::Ics20Withdrawal, Action, - TransactionParams, - UnsignedTransaction, + TransactionBody, }, Protobuf as _, }; @@ -287,20 +286,19 @@ impl AstriaEndpoint { .await .map_err(|e| Error::other(Box::new(e)))?; - let unsigned_tx = UnsignedTransaction { - params: TransactionParams::builder() - .nonce(nonce.nonce) - .chain_id(self.id().to_string()) - .build(), - actions, - }; - - let signed_tx = unsigned_tx.into_signed(&SigningKey::from(signing_key.to_bytes())); - let tx_bytes = signed_tx.into_raw().encode_to_vec(); + let tx = TransactionBody::builder() + .nonce(nonce.nonce) + .chain_id(self.id().to_string()) + .actions(actions) + .try_build() + .map_err(|e| Error::other_with_string(format!("{e:?}")))? + .sign(&SigningKey::from(signing_key.to_bytes())) + .into_raw() + .encode_to_vec(); let resp = self .sequencer_client - .broadcast_tx_sync(tx_bytes) + .broadcast_tx_sync(tx) .await .map_err(|e| Error::other(e.into()))?; Ok(resp) @@ -601,7 +599,7 @@ impl ChainEndpoint for AstriaEndpoint { ) -> Result { use astria_core::{ crypto::VerificationKey, - protocol::account::v1alpha1::AssetBalance, + protocol::account::v1::AssetBalance, }; use astria_sequencer_client::{ Address, diff --git a/crates/relayer/src/keyring/ed25519_key_pair.rs b/crates/relayer/src/keyring/ed25519_key_pair.rs index 93d8374322..97de500148 100644 --- a/crates/relayer/src/keyring/ed25519_key_pair.rs +++ b/crates/relayer/src/keyring/ed25519_key_pair.rs @@ -165,8 +165,8 @@ impl SigningKeyPair for Ed25519KeyPair { let verification_key = VerificationKey::try_from(self.signing_key.verifying_key().to_bytes()) .expect("can convert ed25519 public key bytes to astria verification key"); - let address = Address::builder() - .array(verification_key.address_bytes()) + let address: Address = Address::builder() + .array(*verification_key.address_bytes()) .prefix("astria") .try_build() .expect("can build astria address from ed25519 public key"); diff --git a/crates/relayer/src/transfer.rs b/crates/relayer/src/transfer.rs index b776f68e57..61eed5f722 100644 --- a/crates/relayer/src/transfer.rs +++ b/crates/relayer/src/transfer.rs @@ -208,22 +208,22 @@ fn build_transfer_message_astria( let timeout_height = match timeout_height { // TODO: update astria IbcHeight to support optional? TimeoutHeight::At(height) => { - astria_core::generated::protocol::transactions::v1alpha1::IbcHeight { + astria_core::generated::protocol::transaction::v1::IbcHeight { revision_number: height.revision_number(), revision_height: height.revision_height(), } } TimeoutHeight::Never => { - astria_core::generated::protocol::transactions::v1alpha1::IbcHeight { + astria_core::generated::protocol::transaction::v1::IbcHeight { revision_number: 0, revision_height: u64::MAX, } } }; - let msg = astria_core::generated::protocol::transactions::v1alpha1::Ics20Withdrawal { + let msg = astria_core::generated::protocol::transaction::v1::Ics20Withdrawal { source_channel: src_channel_id.to_string(), - denom: denom, + denom, amount: Some( u128::try_from(amount.0) .expect("amount can fit into u128") @@ -240,6 +240,7 @@ fn build_transfer_message_astria( .to_string(), memo: String::new(), bridge_address: None, + use_compat_address: false, }; Any {