Skip to content

Commit 5ea0a74

Browse files
committed
Remove dead warmUpSession code and config
The warmUpSession sleep was replaced by the proper WaitForPeersReady barrier handshake but the old code and config were never cleaned up.
1 parent 6b8d963 commit 5ea0a74

2 files changed

Lines changed: 0 additions & 17 deletions

File tree

config.yaml.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ backup_period_seconds: 300 # 5 minutes
2121
backup_dir: backups
2222
max_concurrent_keygen: 2
2323
max_concurrent_signing: 10
24-
session_warm_up_delay_ms: 100
2524
healthcheck:
2625
enabled: false # disabled by default, set to true for cloud deployment
2726
address: "0.0.0.0:8080"

pkg/eventconsumer/event_consumer.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ const (
2727

2828
DefaultConcurrentKeygen = 2
2929
DefaultConcurrentSigning = 20
30-
DefaultSessionWarmUpDelay = 200
31-
3230
KeyGenTimeOut = 30 * time.Second
3331
)
3432

@@ -55,8 +53,6 @@ type eventConsumer struct {
5553
signingMsgBuffer chan *nats.Msg
5654
maxConcurrentKeygen int
5755
maxConcurrentSigning int
58-
sessionWarmUpDelayMs int
59-
6056
// Track active sessions with timestamps for cleanup
6157
activeSessions map[string]time.Time // Maps "walletID-txID" to creation time
6258
sessionsLock sync.RWMutex
@@ -83,19 +79,12 @@ func NewEventConsumer(
8379
maxConcurrentSigning = DefaultConcurrentSigning
8480
}
8581

86-
sessionWarmUpDelayMs := viper.GetInt("session_warm_up_delay_ms")
87-
if sessionWarmUpDelayMs == 0 {
88-
sessionWarmUpDelayMs = DefaultSessionWarmUpDelay
89-
}
90-
9182
logger.Info(
9283
"Initializing event consumer",
9384
"max_concurrent_keygen",
9485
maxConcurrentKeygen,
9586
"max_concurrent_signing",
9687
maxConcurrentSigning,
97-
"session_warm_up_delay_ms",
98-
sessionWarmUpDelayMs,
9988
)
10089

10190
ec := &eventConsumer{
@@ -114,7 +103,6 @@ func NewEventConsumer(
114103
identityStore: identityStore,
115104
keygenMsgBuffer: make(chan *nats.Msg, 100),
116105
signingMsgBuffer: make(chan *nats.Msg, 200), // Larger buffer for signing
117-
sessionWarmUpDelayMs: sessionWarmUpDelayMs,
118106
}
119107

120108
go ec.startKeyGenEventWorker()
@@ -144,10 +132,6 @@ func (ec *eventConsumer) Run() {
144132
logger.Info("MPC Event consumer started...!")
145133
}
146134

147-
func (ec *eventConsumer) warmUpSession() {
148-
time.Sleep(time.Duration(ec.sessionWarmUpDelayMs) * time.Millisecond)
149-
}
150-
151135
func (ec *eventConsumer) handleKeyGenEvent(natMsg *nats.Msg) {
152136
baseCtx, baseCancel := context.WithTimeout(context.Background(), KeyGenTimeOut)
153137
defer baseCancel()

0 commit comments

Comments
 (0)