@@ -39,7 +39,7 @@ async fn test_pool() {
39
39
cmd @ ProtocolCommand :: PropagateOperations ( _) => Some ( cmd) ,
40
40
_ => None ,
41
41
} ;
42
- // generate transactions
42
+ // generate (id, transactions, range of validity) by threads
43
43
let mut thread_tx_lists = vec ! [ Vec :: new( ) ; * thread_count as usize ] ;
44
44
for i in 0 ..18 {
45
45
let fee = 40 + i;
@@ -90,7 +90,7 @@ async fn test_pool() {
90
90
lst. truncate ( * max_pool_size_per_thread as usize ) ;
91
91
}
92
92
93
- // checks ops for thread 0 and 1 and various periods
93
+ // checks ops are the expected ones for thread 0 and 1 and various periods
94
94
for thread in 0u8 ..=1 {
95
95
for period in 0u64 ..70 {
96
96
let target_slot = Slot :: new ( period, thread) ;
@@ -114,7 +114,8 @@ async fn test_pool() {
114
114
. map( |( id, op, _) | ( id, op. to_bytes_compact( ) . unwrap( ) ) ) ) ) ;
115
115
}
116
116
}
117
- // op ending before or at period 45 should be discarded
117
+ // op ending before or at period 45 won't appear in the block due to incompatible validity range
118
+ // we don't keep them as expected ops
118
119
let final_period = 45u64 ;
119
120
pool_command_sender
120
121
. update_latest_final_periods ( vec ! [ final_period; * thread_count as usize ] )
@@ -123,7 +124,7 @@ async fn test_pool() {
123
124
for lst in thread_tx_lists. iter_mut ( ) {
124
125
lst. retain ( |( _, op, _) | op. content . expire_period > final_period) ;
125
126
}
126
- // checks ops for thread 0 and 1 and various periods
127
+ // checks ops are the expected ones for thread 0 and 1 and various periods
127
128
for thread in 0u8 ..=1 {
128
129
for period in 0u64 ..70 {
129
130
let target_slot = Slot :: new ( period, thread) ;
@@ -147,7 +148,7 @@ async fn test_pool() {
147
148
. map( |( id, op, _) | ( id, op. to_bytes_compact( ) . unwrap( ) ) ) ) ) ;
148
149
}
149
150
}
150
- // add transactions from protocol with a high fee but too much in the future: should be ignored
151
+ // Add transactions that should be ignored despite their high fees, due to them being too far in the future
151
152
{
152
153
pool_command_sender
153
154
. update_current_slot ( Slot :: new ( 10 , 0 ) )
@@ -204,7 +205,7 @@ async fn test_pool_with_execute_sc() {
204
205
cmd @ ProtocolCommand :: PropagateOperations ( _) => Some ( cmd) ,
205
206
_ => None ,
206
207
} ;
207
- // generate transactions
208
+ // generate (id, transactions, range of validity) by threads
208
209
let mut thread_tx_lists = vec ! [ Vec :: new( ) ; * thread_count as usize ] ;
209
210
for i in 0 ..18 {
210
211
let fee = 40 + i;
@@ -255,7 +256,7 @@ async fn test_pool_with_execute_sc() {
255
256
lst. truncate ( * max_pool_size_per_thread as usize ) ;
256
257
}
257
258
258
- // checks ops for thread 0 and 1 and various periods
259
+ // checks ops are the expected ones for thread 0 and 1 and various periods
259
260
for thread in 0u8 ..=1 {
260
261
for period in 0u64 ..70 {
261
262
let target_slot = Slot :: new ( period, thread) ;
@@ -279,7 +280,8 @@ async fn test_pool_with_execute_sc() {
279
280
. map( |( id, op, _) | ( id, op. to_bytes_compact( ) . unwrap( ) ) ) ) ) ;
280
281
}
281
282
}
282
- // op ending before or at period 45 should be discarded
283
+ // op ending before or at period 45 won't appear in the block due to incompatible validity range
284
+ // we don't keep them as expected ops
283
285
let final_period = 45u64 ;
284
286
pool_command_sender
285
287
. update_latest_final_periods ( vec ! [ final_period; * thread_count as usize ] )
@@ -288,7 +290,7 @@ async fn test_pool_with_execute_sc() {
288
290
for lst in thread_tx_lists. iter_mut ( ) {
289
291
lst. retain ( |( _, op, _) | op. content . expire_period > final_period) ;
290
292
}
291
- // checks ops for thread 0 and 1 and various periods
293
+ // checks ops are the expected ones for thread 0 and 1 and various periods
292
294
for thread in 0u8 ..=1 {
293
295
for period in 0u64 ..70 {
294
296
let target_slot = Slot :: new ( period, thread) ;
@@ -312,7 +314,7 @@ async fn test_pool_with_execute_sc() {
312
314
. map( |( id, op, _) | ( id, op. to_bytes_compact( ) . unwrap( ) ) ) ) ) ;
313
315
}
314
316
}
315
- // add transactions from protocol with a high fee but too much in the future: should be ignored
317
+ // Add transactions that should be ignored despite their high fees, due to them being too far in the future
316
318
{
317
319
pool_command_sender
318
320
. update_current_slot ( Slot :: new ( 10 , 0 ) )
@@ -366,7 +368,7 @@ async fn test_pool_with_protocol_events() {
366
368
_ => None ,
367
369
} ;
368
370
369
- // generate transactions
371
+ // generate (id, transactions, range of validity) by threads
370
372
let mut thread_tx_lists = vec ! [ Vec :: new( ) ; * thread_count as usize ] ;
371
373
for i in 0 ..18 {
372
374
let fee = 40 + i;
0 commit comments