Skip to content

Commit

Permalink
Node/Solana: Allow reobservation of confirmed messages (#3769)
Browse files Browse the repository at this point in the history
* Node/Solana: Allow reobservation of confirmed messages

* Add check for finalized watcher

* Tweak finalized change
  • Loading branch information
bruce-riley authored Feb 7, 2024
1 parent c7a7d1a commit 3f75eca
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions node/pkg/watchers/solana/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,16 @@ func (s *SolanaWatcher) processMessageAccount(logger *zap.Logger, data []byte, a
return
}
if commitment != s.commitment {
logger.Debug("skipping message which does not match the watcher commitment", zap.Stringer("account", acc), zap.String("message commitment", string(commitment)), zap.String("watcher commitment", string(s.commitment)))
return
if isReobservation && s.commitment == rpc.CommitmentFinalized {
// There is only a single reobservation request channel for each chain, which is assigned to the finalized watcher.
// If someone requests reobservation of a confirmed message, we should allow the observation to go through.
logger.Info("allowing reobservation although the commitment level does not match the watcher",
zap.Stringer("account", acc), zap.String("message commitment", string(commitment)), zap.String("watcher commitment", string(s.commitment)),
)
} else {
logger.Debug("skipping message which does not match the watcher commitment", zap.Stringer("account", acc), zap.String("message commitment", string(commitment)), zap.String("watcher commitment", string(s.commitment)))
return
}
}

// As of 2023-11-09, Pythnet has a bug which is not zeroing out these fields appropriately. This carve out should be removed after a fix is deployed.
Expand Down

0 comments on commit 3f75eca

Please sign in to comment.