@@ -14,7 +14,7 @@ use mithril_common::entities::{
14
14
} ;
15
15
use mithril_common:: logging:: LoggerExtensions ;
16
16
use mithril_common:: protocol:: { MultiSigner as ProtocolMultiSigner , SignerBuilder } ;
17
- use mithril_common:: StdResult ;
17
+ use mithril_common:: { StdResult , StmAggrSigType } ;
18
18
use mithril_persistence:: store:: StakeStorer ;
19
19
20
20
use crate :: { entities:: AggregatorEpochSettings , EpochSettingsStorer , VerificationKeyStorer } ;
@@ -145,6 +145,7 @@ struct EpochData {
145
145
signed_entity_config : SignedEntityConfig ,
146
146
total_spo : Option < TotalSPOs > ,
147
147
total_stake : Option < Stake > ,
148
+ aggregation_type : StmAggrSigType ,
148
149
}
149
150
150
151
struct ComputedEpochData {
@@ -194,6 +195,7 @@ pub struct MithrilEpochService {
194
195
era_checker : Arc < EraChecker > ,
195
196
stake_store : Arc < dyn StakeStorer > ,
196
197
allowed_signed_entity_discriminants : BTreeSet < SignedEntityTypeDiscriminants > ,
198
+ aggregation_type : StmAggrSigType ,
197
199
logger : Logger ,
198
200
}
199
201
@@ -203,6 +205,7 @@ impl MithrilEpochService {
203
205
future_epoch_settings : AggregatorEpochSettings ,
204
206
dependencies : EpochServiceDependencies ,
205
207
allowed_discriminants : BTreeSet < SignedEntityTypeDiscriminants > ,
208
+ aggregation_type : StmAggrSigType ,
206
209
logger : Logger ,
207
210
) -> Self {
208
211
Self {
@@ -215,6 +218,7 @@ impl MithrilEpochService {
215
218
era_checker : dependencies. era_checker ,
216
219
stake_store : dependencies. stake_store ,
217
220
allowed_signed_entity_discriminants : allowed_discriminants,
221
+ aggregation_type,
218
222
logger : logger. new_with_component_name :: < Self > ( ) ,
219
223
}
220
224
}
@@ -350,6 +354,8 @@ impl EpochService for MithrilEpochService {
350
354
. clone ( ) ,
351
355
} ;
352
356
357
+ let aggregation_type = self . aggregation_type ;
358
+
353
359
let ( total_spo, total_stake) = self
354
360
. get_total_spo_and_total_stake ( signer_retrieval_epoch)
355
361
. await ?;
@@ -370,6 +376,7 @@ impl EpochService for MithrilEpochService {
370
376
signed_entity_config,
371
377
total_spo,
372
378
total_stake,
379
+ aggregation_type,
373
380
} ) ;
374
381
self . computed_epoch_data = None ;
375
382
@@ -417,13 +424,15 @@ impl EpochService for MithrilEpochService {
417
424
let protocol_multi_signer = SignerBuilder :: new (
418
425
& data. current_signers_with_stake ,
419
426
& data. current_epoch_settings . protocol_parameters ,
427
+ data. aggregation_type ,
420
428
)
421
429
. with_context ( || "Epoch service failed to build protocol multi signer" ) ?
422
430
. build_multi_signer ( ) ;
423
431
424
432
let next_protocol_multi_signer = SignerBuilder :: new (
425
433
& data. next_signers_with_stake ,
426
434
& data. next_epoch_settings . protocol_parameters ,
435
+ data. aggregation_type ,
427
436
)
428
437
. with_context ( || "Epoch service failed to build next protocol multi signer" ) ?
429
438
. build_multi_signer ( ) ;
@@ -587,6 +596,7 @@ impl FakeEpochServiceBuilder {
587
596
}
588
597
589
598
pub fn build ( self ) -> FakeEpochService {
599
+ let aggregation_type = StmAggrSigType :: StmAggrSigConcatenation ;
590
600
let current_signers = Signer :: vec_from ( self . current_signers_with_stake . clone ( ) ) ;
591
601
let next_signers = Signer :: vec_from ( self . next_signers_with_stake . clone ( ) ) ;
592
602
let total_stakes_signers = self
@@ -599,13 +609,15 @@ impl FakeEpochServiceBuilder {
599
609
let protocol_multi_signer = SignerBuilder :: new (
600
610
& self . current_signers_with_stake ,
601
611
& self . current_epoch_settings . protocol_parameters ,
612
+ aggregation_type,
602
613
)
603
614
. with_context ( || "Could not build protocol_multi_signer for epoch service" )
604
615
. unwrap ( )
605
616
. build_multi_signer ( ) ;
606
617
let next_protocol_multi_signer = SignerBuilder :: new (
607
618
& self . next_signers_with_stake ,
608
619
& self . next_epoch_settings . protocol_parameters ,
620
+ aggregation_type,
609
621
)
610
622
. with_context ( || "Could not build protocol_multi_signer for epoch service" )
611
623
. unwrap ( )
@@ -628,6 +640,7 @@ impl FakeEpochServiceBuilder {
628
640
signed_entity_config : self . signed_entity_config ,
629
641
total_spo : self . total_spo ,
630
642
total_stake : self . total_stake ,
643
+ aggregation_type,
631
644
} ) ,
632
645
computed_epoch_data : Some ( ComputedEpochData {
633
646
aggregate_verification_key : protocol_multi_signer
@@ -1066,6 +1079,7 @@ mod tests {
1066
1079
Arc :: new ( stake_store) ,
1067
1080
) ,
1068
1081
self . allowed_discriminants ,
1082
+ StmAggrSigType :: StmAggrSigConcatenation ,
1069
1083
TestLogger :: stdout ( ) ,
1070
1084
)
1071
1085
}
@@ -1231,6 +1245,7 @@ mod tests {
1231
1245
let signer_builder = SignerBuilder :: new (
1232
1246
& fixture. signers_with_stake ( ) ,
1233
1247
& fixture. protocol_parameters ( ) ,
1248
+ StmAggrSigType :: StmAggrSigConcatenation ,
1234
1249
)
1235
1250
. unwrap ( ) ;
1236
1251
service. computed_epoch_data = Some ( ComputedEpochData {
0 commit comments