diff --git a/.changelog/unreleased/improvements/2946-remove-epoch-from-wrappertx.md b/.changelog/unreleased/improvements/2946-remove-epoch-from-wrappertx.md new file mode 100644 index 00000000000..a5dcc31e359 --- /dev/null +++ b/.changelog/unreleased/improvements/2946-remove-epoch-from-wrappertx.md @@ -0,0 +1,2 @@ +- Remove the epoch field from the wrapper tx. + ([\#2946](https://github.com/anoma/namada/pull/2946)) \ No newline at end of file diff --git a/crates/apps/src/lib/bench_utils.rs b/crates/apps/src/lib/bench_utils.rs index a4c2a5b72f7..14fba66b288 100644 --- a/crates/apps/src/lib/bench_utils.rs +++ b/crates/apps/src/lib/bench_utils.rs @@ -592,7 +592,6 @@ impl BenchShell { token: self.state.in_mem().native_token.clone(), }, defaults::albert_keypair().ref_to(), - self.state.in_mem().last_epoch, 0.into(), None, ); diff --git a/crates/apps/src/lib/config/genesis/transactions.rs b/crates/apps/src/lib/config/genesis/transactions.rs index 107b5148fab..f2e9431d20d 100644 --- a/crates/apps/src/lib/config/genesis/transactions.rs +++ b/crates/apps/src/lib/config/genesis/transactions.rs @@ -130,7 +130,6 @@ fn get_tx_to_sign(tag: impl AsRef, data: impl BorshSerialize) -> Tx { token: genesis_fee_token_address(), }, fee_payer, - Default::default(), 0.into(), None, ); diff --git a/crates/apps/src/lib/node/ledger/shell/finalize_block.rs b/crates/apps/src/lib/node/ledger/shell/finalize_block.rs index 0e9e8ec08b2..15bae51df1c 100644 --- a/crates/apps/src/lib/node/ledger/shell/finalize_block.rs +++ b/crates/apps/src/lib/node/ledger/shell/finalize_block.rs @@ -810,7 +810,6 @@ mod test_finalize_block { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), WRAPPER_GAS_LIMIT.into(), None, )))); @@ -2546,7 +2545,6 @@ mod test_finalize_block { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), WRAPPER_GAS_LIMIT.into(), None, )))); @@ -2561,7 +2559,6 @@ mod test_finalize_block { token: shell.state.in_mem().native_token.clone(), }, keypair_2.ref_to(), - Epoch(0), WRAPPER_GAS_LIMIT.into(), None, )))); @@ -2763,7 +2760,6 @@ mod test_finalize_block { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, )))); @@ -2795,7 +2791,6 @@ mod test_finalize_block { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), WRAPPER_GAS_LIMIT.into(), None, )))); @@ -2969,7 +2964,6 @@ mod test_finalize_block { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, )))); @@ -3045,7 +3039,6 @@ mod test_finalize_block { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), WRAPPER_GAS_LIMIT.into(), None, )))); @@ -3137,7 +3130,6 @@ mod test_finalize_block { token: native_token.clone(), }, keypair.ref_to(), - Epoch(0), WRAPPER_GAS_LIMIT.into(), None, )))); @@ -3228,7 +3220,6 @@ mod test_finalize_block { token: shell.state.in_mem().native_token.clone(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), 5_000_000.into(), None, )))); diff --git a/crates/apps/src/lib/node/ledger/shell/mod.rs b/crates/apps/src/lib/node/ledger/shell/mod.rs index b46a1ffe712..f7554a6ceab 100644 --- a/crates/apps/src/lib/node/ledger/shell/mod.rs +++ b/crates/apps/src/lib/node/ledger/shell/mod.rs @@ -2306,7 +2306,6 @@ mod shell_tests { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, )))); @@ -2345,7 +2344,6 @@ mod shell_tests { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, )))); @@ -2419,7 +2417,6 @@ mod shell_tests { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -2572,7 +2569,6 @@ mod shell_tests { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), (block_gas_limit + 1).into(), None, )))); @@ -2605,7 +2601,6 @@ mod shell_tests { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, )))); @@ -2644,7 +2639,6 @@ mod shell_tests { token: address::testing::apfel(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -2679,7 +2673,6 @@ mod shell_tests { token: shell.state.in_mem().native_token.clone(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -2715,7 +2708,6 @@ mod shell_tests { token: shell.state.in_mem().native_token.clone(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), 150_000.into(), None, )))); @@ -2751,7 +2743,6 @@ mod shell_tests { token: shell.state.in_mem().native_token.clone(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -2798,7 +2789,6 @@ mod shell_tests { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); diff --git a/crates/apps/src/lib/node/ledger/shell/prepare_proposal.rs b/crates/apps/src/lib/node/ledger/shell/prepare_proposal.rs index 75e0dfafe2e..07477c42717 100644 --- a/crates/apps/src/lib/node/ledger/shell/prepare_proposal.rs +++ b/crates/apps/src/lib/node/ledger/shell/prepare_proposal.rs @@ -443,7 +443,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, )))); @@ -719,7 +718,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, )))); @@ -763,7 +761,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -800,7 +797,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, )))); @@ -845,7 +841,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -867,7 +862,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair_2.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -897,7 +891,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, )))); @@ -946,7 +939,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), (block_gas_limit + 1).into(), None, ); @@ -985,7 +977,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, ); @@ -1040,7 +1031,6 @@ mod test_prepare_proposal { token: address::testing::btc(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, ); @@ -1088,7 +1078,6 @@ mod test_prepare_proposal { token: address::testing::apfel(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, ); @@ -1141,7 +1130,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, ); @@ -1181,7 +1169,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, ); @@ -1222,7 +1209,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, ); @@ -1263,7 +1249,6 @@ mod test_prepare_proposal { token: shell.state.in_mem().native_token.clone(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, ); diff --git a/crates/apps/src/lib/node/ledger/shell/process_proposal.rs b/crates/apps/src/lib/node/ledger/shell/process_proposal.rs index 4d3ed0b063b..6d5d28a641c 100644 --- a/crates/apps/src/lib/node/ledger/shell/process_proposal.rs +++ b/crates/apps/src/lib/node/ledger/shell/process_proposal.rs @@ -533,7 +533,6 @@ where #[cfg(test)] mod test_process_proposal { use namada::core::key::*; - use namada::core::storage::Epoch; use namada::eth_bridge::storage::eth_bridge_queries::{ is_bridge_comptime_enabled, EthBridgeQueries, }; @@ -849,7 +848,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, public_key, - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -901,7 +899,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -975,7 +972,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -1043,7 +1039,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -1139,7 +1134,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -1209,7 +1203,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -1263,7 +1256,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -1324,7 +1316,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -1344,7 +1335,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair_2.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -1380,7 +1370,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -1442,7 +1431,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -1488,7 +1476,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), (block_gas_limit + 1).into(), None, )))); @@ -1530,7 +1517,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, )))); @@ -1578,7 +1564,6 @@ mod test_process_proposal { token: address::testing::apfel(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -1621,7 +1606,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -1666,7 +1650,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), 150_000.into(), None, )))); @@ -1711,7 +1694,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, crate::wallet::defaults::albert_keypair().ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); @@ -1767,7 +1749,6 @@ mod test_process_proposal { token: shell.state.in_mem().native_token.clone(), }, keypair.ref_to(), - Epoch(0), GAS_LIMIT_MULTIPLIER.into(), None, )))); diff --git a/crates/benches/process_wrapper.rs b/crates/benches/process_wrapper.rs index a15539b9f5a..b45fb4abf8f 100644 --- a/crates/benches/process_wrapper.rs +++ b/crates/benches/process_wrapper.rs @@ -39,7 +39,6 @@ fn process_tx(c: &mut Criterion) { amount_per_gas_unit: DenominatedAmount::native(1.into()), }, defaults::albert_keypair().ref_to(), - 0.into(), 1_000_000.into(), // NOTE: The unshield operation has to be gas-free so don't include // it here diff --git a/crates/light_sdk/src/transaction/account.rs b/crates/light_sdk/src/transaction/account.rs index b037238a2e1..855886dd6c7 100644 --- a/crates/light_sdk/src/transaction/account.rs +++ b/crates/light_sdk/src/transaction/account.rs @@ -1,7 +1,6 @@ use namada_sdk::address::Address; use namada_sdk::hash::Hash; use namada_sdk::key::common; -use namada_sdk::storage::Epoch; use namada_sdk::token::DenominatedAmount; use namada_sdk::tx::data::GasLimit; use namada_sdk::tx::{Authorization, Tx, TxError}; @@ -59,10 +58,9 @@ impl InitAccount { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign @@ -131,10 +129,9 @@ impl RevealPk { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign @@ -215,10 +212,9 @@ impl UpdateAccount { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign diff --git a/crates/light_sdk/src/transaction/bridge.rs b/crates/light_sdk/src/transaction/bridge.rs index a8fb35c2abd..991b4ee4f5f 100644 --- a/crates/light_sdk/src/transaction/bridge.rs +++ b/crates/light_sdk/src/transaction/bridge.rs @@ -2,7 +2,6 @@ use namada_sdk::address::Address; pub use namada_sdk::eth_bridge_pool::{GasFee, TransferToEthereum}; use namada_sdk::hash::Hash; use namada_sdk::key::common; -use namada_sdk::storage::Epoch; use namada_sdk::token::DenominatedAmount; use namada_sdk::tx::data::GasLimit; use namada_sdk::tx::{Authorization, Tx, TxError}; @@ -54,10 +53,9 @@ impl BridgeTransfer { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign diff --git a/crates/light_sdk/src/transaction/governance.rs b/crates/light_sdk/src/transaction/governance.rs index ae97e0d4c94..8bf426481e8 100644 --- a/crates/light_sdk/src/transaction/governance.rs +++ b/crates/light_sdk/src/transaction/governance.rs @@ -66,10 +66,9 @@ impl InitProposal { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign @@ -145,10 +144,9 @@ impl VoteProposal { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign diff --git a/crates/light_sdk/src/transaction/ibc.rs b/crates/light_sdk/src/transaction/ibc.rs index 32afdb4c309..10715ae2b27 100644 --- a/crates/light_sdk/src/transaction/ibc.rs +++ b/crates/light_sdk/src/transaction/ibc.rs @@ -5,7 +5,6 @@ use namada_sdk::hash::Hash; pub use namada_sdk::ibc::apps::transfer::types::msgs::transfer::MsgTransfer; use namada_sdk::ibc::primitives::ToProto; use namada_sdk::key::common; -use namada_sdk::storage::Epoch; use namada_sdk::time::DateTimeUtc; use namada_sdk::token::DenominatedAmount; use namada_sdk::tx::data::GasLimit; @@ -63,10 +62,9 @@ impl IbcTransfer { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign diff --git a/crates/light_sdk/src/transaction/mod.rs b/crates/light_sdk/src/transaction/mod.rs index 6f8aebd5daa..e7fe8ce6bd7 100644 --- a/crates/light_sdk/src/transaction/mod.rs +++ b/crates/light_sdk/src/transaction/mod.rs @@ -6,7 +6,6 @@ use namada_sdk::address::Address; use namada_sdk::chain::ChainId; use namada_sdk::hash::Hash; use namada_sdk::key::common; -use namada_sdk::storage::Epoch; use namada_sdk::time::DateTimeUtc; use namada_sdk::token::DenominatedAmount; use namada_sdk::tx::data::{Fee, GasLimit}; @@ -80,7 +79,6 @@ pub(in crate::transaction) fn attach_fee( fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Tx { tx.add_wrapper( @@ -89,7 +87,6 @@ pub(in crate::transaction) fn attach_fee( token, }, fee_payer, - epoch, gas_limit, None, ); diff --git a/crates/light_sdk/src/transaction/pgf.rs b/crates/light_sdk/src/transaction/pgf.rs index 1a492b331bf..2b68693f64c 100644 --- a/crates/light_sdk/src/transaction/pgf.rs +++ b/crates/light_sdk/src/transaction/pgf.rs @@ -3,7 +3,6 @@ use namada_sdk::collections::HashMap; use namada_sdk::dec::Dec; use namada_sdk::hash::Hash; use namada_sdk::key::common; -use namada_sdk::storage::Epoch; use namada_sdk::token::DenominatedAmount; use namada_sdk::tx::data::GasLimit; use namada_sdk::tx::{Authorization, Tx, TxError}; @@ -49,10 +48,9 @@ impl ResignSteward { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign @@ -131,10 +129,9 @@ impl UpdateStewardCommission { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign diff --git a/crates/light_sdk/src/transaction/pos.rs b/crates/light_sdk/src/transaction/pos.rs index 25b7a19f37c..15f854a86ca 100644 --- a/crates/light_sdk/src/transaction/pos.rs +++ b/crates/light_sdk/src/transaction/pos.rs @@ -2,7 +2,6 @@ use namada_sdk::address::Address; use namada_sdk::dec::Dec; use namada_sdk::hash::Hash; use namada_sdk::key::{common, secp256k1}; -use namada_sdk::storage::Epoch; use namada_sdk::token; use namada_sdk::token::{Amount, DenominatedAmount}; use namada_sdk::tx::data::pos::Redelegation; @@ -337,10 +336,9 @@ impl ReactivateValidator { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign @@ -415,10 +413,9 @@ impl ClaimRewards { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign @@ -506,10 +503,9 @@ impl ChangeMetaData { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign @@ -586,10 +582,9 @@ impl ChangeConsensusKey { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign @@ -662,10 +657,9 @@ impl ChangeCommission { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign @@ -740,10 +734,9 @@ impl Withdraw { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign @@ -824,10 +817,9 @@ impl Redelegate { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign diff --git a/crates/light_sdk/src/transaction/transfer.rs b/crates/light_sdk/src/transaction/transfer.rs index 3a5d188a215..dd8c6d31bdc 100644 --- a/crates/light_sdk/src/transaction/transfer.rs +++ b/crates/light_sdk/src/transaction/transfer.rs @@ -2,7 +2,6 @@ use borsh_ext::BorshSerializeExt; use namada_sdk::address::Address; use namada_sdk::hash::Hash; use namada_sdk::key::common; -use namada_sdk::storage::Epoch; use namada_sdk::token::DenominatedAmount; use namada_sdk::tx::data::GasLimit; use namada_sdk::tx::{Authorization, Tx, TxError}; @@ -65,10 +64,9 @@ impl Transfer { fee: DenominatedAmount, token: Address, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, ) -> Self { - Self(attach_fee(self.0, fee, token, fee_payer, epoch, gas_limit)) + Self(attach_fee(self.0, fee, token, fee_payer, gas_limit)) } /// Get the bytes of the fee data to sign diff --git a/crates/namada/src/vm/wasm/run.rs b/crates/namada/src/vm/wasm/run.rs index b25aef8bcb5..ea73c78a965 100644 --- a/crates/namada/src/vm/wasm/run.rs +++ b/crates/namada/src/vm/wasm/run.rs @@ -1566,7 +1566,6 @@ mod tests { }, namada_core::key::testing::common_sk_from_simple_seed(0) .to_public(), - namada_state::Epoch(0), 0.into(), None, ), diff --git a/crates/sdk/src/eth_bridge/bridge_pool.rs b/crates/sdk/src/eth_bridge/bridge_pool.rs index c3cf05d5130..0051440c6a1 100644 --- a/crates/sdk/src/eth_bridge/bridge_pool.rs +++ b/crates/sdk/src/eth_bridge/bridge_pool.rs @@ -110,7 +110,6 @@ pub async fn build_bridge_pool_tx( .add_data(transfer); prepare_tx( - context.client(), &tx_args, &mut tx, unshield, diff --git a/crates/sdk/src/lib.rs b/crates/sdk/src/lib.rs index f7012f019e5..b5cce2c3e00 100644 --- a/crates/sdk/src/lib.rs +++ b/crates/sdk/src/lib.rs @@ -787,7 +787,6 @@ pub mod testing { use namada_core::eth_bridge_pool::PendingTransfer; use namada_core::hash::testing::arb_hash; use namada_core::key::testing::arb_common_keypair; - use namada_core::storage::testing::arb_epoch; use namada_core::token::testing::{arb_denominated_amount, arb_transfer}; use namada_core::token::Transfer; use namada_governance::storage::proposal::testing::{ @@ -950,14 +949,12 @@ pub mod testing { // Generate an arbitrary wrapper transaction pub fn arb_wrapper_tx()( fee in arb_fee(), - epoch in arb_epoch(), pk in arb_common_pk(), gas_limit in arb_gas_limit(), unshield_section_hash in option::of(arb_hash()), ) -> WrapperTx { WrapperTx { fee, - epoch, pk, gas_limit, unshield_section_hash, diff --git a/crates/sdk/src/masp.rs b/crates/sdk/src/masp.rs index 87b90b5d91e..6b5caaacff1 100644 --- a/crates/sdk/src/masp.rs +++ b/crates/sdk/src/masp.rs @@ -2487,8 +2487,7 @@ impl ShieldedContext { let mut transfer = None; extract_payload(tx, &mut wrapper, &mut transfer)?; // Epoch data is not needed for transparent transactions - let epoch = - wrapper.map(|x| x.epoch).unwrap_or_default(); + let epoch = Epoch(0); if let Some(transfer) = transfer { // Skip MASP addresses as they are already handled // by ShieldedContext diff --git a/crates/sdk/src/signing.rs b/crates/sdk/src/signing.rs index 1e138a3a6a3..2e9ce73bb17 100644 --- a/crates/sdk/src/signing.rs +++ b/crates/sdk/src/signing.rs @@ -17,7 +17,6 @@ use namada_core::collections::{HashMap, HashSet}; use namada_core::key::*; use namada_core::masp::{AssetData, ExtendedViewingKey, PaymentAddress}; use namada_core::sign::SignatureIndex; -use namada_core::storage::Epoch; use namada_core::token; use namada_core::token::Transfer; // use namada_core::storage::Key; @@ -637,7 +636,6 @@ pub async fn validate_fee_and_gen_unshield( pub async fn wrap_tx( tx: &mut Tx, args: &args::Tx, - epoch: Epoch, unshield: Option, fee_amount: DenominatedAmount, fee_payer: common::PublicKey, @@ -656,7 +654,6 @@ pub async fn wrap_tx( token: args.fee_token.clone(), }, fee_payer, - epoch, // TODO: partially validate the gas limit in client args.gas_limit, unshield_section_hash, @@ -1859,7 +1856,6 @@ pub async fn to_ledger_vector( tv.output_expert.extend(vec![ format!("Timestamp : {}", tx.header.timestamp.0), format!("Pubkey : {}", wrapper.pk), - format!("Epoch : {}", wrapper.epoch), format!("Gas limit : {}", u64::from(wrapper.gas_limit)), ]); if let Some(token) = tokens.get(&wrapper.fee.token) { diff --git a/crates/sdk/src/tx.rs b/crates/sdk/src/tx.rs index 66514ca6cb8..87e61ab1a9a 100644 --- a/crates/sdk/src/tx.rs +++ b/crates/sdk/src/tx.rs @@ -193,8 +193,7 @@ pub fn dump_tx(io: &IO, args: &args::Tx, tx: Tx) { /// Prepare a transaction for signing and submission by adding a wrapper header /// to it. #[allow(clippy::too_many_arguments)] -pub async fn prepare_tx( - client: &C, +pub async fn prepare_tx( args: &args::Tx, tx: &mut Tx, unshield: Option, @@ -202,9 +201,7 @@ pub async fn prepare_tx( fee_payer: common::PublicKey, ) -> Result<()> { if !args.dry_run { - let epoch = rpc::query_epoch(client).await?; - - signing::wrap_tx(tx, args, epoch, unshield, fee_amount, fee_payer).await + signing::wrap_tx(tx, args, unshield, fee_amount, fee_payer).await } else { Ok(()) } @@ -2804,7 +2801,6 @@ pub async fn build_ibc_transfer( .add_serialized_data(data); prepare_tx( - context.client(), &args.tx, &mut tx, unshield, @@ -2874,7 +2870,6 @@ where .add_data(data); prepare_tx( - context.client(), tx_args, &mut tx_builder, unshield, @@ -3334,7 +3329,6 @@ pub async fn build_custom( }; prepare_tx( - context.client(), tx_args, &mut tx, unshield, diff --git a/crates/tests/src/integration/masp.rs b/crates/tests/src/integration/masp.rs index 60ba2b181de..be89bf64dc7 100644 --- a/crates/tests/src/integration/masp.rs +++ b/crates/tests/src/integration/masp.rs @@ -1978,7 +1978,6 @@ fn multiple_unfetched_txs_same_block() -> Result<()> { token: native_token.clone(), }, pk.clone(), - Default::default(), 20000.into(), None, ); diff --git a/crates/tx/src/data/mod.rs b/crates/tx/src/data/mod.rs index ef66fb488c6..38bd156ab92 100644 --- a/crates/tx/src/data/mod.rs +++ b/crates/tx/src/data/mod.rs @@ -384,7 +384,6 @@ mod test_process_tx { use assert_matches::assert_matches; use namada_core::address::testing::nam; use namada_core::key::*; - use namada_core::storage::Epoch; use namada_core::token::{Amount, DenominatedAmount}; use super::*; @@ -479,7 +478,6 @@ mod test_process_tx { token: nam(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, )))); @@ -508,7 +506,6 @@ mod test_process_tx { token: nam(), }, keypair.ref_to(), - Epoch(0), 0.into(), None, )))); diff --git a/crates/tx/src/data/wrapper.rs b/crates/tx/src/data/wrapper.rs index f1fec9dae6d..d2eb9f0b60e 100644 --- a/crates/tx/src/data/wrapper.rs +++ b/crates/tx/src/data/wrapper.rs @@ -14,7 +14,6 @@ pub mod wrapper_tx { }; use namada_core::hash::Hash; use namada_core::key::*; - use namada_core::storage::Epoch; use namada_core::token::{Amount, DenominatedAmount, Transfer}; use namada_core::uint::Uint; use namada_gas::Gas; @@ -154,10 +153,6 @@ pub mod wrapper_tx { /// Used for signature verification and to determine an implicit /// account of the fee payer pub pk: common::PublicKey, - /// The epoch in which the tx is to be submitted. This determines - /// which decryption key will be used - // TODO: Is this still necessary without the DKG? Seems not - pub epoch: Epoch, /// Max amount of gas that can be used when executing the inner tx pub gas_limit: GasLimit, /// The hash of the optional, unencrypted, unshielding transaction for @@ -174,14 +169,12 @@ pub mod wrapper_tx { pub fn new( fee: Fee, pk: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, unshield_hash: Option, ) -> WrapperTx { Self { fee, pk, - epoch, gas_limit, unshield_section_hash: unshield_hash, } diff --git a/crates/tx/src/types.rs b/crates/tx/src/types.rs index 3ecc75f1e70..e1a8efd621b 100644 --- a/crates/tx/src/types.rs +++ b/crates/tx/src/types.rs @@ -20,7 +20,6 @@ use namada_core::collections::{HashMap, HashSet}; use namada_core::key::*; use namada_core::masp::AssetData; use namada_core::sign::SignatureIndex; -use namada_core::storage::Epoch; use namada_core::time::DateTimeUtc; use namada_macros::BorshDeserializer; #[cfg(feature = "migrations")] @@ -1504,14 +1503,12 @@ impl Tx { &mut self, fee: Fee, fee_payer: common::PublicKey, - epoch: Epoch, gas_limit: GasLimit, fee_unshield_hash: Option, ) -> &mut Self { self.header.tx_type = TxType::Wrapper(Box::new(WrapperTx::new( fee, fee_payer, - epoch, gas_limit, fee_unshield_hash, ))); diff --git a/wasm_for_tests/tx_fail.wasm b/wasm_for_tests/tx_fail.wasm index 3dcce953249..cc364f77ea5 100755 Binary files a/wasm_for_tests/tx_fail.wasm and b/wasm_for_tests/tx_fail.wasm differ diff --git a/wasm_for_tests/tx_infinite_guest_gas.wasm b/wasm_for_tests/tx_infinite_guest_gas.wasm index 437e0057fa2..7a4304a07d6 100755 Binary files a/wasm_for_tests/tx_infinite_guest_gas.wasm and b/wasm_for_tests/tx_infinite_guest_gas.wasm differ diff --git a/wasm_for_tests/tx_infinite_host_gas.wasm b/wasm_for_tests/tx_infinite_host_gas.wasm index 18ef7ade361..369d1f800db 100755 Binary files a/wasm_for_tests/tx_infinite_host_gas.wasm and b/wasm_for_tests/tx_infinite_host_gas.wasm differ diff --git a/wasm_for_tests/tx_invalid_data.wasm b/wasm_for_tests/tx_invalid_data.wasm index b138af7e97d..06d73cb6087 100755 Binary files a/wasm_for_tests/tx_invalid_data.wasm and b/wasm_for_tests/tx_invalid_data.wasm differ diff --git a/wasm_for_tests/tx_memory_limit.wasm b/wasm_for_tests/tx_memory_limit.wasm index 9859ea86c4e..e20f712a83d 100755 Binary files a/wasm_for_tests/tx_memory_limit.wasm and b/wasm_for_tests/tx_memory_limit.wasm differ diff --git a/wasm_for_tests/tx_no_op.wasm b/wasm_for_tests/tx_no_op.wasm index 210cae6f3ce..b2c9a4587c7 100755 Binary files a/wasm_for_tests/tx_no_op.wasm and b/wasm_for_tests/tx_no_op.wasm differ diff --git a/wasm_for_tests/tx_proposal_code.wasm b/wasm_for_tests/tx_proposal_code.wasm index 10421079814..9c68a42ce06 100755 Binary files a/wasm_for_tests/tx_proposal_code.wasm and b/wasm_for_tests/tx_proposal_code.wasm differ diff --git a/wasm_for_tests/tx_proposal_ibc_token_inflation.wasm b/wasm_for_tests/tx_proposal_ibc_token_inflation.wasm index e8f89da152c..c2f8d0d0c55 100755 Binary files a/wasm_for_tests/tx_proposal_ibc_token_inflation.wasm and b/wasm_for_tests/tx_proposal_ibc_token_inflation.wasm differ diff --git a/wasm_for_tests/tx_proposal_masp_reward.wasm b/wasm_for_tests/tx_proposal_masp_reward.wasm index df9bbf9fbce..b00aa104f3a 100755 Binary files a/wasm_for_tests/tx_proposal_masp_reward.wasm and b/wasm_for_tests/tx_proposal_masp_reward.wasm differ diff --git a/wasm_for_tests/tx_read_storage_key.wasm b/wasm_for_tests/tx_read_storage_key.wasm index 2262ca4a86b..0b769fae20a 100755 Binary files a/wasm_for_tests/tx_read_storage_key.wasm and b/wasm_for_tests/tx_read_storage_key.wasm differ diff --git a/wasm_for_tests/tx_write.wasm b/wasm_for_tests/tx_write.wasm index 02ed6e20267..39e41fe386b 100755 Binary files a/wasm_for_tests/tx_write.wasm and b/wasm_for_tests/tx_write.wasm differ diff --git a/wasm_for_tests/vp_always_false.wasm b/wasm_for_tests/vp_always_false.wasm index d6daa6c86ee..ef753e4425f 100755 Binary files a/wasm_for_tests/vp_always_false.wasm and b/wasm_for_tests/vp_always_false.wasm differ diff --git a/wasm_for_tests/vp_always_true.wasm b/wasm_for_tests/vp_always_true.wasm index ed5dbfe2502..51490d1fd42 100755 Binary files a/wasm_for_tests/vp_always_true.wasm and b/wasm_for_tests/vp_always_true.wasm differ diff --git a/wasm_for_tests/vp_eval.wasm b/wasm_for_tests/vp_eval.wasm index 3794c012419..0d3c3449ad0 100755 Binary files a/wasm_for_tests/vp_eval.wasm and b/wasm_for_tests/vp_eval.wasm differ diff --git a/wasm_for_tests/vp_infinite_guest_gas.wasm b/wasm_for_tests/vp_infinite_guest_gas.wasm index 222eeceb8df..f86bbc7d41b 100755 Binary files a/wasm_for_tests/vp_infinite_guest_gas.wasm and b/wasm_for_tests/vp_infinite_guest_gas.wasm differ diff --git a/wasm_for_tests/vp_infinite_host_gas.wasm b/wasm_for_tests/vp_infinite_host_gas.wasm index 8832b36626e..5f87be888ec 100755 Binary files a/wasm_for_tests/vp_infinite_host_gas.wasm and b/wasm_for_tests/vp_infinite_host_gas.wasm differ diff --git a/wasm_for_tests/vp_memory_limit.wasm b/wasm_for_tests/vp_memory_limit.wasm index 104517836d3..c7b25324b4b 100755 Binary files a/wasm_for_tests/vp_memory_limit.wasm and b/wasm_for_tests/vp_memory_limit.wasm differ diff --git a/wasm_for_tests/vp_read_storage_key.wasm b/wasm_for_tests/vp_read_storage_key.wasm index 84ff0e2e851..2010f28d1d0 100755 Binary files a/wasm_for_tests/vp_read_storage_key.wasm and b/wasm_for_tests/vp_read_storage_key.wasm differ