Skip to content

Commit

Permalink
Node/Solana: Process multiple wormhole insts
Browse files Browse the repository at this point in the history
  • Loading branch information
bruce-riley committed Nov 14, 2023
1 parent 8c7d52f commit e13b0b0
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions node/pkg/watchers/solana/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,6 @@ func (s *SolanaWatcher) fetchBlock(ctx context.Context, logger *zap.Logger, slot

s.updateLatestBlock(slot)

OUTER:
for txNum, txRpc := range out.Transactions {
if txRpc.Meta.Err != nil {
logger.Debug("Transaction failed, skipping it",
Expand Down Expand Up @@ -561,10 +560,12 @@ OUTER:
zap.Uint64("slot", slot),
zap.String("commitment", string(s.commitment)),
zap.Binary("data", inst.Data))
continue OUTER
}
if found {
continue OUTER
} else if found {
logger.Debug("found a Wormhole instruction",
zap.Int("idx", i),
zap.Stringer("signature", signature),
zap.Uint64("slot", slot),
zap.String("commitment", string(s.commitment)))
}
}

Expand Down Expand Up @@ -598,14 +599,20 @@ OUTER:

for _, inner := range tr.Meta.InnerInstructions {
for i, inst := range inner.Instructions {
_, err = s.processInstruction(ctx, logger, slot, inst, programIndex, tx, signature, i, isReobservation)
found, err := s.processInstruction(ctx, logger, slot, inst, programIndex, tx, signature, i, isReobservation)
if err != nil {
logger.Error("malformed Wormhole instruction",
zap.Error(err),
zap.Int("idx", i),
zap.Stringer("signature", signature),
zap.Uint64("slot", slot),
zap.String("commitment", string(s.commitment)))
} else if found {
logger.Debug("found an inner Wormhole instruction",
zap.Int("idx", i),
zap.Stringer("signature", signature),
zap.Uint64("slot", slot),
zap.String("commitment", string(s.commitment)))
}
}
}
Expand Down

0 comments on commit e13b0b0

Please sign in to comment.