diff --git a/domains/client/domain-operator/src/tests.rs b/domains/client/domain-operator/src/tests.rs index 504f300931..2beb0d97c8 100644 --- a/domains/client/domain-operator/src/tests.rs +++ b/domains/client/domain-operator/src/tests.rs @@ -1972,7 +1972,7 @@ async fn test_invalid_block_fees_proof_creation() { ); // Run Alice (a evm domain authority node) - let mut alice = domain_test_service::DomainNodeBuilder::new( + let alice = domain_test_service::DomainNodeBuilder::new( tokio_handle.clone(), Alice, BasePath::new(directory.path().join("alice")), @@ -1989,26 +1989,11 @@ async fn test_invalid_block_fees_proof_creation() { produce_blocks!(ferdie, alice, 5).await.unwrap(); - alice - .construct_and_send_extrinsic(pallet_balances::Call::transfer_allow_death { - dest: Bob.to_account_id(), - value: 1, - }) - .await - .expect("Failed to send extrinsic"); - - // Produce a bundle that contains the previously sent extrinsic and record that bundle for later use - let (slot, target_bundle) = ferdie.produce_slot_and_wait_for_bundle_submission().await; - assert_eq!(target_bundle.extrinsics.len(), 1); - produce_block_with!(ferdie.produce_block_with_slot(slot), alice) - .await - .unwrap(); - // Get a bundle from the txn pool and modify the receipt of the target bundle to an invalid one let (slot, mut opaque_bundle) = ferdie.produce_slot_and_wait_for_bundle_submission().await; let (bad_receipt_hash, bad_submit_bundle_tx) = { let receipt = &mut opaque_bundle.sealed_header.header.receipt; - receipt.block_fees = Default::default(); + receipt.block_fees.consensus_storage_fee = 12345; opaque_bundle.sealed_header.signature = Sr25519Keyring::Alice .pair() .sign(opaque_bundle.sealed_header.pre_hash().as_ref()) diff --git a/domains/pallets/block-fees/src/lib.rs b/domains/pallets/block-fees/src/lib.rs index 0143e05c23..8d7555968a 100644 --- a/domains/pallets/block-fees/src/lib.rs +++ b/domains/pallets/block-fees/src/lib.rs @@ -90,7 +90,10 @@ mod pallet { #[pallet::hooks] impl Hooks> for Pallet { fn on_initialize(_now: BlockNumberFor) -> Weight { - CollectedBlockFees::::take(); + // NOTE: set the `CollectedBlockFees` to an empty value instead of removing the value + // completely so we can generate a storage proof to prove the empty value, which is used + // in the fraud proof. + CollectedBlockFees::::set(BlockFees::::default()); T::DbWeight::get().writes(1) } diff --git a/domains/pallets/transporter/src/lib.rs b/domains/pallets/transporter/src/lib.rs index c0cbf5f3d1..628a833ec3 100644 --- a/domains/pallets/transporter/src/lib.rs +++ b/domains/pallets/transporter/src/lib.rs @@ -292,6 +292,9 @@ mod pallet { #[pallet::hooks] impl Hooks> for Pallet { fn on_initialize(_n: BlockNumberFor) -> Weight { + // NOTE: set the `ChainTransfers` to an empty value instead of removing the value completely + // so we can generate a storage proof to prove the empty value, which is required by the fraud + // proof. ChainTransfers::::set(Default::default()); T::DbWeight::get().writes(1) }