diff --git a/.changelog/unreleased/improvements/3380-remove-max-sigs.md b/.changelog/unreleased/improvements/3380-remove-max-sigs.md new file mode 100644 index 0000000000..99fccb8675 --- /dev/null +++ b/.changelog/unreleased/improvements/3380-remove-max-sigs.md @@ -0,0 +1,2 @@ +- Remove the check on the maximum number of signatures allowed per transaction + ([\#3380](https://github.com/anoma/namada/pull/3380)) \ No newline at end of file diff --git a/crates/apps_lib/src/config/genesis.rs b/crates/apps_lib/src/config/genesis.rs index d6e5d97046..3d34579298 100644 --- a/crates/apps_lib/src/config/genesis.rs +++ b/crates/apps_lib/src/config/genesis.rs @@ -311,8 +311,6 @@ pub struct Parameters { pub epochs_per_year: u64, /// How many epochs it takes to transition to the next masp epoch pub masp_epoch_multiplier: u64, - /// Maximum amount of signatures per transaction - pub max_signatures_per_transaction: u8, /// Fee unshielding gas limit pub fee_unshielding_gas_limit: u64, /// Map of the cost per gas unit for every token allowed for fee payment diff --git a/crates/apps_lib/src/config/genesis/chain.rs b/crates/apps_lib/src/config/genesis/chain.rs index 690d67909f..80af1c1e54 100644 --- a/crates/apps_lib/src/config/genesis/chain.rs +++ b/crates/apps_lib/src/config/genesis/chain.rs @@ -303,7 +303,6 @@ impl Finalized { implicit_vp, epochs_per_year, masp_epoch_multiplier, - max_signatures_per_transaction, fee_unshielding_gas_limit, max_block_gas, minimum_gas_price, @@ -349,7 +348,6 @@ impl Finalized { epochs_per_year, masp_epoch_multiplier, max_proposal_bytes, - max_signatures_per_transaction, fee_unshielding_gas_limit, max_block_gas, minimum_gas_price: minimum_gas_price diff --git a/crates/apps_lib/src/config/genesis/templates.rs b/crates/apps_lib/src/config/genesis/templates.rs index db5ac13772..56119a2968 100644 --- a/crates/apps_lib/src/config/genesis/templates.rs +++ b/crates/apps_lib/src/config/genesis/templates.rs @@ -295,8 +295,6 @@ pub struct ChainParams { pub epochs_per_year: u64, /// How many epochs it takes to transition to the next masp epoch pub masp_epoch_multiplier: u64, - /// Maximum number of signature per transaction - pub max_signatures_per_transaction: u8, /// Max gas for block pub max_block_gas: u64, /// Fee unshielding gas limit @@ -322,7 +320,6 @@ impl ChainParams { implicit_vp, epochs_per_year, masp_epoch_multiplier, - max_signatures_per_transaction, max_block_gas, fee_unshielding_gas_limit, minimum_gas_price, @@ -368,7 +365,6 @@ impl ChainParams { implicit_vp, epochs_per_year, masp_epoch_multiplier, - max_signatures_per_transaction, max_block_gas, fee_unshielding_gas_limit, minimum_gas_price: min_gas_prices, diff --git a/crates/apps_lib/src/config/genesis/transactions.rs b/crates/apps_lib/src/config/genesis/transactions.rs index b7015a9032..e0a641d549 100644 --- a/crates/apps_lib/src/config/genesis/transactions.rs +++ b/crates/apps_lib/src/config/genesis/transactions.rs @@ -863,7 +863,6 @@ impl Signed { AccountPublicKeysMap::from_iter(public_keys.into_iter()), &None, threshold, - None, || Ok(()), ) .map_err(|err| err.to_string())?; diff --git a/crates/core/src/parameters.rs b/crates/core/src/parameters.rs index aaf2c294f8..821ad81017 100644 --- a/crates/core/src/parameters.rs +++ b/crates/core/src/parameters.rs @@ -49,8 +49,6 @@ pub struct Parameters { /// The multiplier for masp epochs (it requires this amount of epochs to /// transition to the next masp epoch) pub masp_epoch_multiplier: u64, - /// Maximum number of signature per transaction - pub max_signatures_per_transaction: u8, /// Fee unshielding gas limit pub fee_unshielding_gas_limit: u64, /// Map of the cost per gas unit for every token allowed for fee payment diff --git a/crates/namada/src/ledger/native_vp/masp.rs b/crates/namada/src/ledger/native_vp/masp.rs index 51e86f018b..9a9f127462 100644 --- a/crates/namada/src/ledger/native_vp/masp.rs +++ b/crates/namada/src/ledger/native_vp/masp.rs @@ -496,10 +496,6 @@ where let threshold = crate::account::threshold(&self.ctx.pre(), signer)? .unwrap_or(1); - let max_signatures_per_transaction = - crate::parameters::max_signatures_per_transaction( - &self.ctx.pre(), - )?; let mut gas_meter = self.ctx.gas_meter.borrow_mut(); tx_data .tx @@ -508,7 +504,6 @@ where public_keys_index_map, &Some(signer.clone()), threshold, - max_signatures_per_transaction, || gas_meter.consume(crate::gas::VERIFY_TX_SIG_GAS), ) .map_err(native_vp::Error::new)?; diff --git a/crates/namada/src/vm/host_env.rs b/crates/namada/src/vm/host_env.rs index 8984b4ac5f..2db29825b9 100644 --- a/crates/namada/src/vm/host_env.rs +++ b/crates/namada/src/vm/host_env.rs @@ -1963,8 +1963,6 @@ pub fn vp_verify_tx_section_signature( signer_ptr: u64, signer_len: u64, threshold: u8, - max_signatures_ptr: u64, - max_signatures_len: u64, ) -> vp_host_fns::EnvResult<()> where MEM: VmMemory, @@ -2002,14 +2000,6 @@ where let signer = Address::try_from_slice(&signer) .map_err(vp_host_fns::RuntimeError::EncodingError)?; - let (max_signatures, gas) = env - .memory - .read_bytes(max_signatures_ptr, max_signatures_len.try_into()?) - .map_err(|e| vp_host_fns::RuntimeError::MemoryError(Box::new(e)))?; - vp_host_fns::add_gas(gas_meter, gas)?; - let max_signatures = Option::::try_from_slice(&max_signatures) - .map_err(vp_host_fns::RuntimeError::EncodingError)?; - let tx = unsafe { env.ctx.tx.get() }; match tx.verify_signatures( @@ -2017,7 +2007,6 @@ where public_keys_map, &Some(signer), threshold, - max_signatures, || gas_meter.borrow_mut().consume(gas::VERIFY_TX_SIG_GAS), ) { Ok(_) => Ok(()), @@ -2136,8 +2125,6 @@ pub fn tx_verify_tx_section_signature( public_keys_map_ptr: u64, public_keys_map_len: u64, threshold: u8, - max_signatures_ptr: u64, - max_signatures_len: u64, ) -> TxResult where MEM: VmMemory, @@ -2167,14 +2154,6 @@ where tx_charge_gas::(env, gas)?; - let (max_signatures, gas) = env - .memory - .read_bytes(max_signatures_ptr, max_signatures_len.try_into()?) - .map_err(|e| TxRuntimeError::MemoryError(Box::new(e)))?; - tx_charge_gas::(env, gas)?; - let max_signatures = Option::::try_from_slice(&max_signatures) - .map_err(TxRuntimeError::EncodingError)?; - let tx = unsafe { env.ctx.tx.get() }; let (gas_meter, sentinel) = env.ctx.gas_meter_and_sentinel(); @@ -2183,7 +2162,6 @@ where public_keys_map, &None, threshold, - max_signatures, || gas_meter.borrow_mut().consume(gas::VERIFY_TX_SIG_GAS), ) { Ok(_) => Ok(HostEnvResult::Success.to_i64()), diff --git a/crates/namada/src/vm/wasm/host_env.rs b/crates/namada/src/vm/wasm/host_env.rs index 0d8d740693..ae73a15366 100644 --- a/crates/namada/src/vm/wasm/host_env.rs +++ b/crates/namada/src/vm/wasm/host_env.rs @@ -52,7 +52,7 @@ where "namada_tx_set_commitment_sentinel" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_0(host_env::tx_set_commitment_sentinel)), "namada_tx_update_masp_note_commitment_tree" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_update_masp_note_commitment_tree)), "namada_tx_update_validity_predicate" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_6(host_env::tx_update_validity_predicate)), - "namada_tx_verify_tx_section_signature" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_7(host_env::tx_verify_tx_section_signature)), + "namada_tx_verify_tx_section_signature" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_5(host_env::tx_verify_tx_section_signature)), "namada_tx_write" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_4(host_env::tx_write)), "namada_tx_write_temp" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_4(host_env::tx_write_temp)), "namada_tx_yield_value" => Function::new_typed_with_env(wasm_store, &env, wrap_tx::_2(host_env::tx_yield_value)), @@ -99,7 +99,7 @@ where "namada_vp_read_pre" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_read_pre)), "namada_vp_read_temp" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_read_temp)), "namada_vp_result_buffer" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_1(host_env::vp_result_buffer)), - "namada_vp_verify_tx_section_signature" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_9(host_env::vp_verify_tx_section_signature)), + "namada_vp_verify_tx_section_signature" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_7(host_env::vp_verify_tx_section_signature)), "namada_vp_yield_value" => Function::new_typed_with_env(wasm_store, &env, wrap_vp::_2(host_env::vp_yield_value)), }, } @@ -182,6 +182,34 @@ mod wrap_tx { } } + pub(super) fn _5( + f: F, + ) -> impl Fn( + FunctionEnvMut<'_, TxVmEnv>, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + F: Fn( + &mut TxVmEnv, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ) -> RET, + { + move |mut env, arg0, arg1, arg2, arg3, arg4| { + f(env.data_mut(), arg0, arg1, arg2, arg3, arg4) + } + } + pub(super) fn _6( f: F, ) -> impl Fn( @@ -343,6 +371,53 @@ mod wrap_vp { } } + pub(super) fn _7< + F, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ARG5, + ARG6, + RET, + D, + H, + EVAL, + CA, + >( + f: F, + ) -> impl Fn( + FunctionEnvMut<'_, VpVmEnv>, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ARG5, + ARG6, + ) -> RET + where + D: DB + for<'iter> DBIter<'iter> + 'static, + H: StorageHasher + 'static, + CA: WasmCacheAccess + 'static, + EVAL: VpEvaluator + 'static, + F: Fn( + &mut VpVmEnv, + ARG0, + ARG1, + ARG2, + ARG3, + ARG4, + ARG5, + ARG6, + ) -> RET, + { + move |mut env, arg0, arg1, arg2, arg3, arg4, arg5, arg6| { + f(env.data_mut(), arg0, arg1, arg2, arg3, arg4, arg5, arg6) + } + } + pub(super) fn _9< F, ARG0, diff --git a/crates/node/src/storage/mod.rs b/crates/node/src/storage/mod.rs index 49d37c81a8..b421826ac9 100644 --- a/crates/node/src/storage/mod.rs +++ b/crates/node/src/storage/mod.rs @@ -174,7 +174,6 @@ mod tests { implicit_vp_code_hash: Default::default(), epochs_per_year: 365, masp_epoch_multiplier: 2, - max_signatures_per_transaction: 10, fee_unshielding_gas_limit: 0, minimum_gas_price: Default::default(), is_native_token_transferable: true, diff --git a/crates/parameters/src/lib.rs b/crates/parameters/src/lib.rs index b8dbe12a88..bdfcd59911 100644 --- a/crates/parameters/src/lib.rs +++ b/crates/parameters/src/lib.rs @@ -75,7 +75,6 @@ where implicit_vp_code_hash, epochs_per_year, masp_epoch_multiplier, - max_signatures_per_transaction, minimum_gas_price, fee_unshielding_gas_limit, is_native_token_transferable, @@ -139,13 +138,6 @@ where let masp_epoch_multiplier_key = storage::get_masp_epoch_multiplier_key(); storage.write(&masp_epoch_multiplier_key, masp_epoch_multiplier)?; - let max_signatures_per_transaction_key = - storage::get_max_signatures_per_transaction_key(); - storage.write( - &max_signatures_per_transaction_key, - max_signatures_per_transaction, - )?; - let gas_cost_key = storage::get_gas_cost_key(); storage.write(&gas_cost_key, minimum_gas_price)?; @@ -157,17 +149,6 @@ where Ok(()) } -/// Get the max signatures per transactio parameter -pub fn max_signatures_per_transaction( - storage: &S, -) -> namada_storage::Result> -where - S: StorageRead, -{ - let key = storage::get_max_signatures_per_transaction_key(); - storage.read(&key) -} - /// Update the max_expected_time_per_block parameter in storage. Returns the /// parameters and gas cost. pub fn update_max_expected_time_per_block_parameter( @@ -259,18 +240,6 @@ where storage.write(&key, implicit_vp) } -/// Update the max signatures per transaction storage parameter -pub fn update_max_signature_per_tx( - storage: &mut S, - value: u8, -) -> namada_storage::Result<()> -where - S: StorageRead + StorageWrite, -{ - let key = storage::get_max_signatures_per_transaction_key(); - storage.write(&key, value) -} - /// Read the the epoch duration parameter from store pub fn read_epoch_duration_parameter( storage: &S, @@ -389,15 +358,6 @@ where // read masp epoch multiplier let masp_epoch_multiplier = read_masp_epoch_multiplier_parameter(storage)?; - // read the maximum signatures per transaction - let max_signatures_per_transaction_key = - storage::get_max_signatures_per_transaction_key(); - let value: Option = - storage.read(&max_signatures_per_transaction_key)?; - let max_signatures_per_transaction: u8 = value - .ok_or(ReadError::ParametersMissing) - .into_storage_result()?; - // read gas cost let gas_cost_key = storage::get_gas_cost_key(); let value = storage.read(&gas_cost_key)?; @@ -430,7 +390,6 @@ where implicit_vp_code_hash: Some(implicit_vp_code_hash), epochs_per_year, masp_epoch_multiplier, - max_signatures_per_transaction, minimum_gas_price, fee_unshielding_gas_limit, is_native_token_transferable, @@ -476,7 +435,6 @@ where implicit_vp_code_hash: Default::default(), epochs_per_year: 365, masp_epoch_multiplier: 2, - max_signatures_per_transaction: 10, fee_unshielding_gas_limit: 0, minimum_gas_price: Default::default(), is_native_token_transferable: true, diff --git a/crates/parameters/src/storage.rs b/crates/parameters/src/storage.rs index 27204f9568..36d78ae25c 100644 --- a/crates/parameters/src/storage.rs +++ b/crates/parameters/src/storage.rs @@ -39,7 +39,6 @@ struct Keys { max_block_gas: &'static str, minimum_gas_price: &'static str, fee_unshielding_gas_limit: &'static str, - max_signatures_per_transaction: &'static str, native_token_transferable: &'static str, } @@ -161,11 +160,6 @@ pub fn get_gas_cost_key() -> Key { get_minimum_gas_price_key_at_addr(ADDRESS) } -/// Storage key used for the max signatures per transaction key -pub fn get_max_signatures_per_transaction_key() -> Key { - get_max_signatures_per_transaction_key_at_addr(ADDRESS) -} - /// Helper function to retrieve the `max_block_gas` protocol parameter from /// storage pub fn get_max_block_gas( diff --git a/crates/proof_of_stake/src/lib.rs b/crates/proof_of_stake/src/lib.rs index e30f642307..4921930464 100644 --- a/crates/proof_of_stake/src/lib.rs +++ b/crates/proof_of_stake/src/lib.rs @@ -2725,7 +2725,6 @@ pub mod test_utils { implicit_vp_code_hash: Some(Hash::default()), epochs_per_year: 10000000, masp_epoch_multiplier: 2, - max_signatures_per_transaction: 15, fee_unshielding_gas_limit: 10000, minimum_gas_price: BTreeMap::new(), is_native_token_transferable: true, diff --git a/crates/state/src/lib.rs b/crates/state/src/lib.rs index f62ab1c862..906348791d 100644 --- a/crates/state/src/lib.rs +++ b/crates/state/src/lib.rs @@ -759,7 +759,6 @@ mod tests { implicit_vp_code_hash: Some(Hash::zero()), epochs_per_year: 100, masp_epoch_multiplier: 2, - max_signatures_per_transaction: 15, fee_unshielding_gas_limit: 20_000, minimum_gas_price: BTreeMap::default(), is_native_token_transferable: true, diff --git a/crates/tests/src/vm_host_env/mod.rs b/crates/tests/src/vm_host_env/mod.rs index da322d3fa0..6f7128c3c6 100644 --- a/crates/tests/src/vm_host_env/mod.rs +++ b/crates/tests/src/vm_host_env/mod.rs @@ -253,7 +253,6 @@ mod tests { None, Some(vec!["some_hash".to_string()]), None, - None, ); // Spawn the accounts to be able to modify their storage @@ -288,7 +287,6 @@ mod tests { None, Some(vec!["some_hash".to_string()]), None, - None, ); // Spawn the accounts to be able to modify their storage @@ -321,7 +319,6 @@ mod tests { None, Some(vec!["some_hash".to_string()]), None, - None, ); // Spawn the accounts to be able to modify their storage @@ -572,7 +569,6 @@ mod tests { pks_map, &None, 1, - None, || Ok(()) ) .is_ok() @@ -585,7 +581,6 @@ mod tests { AccountPublicKeysMap::from_iter([other_keypair.ref_to()]), &None, 1, - None, || Ok(()) ) .is_err() diff --git a/crates/tests/src/vm_host_env/tx.rs b/crates/tests/src/vm_host_env/tx.rs index 594391024d..cd00b29887 100644 --- a/crates/tests/src/vm_host_env/tx.rs +++ b/crates/tests/src/vm_host_env/tx.rs @@ -108,7 +108,6 @@ impl TestTxEnv { epoch_duration: Option, vp_allowlist: Option>, tx_allowlist: Option>, - max_signatures_per_transaction: Option, ) { parameters::update_epoch_parameter( &mut self.state, @@ -128,11 +127,6 @@ impl TestTxEnv { vp_allowlist.unwrap_or_default(), ) .unwrap(); - parameters::update_max_signature_per_tx( - &mut self.state, - max_signatures_per_transaction.unwrap_or(15), - ) - .unwrap(); } pub fn store_wasm_code(&mut self, code: Vec) { @@ -522,8 +516,6 @@ mod native_tx_host_env { public_keys_map_ptr: u64, public_keys_map_len: u64, threshold: u8, - max_signatures_ptr: u64, - max_signatures_len: u64, ) -> i64); native_host_fn!(tx_yield_value( buf_ptr: u64, diff --git a/crates/tests/src/vm_host_env/vp.rs b/crates/tests/src/vm_host_env/vp.rs index 10a7bda496..42e3896213 100644 --- a/crates/tests/src/vm_host_env/vp.rs +++ b/crates/tests/src/vm_host_env/vp.rs @@ -371,8 +371,6 @@ mod native_vp_host_env { signer_ptr: u64, signer_len: u64, threshold: u8, - max_signatures_ptr: u64, - max_signatures_len: u64, )); native_host_fn!(vp_charge_gas(used_gas: u64)); native_host_fn!(vp_yield_value(buf_ptr: u64, buf_len: u64)); diff --git a/crates/tx/src/types.rs b/crates/tx/src/types.rs index 3156b584d5..5e67b032fc 100644 --- a/crates/tx/src/types.rs +++ b/crates/tx/src/types.rs @@ -1307,13 +1307,11 @@ impl Tx { public_keys_index_map: AccountPublicKeysMap, signer: &Option
, threshold: u8, - max_signatures: Option, mut consume_verify_sig_gas: F, ) -> std::result::Result, VerifySigError> where F: FnMut() -> std::result::Result<(), namada_gas::Error>, { - let max_signatures = max_signatures.unwrap_or(u8::MAX); // Records the public key indices used in successful signatures let mut verified_pks = HashSet::new(); // Records the sections instrumental in verifying signatures @@ -1331,15 +1329,6 @@ impl Tx { .iter() .all(|x| self.get_section(x).is_some()) { - if signatures - .total_signatures() - .map_or(false, |len| len > max_signatures) - { - return Err(VerifySigError::InvalidSectionSignature( - "too many signatures.".to_string(), - )); - } - // Finally verify that the signature itself is valid let amt_verifieds = signatures .verify_signature( @@ -1386,7 +1375,6 @@ impl Tx { AccountPublicKeysMap::from_iter([public_key.clone()]), &None, 1, - None, || Ok(()), ) .map(|x| *x.first().unwrap()) diff --git a/crates/tx_prelude/src/lib.rs b/crates/tx_prelude/src/lib.rs index 3b737c8157..294815942e 100644 --- a/crates/tx_prelude/src/lib.rs +++ b/crates/tx_prelude/src/lib.rs @@ -433,19 +433,14 @@ impl namada_tx::action::Write for Ctx { /// Verify section signatures against the given list of keys pub fn verify_signatures_of_pks( - ctx: &Ctx, tx: &Tx, pks: Vec, ) -> EnvResult { - let max_signatures_per_transaction = - parameters::max_signatures_per_transaction(ctx)?; - // Require signatures from all the given keys let threshold = u8::try_from(pks.len()).into_storage_result()?; let public_keys_index_map = AccountPublicKeysMap::from_iter(pks); // Serialize parameters - let max_signatures = max_signatures_per_transaction.serialize_to_vec(); let public_keys_map = public_keys_index_map.serialize_to_vec(); let targets = [tx.raw_header_hash()].serialize_to_vec(); @@ -456,8 +451,6 @@ pub fn verify_signatures_of_pks( public_keys_map.as_ptr() as _, public_keys_map.len() as _, threshold, - max_signatures.as_ptr() as _, - max_signatures.len() as _, ) }; diff --git a/crates/vm_env/src/lib.rs b/crates/vm_env/src/lib.rs index 1888715d93..e1ec6ecff9 100644 --- a/crates/vm_env/src/lib.rs +++ b/crates/vm_env/src/lib.rs @@ -144,8 +144,6 @@ pub mod tx { public_keys_map_ptr: u64, public_keys_map_len: u64, threshold: u8, - max_signatures_ptr: u64, - max_signatures_len: u64, ) -> i64; /// Update the masp note commitment tree with the new notes @@ -260,8 +258,6 @@ pub mod vp { signer_ptr: u64, signer_len: u64, threshold: u8, - max_signatures_ptr: u64, - max_signatures_len: u64, ); /// Evaluate a validity-predicate diff --git a/crates/vp_prelude/src/lib.rs b/crates/vp_prelude/src/lib.rs index 80dada3f19..2c045467a6 100644 --- a/crates/vp_prelude/src/lib.rs +++ b/crates/vp_prelude/src/lib.rs @@ -81,10 +81,6 @@ pub fn is_proposal_accepted(ctx: &Ctx, proposal_id: u64) -> VpEnvResult { #[cold] #[inline(never)] fn verify_signatures(ctx: &Ctx, tx: &Tx, owner: &Address) -> VpResult { - let max_signatures_per_transaction = - parameters::max_signatures_per_transaction(&ctx.pre()) - .into_vp_error()?; - let public_keys_index_map = account::public_keys_index_map(&ctx.pre(), owner).into_vp_error()?; let threshold = account::threshold(&ctx.pre(), owner) @@ -92,7 +88,6 @@ fn verify_signatures(ctx: &Ctx, tx: &Tx, owner: &Address) -> VpResult { .unwrap_or(1); // Serialize parameters - let max_signatures = max_signatures_per_transaction.serialize_to_vec(); let public_keys_map = public_keys_index_map.serialize_to_vec(); let targets = [tx.raw_header_hash()].serialize_to_vec(); let signer = owner.serialize_to_vec(); @@ -106,8 +101,6 @@ fn verify_signatures(ctx: &Ctx, tx: &Tx, owner: &Address) -> VpResult { signer.as_ptr() as _, signer.len() as _, threshold, - max_signatures.as_ptr() as _, - max_signatures.len() as _, ); } Ok(()) diff --git a/genesis/localnet/parameters.toml b/genesis/localnet/parameters.toml index bef2c1ae2d..0c55c34a85 100644 --- a/genesis/localnet/parameters.toml +++ b/genesis/localnet/parameters.toml @@ -20,8 +20,6 @@ implicit_vp = "vp_implicit" epochs_per_year = 31_536_000 # The multiplier for masp epochs masp_epoch_multiplier = 2 -# Maximum number of signature per transaction -max_signatures_per_transaction = 15 # Max gas for block max_block_gas = 20000000 # Fee unshielding gas limit diff --git a/wasm/tx_become_validator/src/lib.rs b/wasm/tx_become_validator/src/lib.rs index a9c908579d..6dee2d5d05 100644 --- a/wasm/tx_become_validator/src/lib.rs +++ b/wasm/tx_become_validator/src/lib.rs @@ -22,7 +22,7 @@ fn apply_tx(ctx: &mut Ctx, tx_data: BatchedTx) -> TxResult { key::common::PublicKey::Secp256k1(become_validator.eth_hot_key.clone()), become_validator.protocol_key.clone(), ]; - verify_signatures_of_pks(ctx, &tx_data.tx, all_pks).true_or_else(|| { + verify_signatures_of_pks(&tx_data.tx, all_pks).true_or_else(|| { const ERR_MSG: &str = "Keys ownership signature verification failed"; debug_log!("{ERR_MSG}"); Error::new_const(ERR_MSG) diff --git a/wasm/tx_change_consensus_key/src/lib.rs b/wasm/tx_change_consensus_key/src/lib.rs index ad17c70b60..94ab22c2ba 100644 --- a/wasm/tx_change_consensus_key/src/lib.rs +++ b/wasm/tx_change_consensus_key/src/lib.rs @@ -14,7 +14,7 @@ fn apply_tx(ctx: &mut Ctx, tx_data: BatchedTx) -> TxResult { .wrap_err("Failed to decode ConsensusKeyChange value")?; // Check that the tx has been signed with the new consensus key - verify_signatures_of_pks(ctx, &tx_data.tx, vec![consensus_key.clone()]) + verify_signatures_of_pks(&tx_data.tx, vec![consensus_key.clone()]) .true_or_else(|| { const ERR_MSG: &str = "Consensus key ownership signature verification failed"; diff --git a/wasm/vp_implicit/src/lib.rs b/wasm/vp_implicit/src/lib.rs index db89216caf..a1787c9665 100644 --- a/wasm/vp_implicit/src/lib.rs +++ b/wasm/vp_implicit/src/lib.rs @@ -300,7 +300,7 @@ mod tests { // Initialize a tx environment let mut tx_env = TestTxEnv::default(); - tx_env.init_parameters(None, None, None, None); + tx_env.init_parameters(None, None, None); // Initialize VP environment from a transaction vp_host_env::init_from_tx(addr.clone(), tx_env, |_address| { @@ -509,7 +509,7 @@ mod tests { // Initialize a tx environment let mut tx_env = tx_host_env::take(); - tx_env.init_parameters(None, Some(vec![]), Some(vec![]), None); + tx_env.init_parameters(None, Some(vec![]), Some(vec![])); let secret_key = key::testing::keypair_1(); let public_key = secret_key.ref_to(); @@ -749,7 +749,7 @@ mod tests { let token = address::testing::nam(); let amount = token::Amount::from_uint(10_098_123, 0).unwrap(); - tx_env.init_parameters(None, None, None, None); + tx_env.init_parameters(None, None, None); // Spawn the accounts to be able to modify their storage tx_env.spawn_accounts([&vp_owner, &target, &token]); diff --git a/wasm/vp_user/src/lib.rs b/wasm/vp_user/src/lib.rs index 4071c6fdc5..b20142d1d1 100644 --- a/wasm/vp_user/src/lib.rs +++ b/wasm/vp_user/src/lib.rs @@ -1422,7 +1422,7 @@ mod tests { fn test_signed_vp_update_accepted() { // Initialize a tx environment let mut tx_env = TestTxEnv::default(); - tx_env.init_parameters(None, None, None, None); + tx_env.init_parameters(None, None, None); let vp_owner = address::testing::established_address_1(); let keypair = key::testing::keypair_1(); @@ -1481,12 +1481,7 @@ mod tests { // for the update tx_env.store_wasm_code(vp_code); - tx_env.init_parameters( - None, - Some(vec![vp_hash.to_string()]), - None, - None, - ); + tx_env.init_parameters(None, Some(vec![vp_hash.to_string()]), None); // Spawn the accounts to be able to modify their storage tx_env.spawn_accounts([&vp_owner]);