Skip to content

Commit 76f836a

Browse files
committed
Nonce worker now detects Jeffy VM
1 parent 621f71e commit 76f836a

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

pkg/code/async/nonce/service.go

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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() {

pkg/code/data/intent/intent.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,8 @@ func (t Type) String() string {
548548
return "save_recent_root"
549549
case MigrateToPrivacy2022:
550550
return "migrate_to_privacy_2022"
551+
case ExternalDeposit:
552+
return "external_deposit"
551553
case SendPublicPayment:
552554
return "send_public_payment"
553555
case ReceivePaymentsPublicly:

0 commit comments

Comments
 (0)