diff --git a/rusk/src/lib/node/rusk.rs b/rusk/src/lib/node/rusk.rs index 79c14c0535..07f29b2da8 100644 --- a/rusk/src/lib/node/rusk.rs +++ b/rusk/src/lib/node/rusk.rs @@ -14,7 +14,7 @@ use execution_core::transfer::PANIC_NONCE_NOT_READY; use parking_lot::RwLock; use sha3::{Digest, Sha3_256}; use tokio::task; -use tracing::{debug, info, warn}; +use tracing::{debug, info}; use dusk_bytes::{DeserializableSlice, Serializable}; use dusk_consensus::config::{ @@ -149,10 +149,6 @@ impl Rusk { let tx_id = unspent_tx.id(); let tx_id_hex = hex::encode(unspent_tx.id()); - if unspent_tx.inner.gas_limit() > block_gas_left { - info!("Skipping {tx_id_hex} due gas_limit greater than left: {block_gas_left}"); - continue; - } let tx_len = unspent_tx.size().unwrap_or_default(); @@ -179,7 +175,7 @@ impl Rusk { // re-execute all spent transactions. We don't discard the // transaction, since it is technically valid. if gas_spent > block_gas_left { - warn!("This is not supposed to happen with conservative tx inclusion"); + info!("Skipping {tx_id_hex} due gas_spent {gas_spent} greater than left: {block_gas_left}"); session = self.session(block_height, None)?; for spent_tx in &spent_txs { diff --git a/rusk/tests/config/multi_transfer_deploy.toml b/rusk/tests/config/multi_transfer_deploy.toml new file mode 100644 index 0000000000..f17449f61a --- /dev/null +++ b/rusk/tests/config/multi_transfer_deploy.toml @@ -0,0 +1,14 @@ +[[phoenix_balance]] +address = "ivmscertKgRyX8wNMJJsQcSVEyPsfSMUQXSAgeAPQXsndqFq9Pmknzhm61QvcEEdxPaGgxDS4RHpb6KKccrnSKN" +seed = 57005 +notes = [10_000_000_000] + +[[phoenix_balance]] +address = "3MoVQ6VfGNu8fJ5GeHPRDVUfxcsDEmGXpWhvKhXY7F2dKCp7QWRw8RqPcbuJGdRqeTtxpuiwETnGAJLnhT4Kq4e8" +seed = 57005 +notes = [10_000_000_000] + +[[phoenix_balance]] +address = "4RyaodGmN8MyUDmpRrtRxJJhrVW2HsY2ycRUnRUXR97JCN1GHraQT9Ygb8yYo7oKzyZg2EXXCGkHBwoeNb96BKtQ" +seed = 57005 +notes = [1_000_000_000_000] diff --git a/rusk/tests/services/multi_transfer.rs b/rusk/tests/services/multi_transfer.rs index 803ce108a7..4761f2b70c 100644 --- a/rusk/tests/services/multi_transfer.rs +++ b/rusk/tests/services/multi_transfer.rs @@ -25,6 +25,7 @@ const BLOCK_HEIGHT: u64 = 1; const BLOCK_GAS_LIMIT: u64 = 24_000_000; const GAS_LIMIT: u64 = 12_000_000; // Lowest value for a transfer const INITIAL_BALANCE: u64 = 10_000_000_000; +const INITIAL_BALANCE_DEPLOY: u64 = 1_000_000_000_000; const BOB_BYTECODE: &[u8] = include_bytes!( "../../../target/dusk/wasm32-unknown-unknown/release/bob.wasm" @@ -39,6 +40,15 @@ fn initial_state>(dir: P) -> Result { new_state(dir, &snapshot, BLOCK_GAS_LIMIT) } +// Creates the Rusk initial state for the tests below +fn initial_state_deploy>(dir: P) -> Result { + let snapshot = + toml::from_str(include_str!("../config/multi_transfer_deploy.toml")) + .expect("Cannot deserialize config"); + + new_state(dir, &snapshot, BLOCK_GAS_LIMIT) +} + /// Executes three different transactions in the same block, expecting only two /// to be included due to exceeding the block gas limit fn wallet_transfer( @@ -218,7 +228,7 @@ fn wallet_transfer_deploy( "Wrong initial balance for the sender" ); assert_eq!( - initial_balance_2, INITIAL_BALANCE, + initial_balance_2, INITIAL_BALANCE_DEPLOY, "Wrong initial balance for the sender" ); @@ -255,7 +265,7 @@ fn wallet_transfer_deploy( init_args, 0, GAS_LIMIT, - 1, + 20_000, ) .expect("Failed to deploy"); txs.push(tx); @@ -387,7 +397,7 @@ pub async fn multi_transfer_deploy() -> Result<()> { logger(); let tmp = tempdir().expect("Should be able to create temporary directory"); - let rusk = initial_state(&tmp)?; + let rusk = initial_state_deploy(&tmp)?; let cache = Arc::new(RwLock::new(HashMap::new()));