@@ -3,10 +3,11 @@ use alloy_core::{primitives::U256 as AlloyU256, sol};
3
3
use export_macro:: vm_test;
4
4
use fil_actor_miner:: {
5
5
ProveCommitSectors3Params , SectorActivationManifest , PieceActivationManifest ,
6
- DataActivationNotification , Method as MinerMethod , CompactCommD ,
6
+ DataActivationNotification , Method as MinerMethod , CompactCommD , max_prove_commit_duration ,
7
7
} ;
8
8
use fil_actors_runtime:: {
9
9
EAM_ACTOR_ADDR , test_utils:: EVM_ACTOR_CODE_ID , test_utils:: make_piece_cid,
10
+ runtime:: Policy ,
10
11
} ;
11
12
use fvm_ipld_encoding:: { RawBytes , ipld_block:: IpldBlock , BytesDe } ;
12
13
use fvm_shared:: {
@@ -108,6 +109,9 @@ pub fn evm_receives_ddo_notifications_test(v: &dyn VM) {
108
109
} )
109
110
. collect ( ) ;
110
111
112
+ // Track the precommit epoch for later verification
113
+ let precommit_epoch = v. epoch ( ) ;
114
+
111
115
precommit_sectors_v2 (
112
116
v,
113
117
1 ,
@@ -223,8 +227,15 @@ pub fn evm_receives_ddo_notifications_test(v: &dyn VM) {
223
227
"Piece CID data mismatch: expected 0x{}, got 0x{}" ,
224
228
hex:: encode( & expected_cid_bytes) , hex:: encode( & data_cid_bytes[ 1 ..] ) ) ;
225
229
226
- // Verify minimum_commitment_epoch is set (this is calculated by the system)
227
- assert ! ( minimum_commitment_epoch > 0 ,
228
- "Minimum commitment epoch should be positive, got {}" , minimum_commitment_epoch) ;
230
+ // Verify minimum_commitment_epoch matches the sector expiration
231
+ // The sector expiration is set to: precommit_epoch + min_sector_expiration + max_prove_commit_duration
232
+ let policy = Policy :: default ( ) ;
233
+ let expected_expiration = precommit_epoch
234
+ + policy. min_sector_expiration
235
+ + max_prove_commit_duration ( & policy, seal_proof) . unwrap ( ) ;
236
+
237
+ assert_eq ! ( minimum_commitment_epoch, expected_expiration,
238
+ "Minimum commitment epoch mismatch: expected {}, got {}" ,
239
+ expected_expiration, minimum_commitment_epoch) ;
229
240
}
230
241
}
0 commit comments