From 846deb2f4035f96dfe85628af2b90eb62662bcac Mon Sep 17 00:00:00 2001 From: bruce-riley <96066700+bruce-riley@users.noreply.github.com> Date: Mon, 11 Sep 2023 10:55:06 -0500 Subject: [PATCH] Node/Watcher: Update solana min accounts check (#3367) --- node/pkg/watchers/solana/client.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/node/pkg/watchers/solana/client.go b/node/pkg/watchers/solana/client.go index 98611dbca..ad8395a4b 100644 --- a/node/pkg/watchers/solana/client.go +++ b/node/pkg/watchers/solana/client.go @@ -158,11 +158,11 @@ func (c ConsistencyLevel) Commitment() (rpc.CommitmentType, error) { } const ( - postMessageInstructionNumAccounts = 9 - postMessageInstructionID = 0x01 - postMessageUnreliableInstructionID = 0x08 - accountPrefixReliable = "msg" - accountPrefixUnreliable = "msu" + postMessageInstructionMinNumAccounts = 8 + postMessageInstructionID = 0x01 + postMessageUnreliableInstructionID = 0x08 + accountPrefixReliable = "msg" + accountPrefixUnreliable = "msu" ) // PostMessageData represents the user-supplied, untrusted instruction data @@ -609,9 +609,9 @@ func (s *SolanaWatcher) processInstruction(ctx context.Context, logger *zap.Logg return false, nil } - if len(inst.Accounts) != postMessageInstructionNumAccounts { - return false, fmt.Errorf("invalid number of accounts: %d instead of %d", - len(inst.Accounts), postMessageInstructionNumAccounts) + if len(inst.Accounts) < postMessageInstructionMinNumAccounts { + return false, fmt.Errorf("invalid number of accounts: %d, must be at least %d", + len(inst.Accounts), postMessageInstructionMinNumAccounts) } // Decode instruction data (UNTRUSTED)