Skip to content

Commit

Permalink
Merge branch 'tomas/rm-abcipp' (#2112)
Browse files Browse the repository at this point in the history
* origin/tomas/rm-abcipp:
  changelog: add #2112
  remove "abcipp" feature
  • Loading branch information
adrianbrink committed Nov 11, 2023
2 parents 7146269 + 08477dd commit a88e22b
Show file tree
Hide file tree
Showing 40 changed files with 184 additions and 2,471 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/2112-rm-abcipp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Removed "abcipp" and "abciplus" features and "abcipp"-only code.
([\#2112](https://github.com/anoma/namada/pull/2112))
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ check-mainnet:
check-crates:
$(foreach p,$(crates), echo "Checking $(p)" && cargo +$(nightly) check -Z unstable-options --tests -p $(p) && ) \
make -C $(wasms_for_tests) check && \
cargo check --package namada --target wasm32-unknown-unknown --no-default-features --features "abciplus,namada-sdk"
cargo check --package namada --target wasm32-unknown-unknown --no-default-features --features "namada-sdk"

clippy-wasm = $(cargo) +$(nightly) clippy --manifest-path $(wasm)/Cargo.toml --all-targets -- -D warnings

Expand Down
8 changes: 2 additions & 6 deletions apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ name = "namadar"
path = "src/bin/namada-relayer/main.rs"

[features]
default = ["std", "abciplus"]
default = ["std"]
mainnet = [
"namada/mainnet",
]
Expand All @@ -59,14 +59,10 @@ std = ["ed25519-consensus/std", "rand/std", "rand_core/std", "namada/std", "nama
testing = ["namada_test_utils"]
benches = ["testing", "namada_test_utils"]
integration = []
abciplus = [
"namada/abciplus",
"namada/tendermint-rpc",
]


[dependencies]
namada = {path = "../shared", features = ["ferveo-tpke", "masp-tx-gen", "multicore", "http-client"]}
namada = {path = "../shared", features = ["ferveo-tpke", "masp-tx-gen", "multicore", "http-client", "tendermint-rpc"]}
namada_sdk = {path = "../sdk", default-features = false, features = ["wasm-runtime", "masp-tx-gen"]}
namada_test_utils = {path = "../test_utils", optional = true}
ark-serialize.workspace = true
Expand Down
17 changes: 2 additions & 15 deletions apps/src/lib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@ pub mod wasm_loader;
pub use std;

pub mod facade {
//! Facade module to reason about `abcipp` feature flag logic.

#[cfg(not(feature = "abcipp"))]
pub use {
namada::tendermint, namada::tendermint_proto, namada::tendermint_rpc,
tendermint_config, tower_abci,
};
#[cfg(feature = "abcipp")]
pub use {
tendermint_abcipp as tendermint,
tendermint_config_abcipp as tendermint_config,
tendermint_proto_abcipp as tendermint_proto,
tendermint_rpc_abcipp as tendermint_rpc,
tower_abci_abcipp as tower_abci,
};
pub use namada::{tendermint, tendermint_proto, tendermint_rpc};
pub use {tendermint_config, tower_abci};
}
51 changes: 0 additions & 51 deletions apps/src/lib/node/ledger/shell/finalize_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,57 +212,6 @@ where
.expect("Missing wrapper tx in queue");
}

#[cfg(not(any(feature = "abciplus", feature = "abcipp")))]
if let TxType::Wrapper(wrapper) = &tx_header.tx_type {
// Charge fee if wrapper transaction went out of gas or
// failed because of fees (also write the wrapper hash to
// storage to prevent replays that would force the fee payer
// to pay more than once)
let error_code =
ErrorCodes::from_u32(processed_tx.result.code).unwrap();
if (error_code == ErrorCodes::TxGasLimit)
| (error_code == ErrorCodes::FeeError)
{
let masp_transaction = wrapper
.unshield_section_hash
.map(|ref hash| {
tx.get_section(hash)
.map(|section| {
if let Section::MaspTx(transaction) =
section.as_ref()
{
Some(transaction.to_owned())
} else {
None
}
})
.flatten()
})
.flatten();
if let Err(msg) = protocol::apply_wrapper_tx(
wrapper,
masp_transaction,
&processed_tx.tx,
ShellParams::new(
&mut TxGasMeter::new_from_sub_limit(
u64::MAX.into(),
),
&mut self.wl_storage,
&mut self.vp_wasm_cache,
&mut self.tx_wasm_cache,
),
Some(&native_block_proposer_address),
) {
self.wl_storage.write_log.drop_tx();
tracing::error!(
"Rejected wrapper tx {} could not pay fee: {}",
hash::Hash::sha256(tx.header_hash()),
msg
)
}
}
}

continue;
}

Expand Down
13 changes: 0 additions & 13 deletions apps/src/lib/node/ledger/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ impl ShellMode {

/// If this node is a validator, broadcast a tx
/// to the mempool using the broadcaster subprocess
#[cfg_attr(feature = "abcipp", allow(dead_code))]
pub fn broadcast(&self, data: Vec<u8>) {
if let Self::Validator {
broadcast_sender, ..
Expand Down Expand Up @@ -1074,7 +1073,6 @@ where
tx_bytes: &[u8],
r#_type: MempoolTxType,
) -> response::CheckTx {
#[cfg(not(feature = "abcipp"))]
use namada::types::transaction::protocol::{
ethereum_tx_data_variants, ProtocolTxType,
};
Expand Down Expand Up @@ -1149,7 +1147,6 @@ where

match tx_type.tx_type {
TxType::Protocol(protocol_tx) => match protocol_tx.tx {
#[cfg(not(feature = "abcipp"))]
ProtocolTxType::EthEventsVext => {
let ext = try_vote_extension!(
"Ethereum events",
Expand All @@ -1171,7 +1168,6 @@ where
response.log = String::from(VALID_MSG);
}
}
#[cfg(not(feature = "abcipp"))]
ProtocolTxType::BridgePoolVext => {
let ext = try_vote_extension!(
"Bridge pool roots",
Expand All @@ -1195,7 +1191,6 @@ where
response.log = String::from(VALID_MSG);
}
}
#[cfg(not(feature = "abcipp"))]
ProtocolTxType::ValSetUpdateVext => {
let ext = try_vote_extension!(
"validator set update",
Expand Down Expand Up @@ -1884,14 +1879,6 @@ mod test_utils {
}
}

/// Get the only validator's voting power.
#[inline]
#[cfg(not(feature = "abcipp"))]
#[allow(dead_code)]
pub fn get_validator_bonded_stake() -> namada::types::token::Amount {
200_000_000_000.into()
}

/// Config parameters to set up a test shell.
pub struct SetupCfg<H> {
/// The last comitted block height.
Expand Down
Loading

0 comments on commit a88e22b

Please sign in to comment.