Skip to content

Commit

Permalink
Merge branch 'tiago/main/shim-vext' (#510)
Browse files Browse the repository at this point in the history
* tiago/main/shim-vext:
  wasm: update checksums.json
  Fix websockets and parsing of events returned from Tm
  Updated the lock file and fixed resulting issues. Tendermint currently won't start however
  Change the way we call Tendermint
  Add Cargo.lock changes
  Removed tm events log, put websocket back everywhere in client
  Remaining fixes
  Fix abcipp
  Add missing shell methods
  Fix abciplus
  Add Cargo.lock file diffs
  Find and replace Tendermint imports
  Add ConsensusParams import
  More fixes
  WIP: Shimming main
  Cargo lock nonsense
  Remove unused feature flag from Makefile
  WIP: Shimming main
  Shim queries
  Shim ProcessProposal
  Shim PrepareProposal
  WIP: Shimming main
  Add unit test filter to makefile targets
  WIP: Shimming main
  • Loading branch information
juped committed Oct 17, 2022
2 parents 81f57b9 + 5f54476 commit 4daf63c
Show file tree
Hide file tree
Showing 38 changed files with 1,443 additions and 1,312 deletions.
440 changes: 219 additions & 221 deletions Cargo.lock

Large diffs are not rendered by default.

50 changes: 48 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,26 @@ clippy:
make -C $(wasms_for_tests) clippy && \
$(foreach wasm,$(wasm_templates),$(clippy-wasm) && ) true

clippy-abcipp:
ANOMA_DEV=false $(cargo) +$(nightly) clippy --all-targets \
--manifest-path ./apps/Cargo.toml \
--no-default-features \
--features "std testing abcipp" && \
$(cargo) +$(nightly) clippy --all-targets \
--manifest-path ./proof_of_stake/Cargo.toml \
--features "testing" && \
$(cargo) +$(nightly) clippy --all-targets \
--manifest-path ./shared/Cargo.toml \
--no-default-features \
--features "testing wasm-runtime abcipp ibc-mocks-abcipp" && \
$(cargo) +$(nightly) clippy \
--all-targets \
--manifest-path ./vm_env/Cargo.toml \
--no-default-features \
--features "abcipp" && \
make -C $(wasms) clippy && \
$(foreach wasm,$(wasm_templates),$(clippy-wasm) && ) true

clippy-fix:
$(cargo) +$(nightly) clippy --fix -Z unstable-options --all-targets --allow-dirty --allow-staged

Expand Down Expand Up @@ -81,9 +101,35 @@ test-e2e:
--test-threads=1 \
-Z unstable-options --report-time

test-unit-abcipp:
$(cargo) test \
--manifest-path ./apps/Cargo.toml \
--no-default-features \
--features "testing std abcipp" \
$(TEST_FILTER) -- \
-Z unstable-options --report-time && \
$(cargo) test \
--manifest-path \
./proof_of_stake/Cargo.toml \
--features "testing" \
$(TEST_FILTER) -- \
-Z unstable-options --report-time && \
$(cargo) test \
--manifest-path ./shared/Cargo.toml \
--no-default-features \
--features "testing wasm-runtime abcipp ibc-mocks-abcipp" \
$(TEST_FILTER) -- \
-Z unstable-options --report-time && \
$(cargo) test \
--manifest-path ./vm_env/Cargo.toml \
--no-default-features \
--features "abcipp" \
$(TEST_FILTER) -- \
-Z unstable-options --report-time

test-unit:
$(cargo) test \
-- \
$(TEST_FILTER) -- \
--skip e2e \
-Z unstable-options --report-time

Expand Down Expand Up @@ -172,4 +218,4 @@ test-miri:
MIRIFLAGS="-Zmiri-disable-isolation" $(cargo) +$(nightly) miri test


.PHONY : build check build-release clippy install run-ledger run-gossip reset-ledger test test-debug fmt watch clean build-doc doc build-wasm-scripts-docker debug-wasm-scripts-docker build-wasm-scripts debug-wasm-scripts clean-wasm-scripts dev-deps test-miri
.PHONY : build check build-release clippy install run-ledger run-gossip reset-ledger test test-debug fmt watch clean build-doc doc build-wasm-scripts-docker debug-wasm-scripts-docker build-wasm-scripts debug-wasm-scripts clean-wasm-scripts dev-deps test-miri test-unit test-unit-abcipp clippy-abcipp
38 changes: 30 additions & 8 deletions apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,37 @@ name = "namadaw"
path = "src/bin/anoma-wallet/main.rs"

[features]
default = ["std"]
default = ["std", "abciplus"]
dev = ["namada/dev"]
std = ["ed25519-consensus/std", "rand/std", "rand_core/std"]
# for integration tests and test utilies
testing = ["dev"]

abcipp = [
"tendermint-abcipp",
"tendermint-config-abcipp",
"tendermint-proto-abcipp",
"tendermint-rpc-abcipp",
"tower-abci-abcipp",
"namada/abcipp"
]

abciplus = [
"tendermint",
"tendermint-config",
"tendermint-rpc",
"tendermint-proto",
"tower-abci",
"namada/abciplus"
]

[dependencies]
namada = {path = "../shared", features = ["wasm-runtime", "ferveo-tpke", "rand", "secp256k1-sign-verify"]}
ark-serialize = "0.3.0"
ark-std = "0.3.0"
# branch = "bat/arse-merkle-tree"
arse-merkle-tree = {package = "sparse-merkle-tree", git = "https://github.com/heliaxdev/sparse-merkle-tree", rev = "04ad1eeb28901b57a7599bbe433b3822965dabe8", features = ["std", "borsh"]}
async-std = {version = "1.9.0", features = ["unstable"]}
async-std = {version = "=1.11.0", features = ["unstable"]}
async-trait = "0.1.51"
base64 = "0.13.0"
bech32 = "0.8.0"
Expand All @@ -63,7 +81,6 @@ byteorder = "1.4.2"
clap = {git = "https://github.com/clap-rs/clap/", tag = "v3.0.0-beta.2", default-features = false, features = ["std", "suggestions", "color", "cargo"]}
color-eyre = "0.5.10"
config = "0.11.0"
curl = "0.4.43"
data-encoding = "2.3.2"
derivative = "2.2.0"
ed25519-consensus = "1.2.0"
Expand Down Expand Up @@ -102,18 +119,23 @@ sparse-merkle-tree = {git = "https://github.com/heliaxdev/sparse-merkle-tree", r
sysinfo = {version = "=0.21.1", default-features = false}
tar = "0.4.37"
# temporarily using fork work-around
tendermint = {git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", features = ["secp256k1"]}
tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9"}
tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9"}
tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", features = ["http-client", "websocket-client"]}
tendermint-abcipp = {package = "tendermint", git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", optional = true}
tendermint-config-abcipp = {package = "tendermint-config", git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", optional = true}
tendermint-proto-abcipp = {package = "tendermint-proto", git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", optional = true}
tendermint-rpc-abcipp = {package = "tendermint-rpc", git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", features = ["http-client", "websocket-client"], optional = true}
tendermint = {git = "https://github.com/heliaxdev/tendermint-rs", branch = "bat/abciplus", optional = true}
tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs", branch = "bat/abciplus", optional = true}
tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs", branch = "bat/abciplus", optional = true}
tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs", branch = "bat/abciplus", features = ["http-client", "websocket-client"], optional = true}
thiserror = "1.0.30"
tokio = {version = "1.8.2", features = ["full"]}
toml = "0.5.8"
tonic = "0.6.1"
tower = "0.4"
# Also, using the same version of tendermint-rs as we do here.
# with a patch for https://github.com/penumbra-zone/tower-abci/issues/7.
tower-abci = {git = "https://github.com/heliaxdev/tower-abci", rev = "f6463388fc319b6e210503b43b3aecf6faf6b200"}
tower-abci-abcipp = {package = "tower-abci", git = "https://github.com/heliaxdev/tower-abci", rev = "f6463388fc319b6e210503b43b3aecf6faf6b200", optional = true}
tower-abci = {git = "https://github.com/heliaxdev/tower-abci", branch = "bat/abciplus", optional = true}
tracing = "0.1.30"
tracing-log = "0.1.2"
tracing-subscriber = {version = "0.3.7", features = ["env-filter"]}
Expand Down
4 changes: 2 additions & 2 deletions apps/src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1255,14 +1255,14 @@ pub mod args {
use namada::types::storage::{self, Epoch};
use namada::types::token;
use namada::types::transaction::GasLimit;
use tendermint::Timeout;
use tendermint_config::net::Address as TendermintAddress;

use super::context::{WalletAddress, WalletKeypair, WalletPublicKey};
use super::utils::*;
use super::{ArgGroup, ArgMatches};
use crate::config;
use crate::config::TendermintMode;
use crate::facade::tendermint::Timeout;
use crate::facade::tendermint_config::net::Address as TendermintAddress;

const ADDRESS: Arg<WalletAddress> = arg("address");
const ALIAS_OPT: ArgOpt<String> = ALIAS.opt();
Expand Down
1 change: 0 additions & 1 deletion apps/src/lib/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@ pub mod rpc;
pub mod signing;
pub mod tendermint_rpc_types;
mod tendermint_websocket_client;
mod tm_jsonrpc_client;
pub mod tx;
pub mod utils;
14 changes: 7 additions & 7 deletions apps/src/lib/client/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ use namada::types::key::*;
use namada::types::storage::{Epoch, Key, KeySeg, PrefixValue};
use namada::types::token::{balance_key, Amount};
use namada::types::{address, storage, token};
use tendermint::abci::Code;
use tendermint_config::net::Address as TendermintAddress;
use tendermint_rpc::error::Error as TError;
use tendermint_rpc::query::Query;
use tendermint_rpc::{
Client, HttpClient, Order, SubscriptionClient, WebSocketClient,
};

use crate::cli::{self, args, Context};
use crate::client::tendermint_rpc_types::TxResponse;
use crate::facade::tendermint::abci::Code;
use crate::facade::tendermint_config::net::Address as TendermintAddress;
use crate::facade::tendermint_rpc::error::Error as TError;
use crate::facade::tendermint_rpc::query::Query;
use crate::facade::tendermint_rpc::{
Client, HttpClient, Order, SubscriptionClient, WebSocketClient,
};
use crate::node::ledger::rpc::Path;

/// Query the epoch of the last committed block
Expand Down
2 changes: 1 addition & 1 deletion apps/src/lib/client/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ use namada::types::address::{Address, ImplicitAddress};
use namada::types::key::*;
use namada::types::storage::Epoch;
use namada::types::transaction::{hash_tx, Fee, WrapperTx};
use tendermint_config::net::Address as TendermintAddress;

use super::rpc;
use crate::cli::context::WalletAddress;
use crate::cli::{self, args, Context};
use crate::client::tendermint_rpc_types::TxBroadcastData;
use crate::facade::tendermint_config::net::Address as TendermintAddress;
use crate::wallet::Wallet;

/// Find the public key for the given address and try to load the keypair
Expand Down
Loading

0 comments on commit 4daf63c

Please sign in to comment.