@@ -3460,7 +3460,7 @@ async fn test_multiple_consensus_blocks_derive_similar_domain_block() {
34603460 ) ;
34613461
34623462 // Run Alice (a evm domain authority node)
3463- let alice = domain_test_service:: DomainNodeBuilder :: new (
3463+ let mut alice = domain_test_service:: DomainNodeBuilder :: new (
34643464 tokio_handle. clone ( ) ,
34653465 Alice ,
34663466 BasePath :: new ( directory. path ( ) . join ( "alice" ) ) ,
@@ -3477,29 +3477,45 @@ async fn test_multiple_consensus_blocks_derive_similar_domain_block() {
34773477 . into ( )
34783478 } ;
34793479
3480- // Fork A
3480+ // submit a remark from alice
3481+ let alice_account_nonce = alice. account_nonce ( ) ;
3482+ let tx = alice. construct_extrinsic (
3483+ alice_account_nonce,
3484+ frame_system:: Call :: remark {
3485+ remark : vec ! [ 0u8 ; 8 ] ,
3486+ } ,
3487+ ) ;
3488+ alice
3489+ . send_extrinsic ( tx)
3490+ . await
3491+ . expect ( "Failed to send extrinsic" ) ;
3492+
3493+ // Fork A with bundle that contains above transaction
34813494 let ( slot, bundle) = ferdie. produce_slot_and_wait_for_bundle_submission ( ) . await ;
3482- // Include one more extrinsic in fork A such that we can have a different consensus block
3483- let remark_tx = subspace_test_runtime:: UncheckedExtrinsic :: new_unsigned (
3484- frame_system:: Call :: remark { remark : vec ! [ 0 ; 8 ] } . into ( ) ,
3485- )
3486- . into ( ) ;
34873495 let consensus_block_hash_fork_a = ferdie
34883496 . produce_block_with_slot_at (
34893497 slot,
34903498 common_block_hash,
3491- Some ( vec ! [ bundle_to_tx( bundle. clone( ) . unwrap( ) ) , remark_tx ] ) ,
3499+ Some ( vec ! [ bundle_to_tx( bundle. clone( ) . unwrap( ) ) ] ) ,
34923500 )
34933501 . await
34943502 . unwrap ( ) ;
34953503
34963504 // Fork B
3505+ let bundle = {
3506+ let mut opaque_bundle = bundle. unwrap ( ) ;
3507+ opaque_bundle. extrinsics = vec ! [ ] ;
3508+ opaque_bundle. sealed_header . header . bundle_extrinsics_root =
3509+ sp_domains:: EMPTY_EXTRINSIC_ROOT ;
3510+ opaque_bundle. sealed_header . signature = Sr25519Keyring :: Alice
3511+ . pair ( )
3512+ . sign ( opaque_bundle. sealed_header . pre_hash ( ) . as_ref ( ) )
3513+ . into ( ) ;
3514+ opaque_bundle
3515+ } ;
3516+
34973517 let consensus_block_hash_fork_b = ferdie
3498- . produce_block_with_slot_at (
3499- slot,
3500- common_block_hash,
3501- Some ( vec ! [ bundle_to_tx( bundle. unwrap( ) ) ] ) ,
3502- )
3518+ . produce_block_with_slot_at ( slot, common_block_hash, Some ( vec ! [ bundle_to_tx( bundle) ] ) )
35033519 . await
35043520 . unwrap ( ) ;
35053521 // Produce one more consensus block to make fork B the best fork and trigger processing
@@ -3547,16 +3563,12 @@ async fn test_multiple_consensus_blocks_derive_similar_domain_block() {
35473563 consensus_block_hash_fork_b
35483564 ) ;
35493565
3550- // The domain block headers should have the same `parent_hash` and `extrinsics_root`
3566+ // The domain block headers should have the same `parent_hash`
35513567 // but different digest and `state_root` (because digest is stored on chain)
35523568 assert_eq ! (
35533569 domain_block_header_fork_a. parent_hash( ) ,
35543570 domain_block_header_fork_b. parent_hash( )
35553571 ) ;
3556- assert_eq ! (
3557- domain_block_header_fork_a. extrinsics_root( ) ,
3558- domain_block_header_fork_b. extrinsics_root( )
3559- ) ;
35603572 assert_ne ! (
35613573 domain_block_header_fork_a. digest( ) ,
35623574 domain_block_header_fork_b. digest( )
0 commit comments