@@ -453,13 +453,15 @@ func convertLegacyPaymentStateToNew(legacyReply *disperser_rpc.GetPaymentStateRe
453
453
OnDemandQuorumNumbers : legacyReply .PaymentGlobalParams .OnDemandQuorumNumbers ,
454
454
}
455
455
456
- // Apply the global params to all quorums mentioned in on-demand quorum numbers
457
- quorums := legacyReply .PaymentGlobalParams .OnDemandQuorumNumbers
458
- if len (quorums ) == 0 {
456
+ // Apply the global params to all quorums, both on-demand and reservation.
457
+ onDemandQuorums := legacyReply .PaymentGlobalParams .OnDemandQuorumNumbers
458
+ if len (onDemandQuorums ) == 0 {
459
459
return nil , fmt .Errorf ("no on-demand quorums specified in legacy PaymentGlobalParams received from disperser" )
460
460
}
461
+ reservationQuorums := legacyReply .Reservation .QuorumNumbers
462
+ allQuorums := append (reservationQuorums , onDemandQuorums ... )
461
463
462
- for _ , quorumID := range quorums {
464
+ for _ , quorumID := range allQuorums {
463
465
paymentVaultParams .QuorumPaymentConfigs [quorumID ] = & disperser_rpc.PaymentQuorumConfig {
464
466
ReservationSymbolsPerSecond : 0 , // Not available in legacy format
465
467
OnDemandSymbolsPerSecond : legacyReply .PaymentGlobalParams .GlobalSymbolsPerSecond ,
@@ -472,10 +474,13 @@ func convertLegacyPaymentStateToNew(legacyReply *disperser_rpc.GetPaymentStateRe
472
474
// It was added for consistency with the onchain data structure but get removed in the future.
473
475
ReservationAdvanceWindow : 0 ,
474
476
ReservationRateLimitWindow : legacyReply .PaymentGlobalParams .ReservationWindow ,
475
- OnDemandRateLimitWindow : 0 , // Not available in legacy format
476
- OnDemandEnabled : true , // we are iterating over on-demand quorums, so this is always true
477
+ OnDemandRateLimitWindow : 0 , // Not available in legacy format
477
478
}
478
479
}
480
+
481
+ for _ , quorumID := range onDemandQuorums {
482
+ paymentVaultParams .QuorumProtocolConfigs [quorumID ].OnDemandEnabled = true
483
+ }
479
484
}
480
485
481
486
// If no reservation is available, return early with only payment vault params and cumulative payment info.
0 commit comments