@@ -56,24 +56,31 @@ func (p *service) Start(ctx context.Context, interval time.Duration) error {
5656
5757 err := p .worker (ctx , nonce .EnvironmentSolana , nonce .EnvironmentInstanceSolanaMainnet , state , interval )
5858 if err != nil && err != context .Canceled {
59- p .log .WithError (err ).Warnf ("nonce processing loop terminated unexpectedly for state %d" , state )
59+ p .log .WithError (err ).Warnf ("nonce processing loop terminated unexpectedly for env %s, instance %s, state %d" , nonce . EnvironmentSolana , nonce . EnvironmentInstanceSolanaMainnet , state )
6060 }
6161
6262 }(item )
6363 }
6464
6565 // Setup workers to watch for nonce state changes on the CVM side
66- for _ , item := range []nonce.State {
67- nonce .StateReleased ,
66+ //
67+ // todo: Dynamically detect VMs
68+ for _ , vm := range []string {
69+ common .CodeVmAccount .PublicKey ().ToBase58 (),
70+ "52MNGpgvydSwCtC2H4qeiZXZ1TxEuRVCRGa8LAfk2kSj" ,
6871 } {
69- go func (state nonce.State ) {
72+ for _ , item := range []nonce.State {
73+ nonce .StateReleased ,
74+ } {
75+ go func (state nonce.State ) {
7076
71- err := p .worker (ctx , nonce .EnvironmentCvm , common . CodeVmAccount . PublicKey (). ToBase58 () , state , interval )
72- if err != nil && err != context .Canceled {
73- p .log .WithError (err ).Warnf ("nonce processing loop terminated unexpectedly for state %d" , state )
74- }
77+ err := p .worker (ctx , nonce .EnvironmentCvm , vm , state , interval )
78+ if err != nil && err != context .Canceled {
79+ p .log .WithError (err ).Warnf ("nonce processing loop terminated unexpectedly for env %s, instance %s, state %d" , nonce . EnvironmentCvm , vm , state )
80+ }
7581
76- }(item )
82+ }(item )
83+ }
7784 }
7885
7986 go func () {
0 commit comments