Skip to content

Commit

Permalink
use new unbonding_delay parameter to compute trusting period
Browse files Browse the repository at this point in the history
  • Loading branch information
avahowell committed Mar 19, 2024
1 parent 64ef929 commit 48cdce0
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions crates/relayer/src/chain/penumbra/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,25 +522,17 @@ impl ChainEndpoint for PenumbraChain {
.map_err(|e| Error::grpc_status(e, "app_parameters query".to_owned()))?
.into_inner();

let epoch_duration = app_parameters
.clone()
.app_parameters
.expect("should have app parameters")
.sct_params
.expect("should have sct parameters")
.epoch_duration;

let unbonding_epochs = app_parameters
let epoch_delay_blocks = app_parameters
.app_parameters
.expect("should have app parameters")

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

no field `unbonding_delay` on type `penumbra_proto::core::component::stake::v1::StakeParameters`

error[E0609]: no field `unbonding_delay` on type `penumbra_proto::core::component::stake::v1::StakeParameters` --> crates/relayer/src/chain/penumbra/chain.rs:527:14 | 527 | .unbonding_delay; | ^^^^^^^^^^^^^^^ unknown field | = note: available fields are: `unbonding_epochs`, `active_validator_limit`, `base_reward_rate`, `slashing_penalty_misbehavior`, `slashing_penalty_downtime` ... and 3 others

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-no-default-features

no field `unbonding_delay` on type `penumbra_proto::core::component::stake::v1::StakeParameters`

error[E0609]: no field `unbonding_delay` on type `penumbra_proto::core::component::stake::v1::StakeParameters` --> crates/relayer/src/chain/penumbra/chain.rs:527:14 | 527 | .unbonding_delay; | ^^^^^^^^^^^^^^^ unknown field | = note: available fields are: `unbonding_epochs`, `active_validator_limit`, `base_reward_rate`, `slashing_penalty_misbehavior`, `slashing_penalty_downtime` ... and 3 others

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

no field `unbonding_delay` on type `penumbra_proto::core::component::stake::v1::StakeParameters`

error[E0609]: no field `unbonding_delay` on type `penumbra_proto::core::component::stake::v1::StakeParameters` --> crates/relayer/src/chain/penumbra/chain.rs:527:14 | 527 | .unbonding_delay; | ^^^^^^^^^^^^^^^ unknown field | = note: available fields are: `unbonding_epochs`, `active_validator_limit`, `base_reward_rate`, `slashing_penalty_misbehavior`, `slashing_penalty_downtime` ... and 3 others

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / clippy-all-features

no field `unbonding_delay` on type `penumbra_proto::core::component::stake::v1::StakeParameters`

error[E0609]: no field `unbonding_delay` on type `penumbra_proto::core::component::stake::v1::StakeParameters` --> crates/relayer/src/chain/penumbra/chain.rs:527:14 | 527 | .unbonding_delay; | ^^^^^^^^^^^^^^^ unknown field | = note: available fields are: `unbonding_epochs`, `active_validator_limit`, `base_reward_rate`, `slashing_penalty_misbehavior`, `slashing_penalty_downtime` ... and 3 others

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / test-stable

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (osmosis, osmosisd, osmo, stake, dynamic-gas-fee)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack-freeze (interchain-security, cosmos)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-double-sign (interchain-security, cosmos)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia14 .#stride-consumer, gaiad,strided, cosmos,stride)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / light-client-attack (gaia14, gaiad, cosmos)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia14 .#neutron, gaiad,neutrond, cosmos,neutron)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia13 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ics-light-client-attack (interchain-security, cosmos)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia14, gaiad, cosmos, stake, forward-packet,clean-workers)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-icq (.#gaia14 .#stride-consumer-no-admin, gaiad,strided, cosmos,stride)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (wasmd, wasmd, wasm, stake)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (migaloo, migalood, migaloo, stake)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / model-based-test (gaia6)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-no-ica (.#gaia13 .#neutron, gaiad,neutrond, cosmos,neutron)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v8-simapp, simd, cosmos, stake, ica,ics29-fee)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v7-simapp, simd, cosmos, stake, ica,ics29-fee)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (juno, junod, juno, stake, juno,forward-packet)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (gaia13, gaiad, cosmos, stake, forward-packet,clean-workers)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia13, celestia-appd,gaiad, celestia,cosmos, utia,stake)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / celestia-to-gaia (.#celestia .#gaia14, celestia-appd,gaiad, celestia,cosmos, utia,stake)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / ordered-channel-test

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (ibc-go-v6-simapp, simd, cosmos, stake, ica,ics29-fee)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / integration-test (provenance, provenanced, pb, nhash, fee-grant,async-icq)

no field `unbonding_delay` on type `StakeParameters`

Check failure on line 527 in crates/relayer/src/chain/penumbra/chain.rs

View workflow job for this annotation

GitHub Actions / interchain-security-ica (.#gaia13 .#stride-consumer, gaiad,strided, cosmos,stride)

no field `unbonding_delay` on type `StakeParameters`
.stake_params
.expect("should have stake parameters")
.unbonding_epochs;
.unbonding_delay;

// here we assume roughly 5s block time, which is not part of consensus but should be
// roughly correct. it would really be better if the ibc protocol gave the client's
// trusting period in terms of blocks instead of duration.
let unbonding_period = Duration::from_secs(epoch_duration * unbonding_epochs * 5);
let unbonding_period = Duration::from_secs(epoch_delay_blocks * 5);

tracing::info!("starting view service sync");

Expand Down

0 comments on commit 48cdce0

Please sign in to comment.