@@ -20,6 +20,8 @@ import (
2020 "github.com/smartcontractkit/timelock-worker/pkg/isclosed"
2121)
2222
23+ var validNodeUrlSchemesSolana = []string {"http" , "https" }
24+
2325// WorkerSolana represents a solana worker instance. It fetches periodically the latest signatures
2426// and transactions from the Solana RPC node and dispatches them to the scheduler.
2527type WorkerSolana struct {
@@ -58,8 +60,8 @@ func NewTimelockWorkerSolana(
5860 return nil , err
5961 }
6062
61- if ! slices .Contains (validNodeUrlSchemes , u .Scheme ) {
62- return nil , fmt .Errorf ("invalid node URL: %s (accepted schemes are: %v)" , nodeURL , validNodeUrlSchemes )
63+ if ! slices .Contains (validNodeUrlSchemesSolana , u .Scheme ) {
64+ return nil , fmt .Errorf ("invalid node URL: %s (accepted schemes are: %v)" , nodeURL , validNodeUrlSchemesEVM )
6365 }
6466
6567 timelockPubKey , instanceSeed , err := mcmssolanasdk .ParseContractAddress (timelockAddress )
@@ -178,6 +180,7 @@ func (w *WorkerSolana) pollSignatures(ctx context.Context, sigCh chan<- solana.S
178180 w .logger .Info ("pollSignatures context cancelled" )
179181 return
180182 case <- ticker .C :
183+ w .logger .Infow ("polling signatures timelock solana" , "timelockProgramKey" , w .timelockProgramKey , "lastSignature" , w .lastSignature )
181184 var until solana.Signature
182185 if w .lastSignature != nil {
183186 until = * w .lastSignature
@@ -197,9 +200,10 @@ func (w *WorkerSolana) pollSignatures(ctx context.Context, sigCh chan<- solana.S
197200 continue
198201 }
199202 if len (sigs ) == 0 {
203+ w .logger .Info ("no new signatures found, poll again in the next cycle" )
200204 continue
201205 }
202-
206+ w . logger . Infow ( "found new signatures" , "numSignatures" , len ( sigs ))
203207 slices .Reverse (sigs )
204208 for _ , info := range sigs {
205209 select {
@@ -363,7 +367,7 @@ func (w *WorkerSolana) handleTx(ctx context.Context, tx *rpc.TransactionWithMeta
363367// handleEventCancelled checks if the operation is cancelled and deletes it from the scheduler if it is.
364368func (w * WorkerSolana ) handleEventCancelled (_ context.Context , event SolanaTimelockCallCancelledEvent ) {
365369 w .logger .With (operationID , fmt .Sprintf ("%x" , event .ID )).
366- Infow ("event received, cancelling operation" , "event type" , eventCancelled )
370+ Infow ("event Cancelled received, cancelling operation" , "event type" , eventCancelled )
367371
368372 w .scheduler .delFromScheduler (event .ID )
369373}
@@ -379,7 +383,7 @@ func (w *WorkerSolana) handleEventExecuted(ctx context.Context, event SolanaTime
379383 return fmt .Errorf ("timelock.isOperationDone call failed (operation id: %x): %w" , event .ID , err )
380384 }
381385 if isDone {
382- logger .Infow ("event received, deleting operation from scheduler" , "event type " , eventCallExecuted )
386+ logger .Infow ("event CallExecuted received, deleting operation from scheduler" , "event type " , eventCallExecuted )
383387
384388 w .scheduler .delFromScheduler (event .ID )
385389 } else {
0 commit comments