Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ jobs:
fail-fast: false
matrix:
chain:
- package: gaia20
- package: gaia23
command: gaiad
account_prefix: cosmos
native_token: stake
features: forward-packet,clean-workers,ica,ics29-fee
features: forward-packet,clean-workers,ica,no-denom-trace
- package: ibc-go-v6-simapp
command: simd
account_prefix: cosmos
Expand Down Expand Up @@ -186,10 +186,10 @@ jobs:
fail-fast: false
matrix:
chain:
- package: .#gaia20 .#stride
- package: .#gaia23 .#stride
command: gaiad,strided
account_prefix: cosmos,stride
- package: .#gaia20 .#neutron
- package: .#gaia23 .#neutron
command: gaiad,neutrond
account_prefix: cosmos,neutron
steps:
Expand All @@ -214,7 +214,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: -p ibc-integration-test --features interchain-security,ica --no-fail-fast --no-run
args: -p ibc-integration-test --features interchain-security,ica,no-denom-trace --no-fail-fast --no-run
- name: Install cargo-nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- env:
Expand All @@ -227,7 +227,7 @@ jobs:
run: |
nix shell ${{ matrix.chain.package }} -c \
cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \
--features interchain-security,ica interchain_security::
--features interchain-security,ica,no-denom-trace interchain_security::

interchain-security-icq:
if: false # Disable CCQ test
Expand All @@ -236,7 +236,7 @@ jobs:
fail-fast: false
matrix:
chain:
- package: .#gaia20 .#stride-no-admin
- package: .#gaia23 .#stride-no-admin
command: gaiad,strided
account_prefix: cosmos,stride
steps:
Expand All @@ -261,7 +261,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: -p ibc-integration-test --features interchain-security --no-fail-fast --no-run
args: -p ibc-integration-test --features interchain-security,ics31,no-denom-trace --no-fail-fast --no-run
- name: Install cargo-nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- env:
Expand All @@ -273,15 +273,15 @@ jobs:
run: |
nix shell ${{ matrix.chain.package }} -c \
cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \
--features interchain-security,ics31 interchain_security::
--features interchain-security,ics31,no-denom-trace interchain_security::

celestia-to-gaia:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
chain:
- package: .#celestia .#gaia20
- package: .#celestia .#gaia23
command: celestia-appd,gaiad
account_prefix: celestia,cosmos
native_token: utia,stake
Expand All @@ -307,7 +307,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: -p ibc-integration-test --features celestia --no-fail-fast --no-run
args: -p ibc-integration-test --features celestia,no-denom-trace --no-fail-fast --no-run
- name: Install cargo-nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- env:
Expand All @@ -321,7 +321,7 @@ jobs:
run: |
nix shell .#python ${{ matrix.chain.package }} -c \
cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \
--features celestia
--features celestia,no-denom-trace

# Run the transfer test using IPv6 for gRPC endpoint
ipv6-grpc-endpoint:
Expand All @@ -330,7 +330,7 @@ jobs:
fail-fast: false
matrix:
chain:
- package: .#gaia20
- package: .#gaia23
command: gaiad
account_prefix: cosmos
steps:
Expand All @@ -355,7 +355,7 @@ jobs:
- uses: actions-rs/cargo@v1
with:
command: test
args: -p ibc-integration-test --no-fail-fast --no-run
args: -p ibc-integration-test --features no-denom-trace --no-fail-fast --no-run
- name: Install cargo-nextest
run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin
- env:
Expand All @@ -368,4 +368,4 @@ jobs:
run: |
nix shell ${{ matrix.chain.package }} -c \
cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \
tests::transfer::test_ibc_transfer
--features no-denom-trace tests::transfer::test_ibc_transfer
2 changes: 1 addition & 1 deletion .github/workflows/misbehaviour.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
fail-fast: false
matrix:
chain:
- package: gaia20
- package: gaia23
command: gaiad
account_prefix: cosmos
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/multi-chains.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
fail-fast: false
matrix:
first-package:
- package: gaia20
- package: gaia23
command: gaiad
account_prefix: cosmos
- package: ibc-go-v7-simapp
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/namada.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
fail-fast: false
matrix:
chain:
- package: .#gaia20
- package: .#gaia23
command: gaiad,namada
account_prefix: cosmos,''
native_token: stake,nam
Expand Down
5 changes: 3 additions & 2 deletions crates/relayer/src/foreign_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1659,13 +1659,14 @@ impl<DstChain: ChainHandle, SrcChain: ChainHandle> ForeignClient<DstChain, SrcCh

// No header in events, cannot run misbehavior.
// May happen on chains running older SDKs (e.g., Akash)
if update_event.header.is_none() {
// TODO: Remove or uncomment once misbehaviour detection is fixed
/*if update_event.header.is_none() {
return Err(ForeignClientError::misbehaviour_exit(format!(
"could not extract header from update client event {:?} emitted by chain {}",
update_event,
self.dst_chain.id()
)));
}
}*/

// Check for misbehaviour according to the specific source chain type.
// In case of Tendermint client, this will also check the BFT time violation if
Expand Down
22 changes: 22 additions & 0 deletions crates/relayer/src/light_client/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ impl AnyIo {
AnyIo::RestartAware(io) => io.fetch_validator_set(height, proposer_address),
}
}

pub fn fetch_signed_header(
&self,
height: AtHeight,
) -> Result<tendermint::block::signed_header::SignedHeader, IoError> {
match self {
AnyIo::Prod(io) => io.fetch_signed_header(height),
AnyIo::RestartAware(io) => io.fetch_signed_header(height),
}
}
}

impl Io for AnyIo {
Expand Down Expand Up @@ -71,6 +81,18 @@ impl RestartAwareIo {

io.fetch_validator_set(height, proposer_address)
}

pub fn fetch_signed_header(
&self,
height: AtHeight,
) -> Result<tendermint::block::signed_header::SignedHeader, IoError> {
let io = match height {
AtHeight::At(height) if height <= self.restart_height => &self.archive_io,
_ => &self.live_io,
};

io.fetch_signed_header(height)
}
}

impl Io for RestartAwareIo {
Expand Down
65 changes: 59 additions & 6 deletions crates/relayer/src/light_client/tendermint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ mod detector;
use std::time::Duration;

use itertools::Itertools;
use tendermint::Time;
use tendermint::{validator, Time};
use tracing::{debug, error, trace, warn};

use tendermint_light_client::{
Expand All @@ -18,7 +18,7 @@ use tendermint_light_client::{
verifier::ProdVerifier,
};
use tendermint_light_client_detector::Divergence;
use tendermint_rpc as rpc;
use tendermint_rpc::{self as rpc, Client, Paging};

use ibc_relayer_types::clients::ics07_tendermint::header::Header as TmHeader;
use ibc_relayer_types::clients::ics07_tendermint::misbehaviour::Misbehaviour as TmMisbehaviour;
Expand All @@ -28,11 +28,14 @@ use ibc_relayer_types::core::ics24_host::identifier::ChainId;
use ibc_relayer_types::Height as ICSHeight;

use crate::{
chain::cosmos::{config::CosmosSdkConfig, CosmosSdkChain},
chain::penumbra::config::PenumbraConfig,
chain::{
cosmos::{config::CosmosSdkConfig, CosmosSdkChain},
penumbra::config::PenumbraConfig,
},
client_state::AnyClientState,
error::Error,
misbehaviour::{AnyMisbehaviour, MisbehaviourEvidence},
util::block_on,
HERMES_VERSION,
};

Expand Down Expand Up @@ -147,12 +150,62 @@ impl super::LightClient<CosmosSdkChain> for LightClient {
}
);

let any_header = update.header.as_ref().ok_or_else(|| {
let any_header = match update.header.as_ref() {
Some(header) => header.clone(),
None => {
let rpc_client = self.io.rpc_client();

let height = update.consensus_height();

// Doesn't work
let signed_header = self
.io
.fetch_signed_header(AtHeight::At(height.into()))
.unwrap();

// Doesn't work either
/*let signed_header = block_on(rpc_client.commit(update.consensus_height()))
.unwrap()
.signed_header;*/

let validators = block_on(rpc_client.validators(height, Paging::All))
.unwrap()
.validators;

let validator_set = validator::Set::with_proposer(
validators,
signed_header.header.proposer_address,
)
.unwrap();

let trusted_header = block_on(rpc_client.commit(height)).unwrap().signed_header;

let trusted_validators = block_on(rpc_client.validators(height, Paging::All))
.unwrap()
.validators;

let trusted_validator_set = validator::Set::with_proposer(
trusted_validators,
trusted_header.header.proposer_address,
)
.unwrap();

let tm_header = TmHeader {
signed_header,
validator_set,
trusted_height: height,
trusted_validator_set,
};
tm_header.into()
}
};

/*let any_header = update.header.as_ref().ok_or_else(|| {
Error::misbehaviour(format!(
"missing header in update client event {}",
self.chain_id
))
})?;
})?;*/

let update_header = match any_header {
AnyHeader::Tendermint(header) => Ok::<_, Error>(header),
Expand Down
50 changes: 43 additions & 7 deletions flake.lock

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

Loading