Skip to content

Commit

Permalink
Merge pull request #3968 from nymtech/chore/nyxd-042-upgrade
Browse files Browse the repository at this point in the history
Chore/nyxd 043 upgrade
  • Loading branch information
jstuczyn authored Nov 22, 2023
2 parents af32fe4 + acc6225 commit acf149e
Show file tree
Hide file tree
Showing 15 changed files with 210 additions and 230 deletions.
201 changes: 95 additions & 106 deletions Cargo.lock

Large diffs are not rendered by default.

38 changes: 22 additions & 16 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,6 @@ bip39 = { version = "2.0.0", features = ["zeroize"] }
boringtun = { git = "https://github.com/cloudflare/boringtun", rev = "e1d6360d6ab4529fc942a078e4c54df107abe2ba" }
clap = "4.4.7"
cfg-if = "1.0.0"
cosmwasm-derive = "=1.3.0"
cosmwasm-schema = "=1.3.0"
cosmwasm-std = "=1.3.0"
# use 0.5.0 as that's the version used by cosmwasm-std 1.3.0
# (and ideally we don't want to pull the same dependency twice)
serde-json-wasm = "=0.5.0"
cosmwasm-storage = "=1.3.0"
cosmrs = "=0.14.0"
# same version as used by cosmrs
cw-utils = "=1.0.1"
cw-storage-plus = "=1.1.0"
cw2 = { version = "=1.1.0" }
cw3 = { version = "=1.1.0" }
cw4 = { version = "=1.1.0" }
cw-controllers = { version = "=1.1.0" }
dashmap = "5.5.3"
dotenvy = "0.15.6"
futures = "0.3.28"
Expand All @@ -172,7 +157,6 @@ schemars = "0.8.1"
serde = "1.0.152"
serde_json = "1.0.91"
tap = "1.0.1"
tendermint-rpc = "0.32" # same version as used by cosmrs
thiserror = "1.0.48"
tokio = "1.24.1"
tokio-tungstenite = "0.20.1"
Expand All @@ -184,6 +168,28 @@ utoipa-swagger-ui = "3.1.5"
url = "2.4"
zeroize = "1.6.0"

# cosmwasm-related
cosmwasm-derive = "=1.3.0"
cosmwasm-schema = "=1.3.0"
cosmwasm-std = "=1.3.0"
# use 0.5.0 as that's the version used by cosmwasm-std 1.3.0
# (and ideally we don't want to pull the same dependency twice)
serde-json-wasm = "=0.5.0"
cosmwasm-storage = "=1.3.0"
# same version as used by cosmwasm
cw-utils = "=1.0.1"
cw-storage-plus = "=1.1.0"
cw2 = { version = "=1.1.0" }
cw3 = { version = "=1.1.0" }
cw4 = { version = "=1.1.0" }
cw-controllers = { version = "=1.1.0" }

# cosmrs-related
bip32 = "0.5.1"
cosmrs = "=0.15.0"
tendermint-rpc = "0.34" # same version as used by cosmrs
prost = "0.12"

# wasm-related dependencies
gloo-utils = "0.1.7"
js-sys = "0.3.63"
Expand Down
6 changes: 5 additions & 1 deletion common/client-libs/validator-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,17 @@ cosmrs = { workspace = true, features = ["bip32", "cosmwasm"] }
# import it just for the `Client` trait
tendermint-rpc = { workspace = true }

# this is an extremely nasty import. we're explicitly bringing in bip32 so that via the magic (or curse, pick your poison)
# of cargo's feature unification we'd get `bip32/std` meaning we'd get `std::error::Error` for the re-exported (via cosmrs) bip32::Error type
bip32 = { workspace = true, default-features = false, features = ["std"] }

eyre = { version = "0.6" }
cw-utils = { workspace = true }
cw2 = { workspace = true }
cw3 = { workspace = true }
cw4 = { workspace = true }
cw-controllers = { workspace = true }
prost = { version = "0.11", default-features = false }
prost = { workspace = true, default-features = false }
flate2 = { version = "1.0.20" }
sha2 = { version = "0.9.5" }
itertools = { version = "0.10" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ impl CheckResponse for broadcast::tx_commit::Response {
});
}

if self.deliver_tx.code.is_err() {
if self.tx_result.code.is_err() {
return Err(NyxdError::BroadcastTxErrorDeliverTx {
hash: self.hash,
height: Some(self.height),
code: self.deliver_tx.code.value(),
raw_log: self.deliver_tx.log,
code: self.tx_result.code.value(),
raw_log: self.tx_result.log,
});
}

Expand Down
2 changes: 1 addition & 1 deletion common/client-libs/validator-client/src/nyxd/fee/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub mod gas_price;

pub type GasAdjustment = f32;

pub const DEFAULT_SIMULATED_GAS_MULTIPLIER: GasAdjustment = 1.3;
pub const DEFAULT_SIMULATED_GAS_MULTIPLIER: GasAdjustment = 1.5;

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AutoFeeGrant {
Expand Down
4 changes: 3 additions & 1 deletion common/client-libs/validator-client/src/nyxd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ pub use crate::nyxd::fee::Fee;
pub use crate::rpc::TendermintRpcClient;
pub use coin::Coin;
pub use cosmrs::bank::MsgSend;
pub use cosmrs::tendermint::abci::{response::DeliverTx, Event, EventAttribute};
pub use cosmrs::tendermint::abci::{
response::DeliverTx, types::ExecTxResult, Event, EventAttribute,
};
pub use cosmrs::tendermint::block::Height;
pub use cosmrs::tendermint::hash::{self, Algorithm, Hash};
pub use cosmrs::tendermint::validator::Info as TendermintValidatorInfo;
Expand Down
2 changes: 1 addition & 1 deletion common/client-libs/validator-client/src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ where
U: TryInto<HttpClientUrl, Error = Error>,
{
HttpRpcClient::builder(url.try_into()?)
.compat_mode(CompatMode::V0_34)
.compat_mode(CompatMode::V0_37)
.build()
}

Expand Down
3 changes: 2 additions & 1 deletion common/client-libs/validator-client/src/rpc/reqwest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ pub struct ReqwestRpcClient {
impl ReqwestRpcClient {
pub fn new(url: Url) -> Self {
ReqwestRpcClient {
compat: CompatMode::V0_34,
// after updating to nyxd 0.42 and thus updating to cometbft, the compat mode changed
compat: CompatMode::V0_37,
inner: reqwest::Client::new(),
url,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cargo new nym-cosmos-service
```
[dependencies]
clap = { version = "4.0", features = ["derive"] }
cosmrs = "=0.14.0"
cosmrs = "=0.15.0"
tokio = { version = "1.24.1", features = ["rt-multi-thread", "macros"] }
serde = "1.0.152"
serde_json = "1.0.91"
Expand Down
4 changes: 3 additions & 1 deletion ephemera/src/block/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,9 @@ mod test {
}

#[tokio::test]
#[should_panic]
#[should_panic(
expected = "Received committed block which isn't last produced block, this is a bug!"
)]
async fn test_on_committed_with_invalid_pending_block() {
let (mut manager, _) = block_manager_with_defaults();

Expand Down
4 changes: 2 additions & 2 deletions nym-api/src/coconut/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ use nym_validator_client::nym_api::routes::{
};
use nym_validator_client::nyxd::Coin;
use nym_validator_client::nyxd::{
AccountId, Algorithm, DeliverTx, Event, EventAttribute, Fee, Hash, TxResponse,
AccountId, Algorithm, Event, EventAttribute, ExecTxResult, Fee, Hash, TxResponse,
};

use crate::coconut::State;
Expand Down Expand Up @@ -490,7 +490,7 @@ pub fn tx_entry_fixture(tx_hash: &str) -> TxResponse {
hash: Hash::from_str(tx_hash).unwrap(),
height: Default::default(),
index: 0,
tx_result: DeliverTx {
tx_result: ExecTxResult {
code: Default::default(),
data: Default::default(),
log: Default::default(),
Expand Down
Loading

0 comments on commit acf149e

Please sign in to comment.