Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
Update namada 0.28 (#63)
Browse files Browse the repository at this point in the history
This updates namada to v0.28 and its dependencies.

---------

Co-authored-by: Gianmarco Fraccaroli <>
Co-authored-by: rllola <[email protected]>
  • Loading branch information
neithanmo and rllola authored Dec 19, 2023
1 parent c8a46fa commit d716ecf
Show file tree
Hide file tree
Showing 8 changed files with 1,778 additions and 1,650 deletions.
3,281 changes: 1,697 additions & 1,584 deletions Cargo.lock

Large diffs are not rendered by default.

57 changes: 34 additions & 23 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,47 +15,58 @@ path = "src/bin/indexer.rs"
[dependencies]
getrandom = { version = "0.2" }
async-trait = "0.1.51"
namada = { git = "https://github.com/anoma/namada", tag="v0.23.0", default-features = false, features = ["abciplus", "namada-sdk", "http-client"] }
rand = {version = "0.8", default-features = false}
rand_core = {version = "0.6", default-features = false}
tokio = {version = "1.26.0", features = ["rt-multi-thread"]}
namada_sdk = { git = "https://github.com/anoma/namada", rev = "v0.28.1" }
rand = { version = "0.8", default-features = false }
rand_core = { version = "0.6", default-features = false }
tokio = { version = "1.26.0", features = ["rt-multi-thread"] }
hex = { version = "0.4", features = ["serde"] }
futures-util = { version = "0.3", features = ["sink"] }
bytes = "1.0"
time = "0.3"
tracing-subscriber = { version = "0.3.17", features = ["fmt", "std", "env-filter"] }
tracing-subscriber = { version = "0.3.17", features = [
"fmt",
"std",
"env-filter",
] }
tracing = { version = "0.1.37", features = ["attributes"] }
serde = { version = "1.0", features = ["derive"] }
config = { version = "0.13.3", features = ["toml", "serde_json"], default-features = false }
config = { version = "0.13.3", features = [
"toml",
"serde_json",
], default-features = false }
axum = { version = "0.6.18", features = ["tracing", "tokio", "json", "query"] }
serde_derive = "1.0.164"
thiserror = "1.0.40"
serde_json = "1.0.97"
borsh = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
sqlx = { version = "0.6.3", features = ["runtime-tokio-rustls", "postgres", "macros", "json", "offline", "migrate"] }
prost = "0.11.6"
prost-types = "0.11.6"
sqlx = { version = "0.6.3", features = [
"runtime-tokio-rustls",
"postgres",
"macros",
"json",
"offline",
"migrate",
] }
prost = "0.12.0"
prost-types = "0.12.0"
futures = "0.3.28"
opentelemetry = "0.20.0"
tracing-opentelemetry = "0.20.0"
opentelemetry-jaeger = "0.19.0"
opentelemetry_api = { version = "0.20.0", features = ["metrics"] }
axum-prometheus = { version = "0.4.0", optional = true}
axum-prometheus = { version = "0.4.0", optional = true }
metrics = "0.21.1"
metrics-exporter-prometheus = {version = "0.12.1", optional = true}
# temp - Tendermint fork of Helixdev doesn't include a fix for evidence json encoding
tendermint = "0.33.0"
tendermint-rpc = { version = "0.33.0", features = ["http-client"], default-features = false}
tendermint-proto = "0.33.0"

[patch.crates-io]
borsh = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
borsh-derive = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
borsh-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
borsh-schema-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"}
metrics-exporter-prometheus = { version = "0.12.1", optional = true }
tendermint = "0.34.0"
tendermint-config = "0.34.0"
tendermint-rpc = { version = "0.34.0", features = ["http-client"] }
tendermint-proto = "0.34.0"

[dev-dependencies]
criterion = { version = "0.5.1", features = ["html_reports", "tokio", "async_futures"] }
criterion = { version = "0.5.1", features = [
"html_reports",
"tokio",
"async_futures",
] }
httpc-test = "0.1.4"


Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh

NAMADA_VERSION := 0.23.0
NAMADA_VERSION := 0.28.1
BASE_URL := https://raw.githubusercontent.com/anoma/namada
URL := $(BASE_URL)/v$(NAMADA_VERSION)/wasm/checksums.json

Expand Down
5 changes: 2 additions & 3 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ ignore = [
"RUSTSEC-2021-0076",
# No safe update at the moment, we can keep an eye on them to
# enable this checks, once they are solved by upstream dependencies.
"RUSTSEC-2023-0033",
# "RUSTSEC-2023-0033",
"RUSTSEC-2021-0041",
"RUSTSEC-2023-0052"
# "RUSTSEC-2023-0052"
]

36 changes: 19 additions & 17 deletions src/database.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
use crate::{config::DatabaseConfig, error::Error, utils};

use borsh::de::BorshDeserialize;

use namada::proto;
use namada::types::transaction::governance::VoteProposalData;
use namada::types::{
address::Address,
eth_bridge_pool::PendingTransfer,
key::common::PublicKey,
token,
transaction::{
self,
account::{InitAccount, UpdateAccount},
pgf::UpdateStewardCommission,
TxType,
use namada_sdk::core::types::key::common::PublicKey;
use namada_sdk::{
borsh::BorshDeserialize,
core::types::{
address::Address,
eth_bridge_pool::PendingTransfer,
// key::PublicKey,
token,
transaction::{
account::{InitAccount, UpdateAccount},
governance::VoteProposalData,
pgf::UpdateStewardCommission,
pos::{Bond, Unbond},
TxType,
},
},
proto,
tendermint_proto::types::EvidenceList as RawEvidenceList,
};
use sqlx::postgres::{PgPool, PgPoolOptions, PgRow as Row};
use sqlx::Row as TRow;
Expand All @@ -25,7 +28,6 @@ use std::time::Duration;
use tendermint::block::Block;
use tendermint_proto::types::evidence::Sum;
use tendermint_proto::types::CommitSig;
use tendermint_proto::types::EvidenceList as RawEvidenceList;
use tendermint_rpc::endpoint::block_results;
use tracing::{info, instrument, trace};

Expand Down Expand Up @@ -704,7 +706,7 @@ impl Database {
query.execute(&mut *sqlx_tx).await?;
}
"tx_bond" => {
let bond = transaction::pos::Bond::try_from_slice(&data[..])?;
let bond = Bond::try_from_slice(&data[..])?;

let mut query_builder: QueryBuilder<_> = QueryBuilder::new(format!(
"INSERT INTO {}.tx_bond(
Expand All @@ -729,7 +731,7 @@ impl Database {
query.execute(&mut *sqlx_tx).await?;
}
"tx_unbond" => {
let unbond = transaction::pos::Unbond::try_from_slice(&data[..])?;
let unbond = Unbond::try_from_slice(&data[..])?;

let mut query_builder: QueryBuilder<_> = QueryBuilder::new(format!(
"INSERT INTO {}.tx_bond(
Expand Down
6 changes: 2 additions & 4 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ use tokio::task::JoinError;

use config::ConfigError;
use opentelemetry_api::metrics::MetricsError;
use tendermint::error::Error as TError;
use tendermint::Error as TError;
use tendermint_rpc::endpoint::block_results;
use tendermint_rpc::Error as TRpcError;
use tokio::sync::mpsc::error::SendError;
// use tendermint_config::Error as TCError;
// use tokio_postgres::error::Error as DbError;
use tendermint_rpc::endpoint::block_results;

#[derive(Debug, ThisError)]
pub enum Error {
Expand Down
39 changes: 22 additions & 17 deletions src/server/tx.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
use crate::error::Error;
use borsh::BorshDeserialize;
use namada::types::address::Address;
use namada::types::key::common::PublicKey;
use namada::types::{
token,
transaction::{
account::{InitAccount, UpdateAccount},
governance::VoteProposalData,
pgf::UpdateStewardCommission,
pos::{Bond, InitValidator, Unbond, Withdraw},
use namada_sdk::core::types::key::common::PublicKey;
use namada_sdk::core::types::transaction::pos::BecomeValidator;
use namada_sdk::ibc::apps::transfer::types::msgs::transfer::MsgTransfer;
use namada_sdk::{
borsh::BorshDeserialize,
core::types::{
address::Address,
eth_bridge_pool::PendingTransfer,
transaction::{
governance::VoteProposalData,
pgf::UpdateStewardCommission,
pos::{Bond, Unbond, Withdraw},
},
},
core::types::{
token,
transaction::account::{InitAccount, UpdateAccount},
},
};

use namada_sdk::core::ibc::primitives::proto::Any;
use prost::Message;

use serde::{Deserialize, Serialize};
use std::collections::HashMap;

use super::utils::serialize_optional_hex;
use namada::ibc_proto::google::protobuf::Any;
use namada::types::eth_bridge_pool::PendingTransfer;

use namada::ibc::applications::transfer::msgs::transfer::MsgTransfer;

use sqlx::postgres::PgRow as Row;
use sqlx::Row as TRow;
Expand All @@ -40,7 +45,7 @@ pub enum TxDecoded {
Bond(Bond),
RevealPK(PublicKey),
VoteProposal(VoteProposalData),
InitValidator(Box<InitValidator>),
BecomeValidator(Box<BecomeValidator>),
Unbond(Unbond),
Withdraw(Withdraw),
InitAccount(InitAccount),
Expand Down Expand Up @@ -130,8 +135,8 @@ impl TxInfo {
"tx_vote_proposal" => {
VoteProposalData::try_from_slice(&self.data()).map(TxDecoded::VoteProposal)?
}
"tx_init_validator" => InitValidator::try_from_slice(&self.data())
.map(|t| TxDecoded::InitValidator(Box::new(t)))?,
"tx_init_validator" => BecomeValidator::try_from_slice(&self.data())
.map(|t| TxDecoded::BecomeValidator(Box::new(t)))?,
"tx_unbond" => Unbond::try_from_slice(&self.data()).map(TxDecoded::Unbond)?,
"tx_withdraw" => Withdraw::try_from_slice(&self.data()).map(TxDecoded::Withdraw)?,
"tx_init_account" => {
Expand Down
2 changes: 1 addition & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use namada::types::transaction::TxType;
use namada_sdk::core::types::transaction::TxType;
use std::collections::HashMap;
use std::fs;

Expand Down

0 comments on commit d716ecf

Please sign in to comment.