From 27267ed98b318a6b4eefce071f3c8efcdd36fe1c Mon Sep 17 00:00:00 2001 From: Silas Lenihan Date: Tue, 3 Feb 2026 14:12:14 -0500 Subject: [PATCH] tmp/logpoller-debug --- go.mod | 4 ++-- go.sum | 8 ++++---- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 ++-- pkg/solana/logpoller/filters.go | 11 ++++++++++- pkg/solana/logpoller/log_poller.go | 5 +++++ 6 files changed, 24 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 0ca1fab4f..9f3d8f2d1 100644 --- a/go.mod +++ b/go.mod @@ -22,12 +22,12 @@ require ( github.com/smartcontractkit/chainlink-ccip v0.1.1-solana.0.20260127052127-9e53e86176d3 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 - github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202175443-ee6c9d2f8935 + github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202141447-934691421631 github.com/smartcontractkit/chainlink-common/keystore v1.0.0 github.com/smartcontractkit/chainlink-common/pkg/monitoring v0.0.0-20251215152504-b1e41f508340 github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15 github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20251021173435-e86785845942 - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260202141300-eb2d1a0d35ae github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e github.com/smartcontractkit/libocr v0.0.0-20251212213002-0a5e2f907dda github.com/stretchr/testify v1.11.1 diff --git a/go.sum b/go.sum index 8c23f989c..88cbbba88 100644 --- a/go.sum +++ b/go.sum @@ -566,8 +566,8 @@ github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-8 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d/go.mod h1:bgmqE7x9xwmIVr8PqLbC0M5iPm4AV2DBl596lO6S5Sw= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5 h1:Z4t2ZY+ZyGWxtcXvPr11y4o3CGqhg3frJB5jXkCSvWA= github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20250912190424-fd2e35d7deb5/go.mod h1:xtZNi6pOKdC3sLvokDvXOhgHzT+cyBqH/gWwvxTxqrg= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202175443-ee6c9d2f8935 h1:Uj+LW45bBgdaDRF8C7hUtM8LOh7rZ5qZJxZhsTTusvY= -github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202175443-ee6c9d2f8935/go.mod h1:zBuRC7el/pQQB95t7JnLOvCfZ3lmi5jjXYRUY2XUD+g= +github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202141447-934691421631 h1:BP8AsSNm+nHMqdoEAo3G3IdHDQaRFCwM2YBBGu7CdGg= +github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202141447-934691421631/go.mod h1:Na4CPRU4pzuZrsTOFd475mpollUhOnp1jVpSqrSV/wI= github.com/smartcontractkit/chainlink-common/keystore v1.0.0 h1:sVa3j2FWK/5OxXpnlfDkF1deDAkuXEfaLKzYqBTA880= github.com/smartcontractkit/chainlink-common/keystore v1.0.0/go.mod h1:wGRJJlCFUOKIfBlBGEdBFiTf7R787B8HKyobjiymw3Q= github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.10 h1:FJAFgXS9oqASnkS03RE1HQwYQQxrO4l46O5JSzxqLgg= @@ -578,8 +578,8 @@ github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20251210101658-1c5c8e4c4f15/go.mod h1:HG/aei0MgBOpsyRLexdKGtOUO8yjSJO3iUu0Uu8KBm4= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20251021173435-e86785845942 h1:T/eCDsUI8EJT4n5zSP4w1mz4RHH+ap8qieA17QYfBhk= github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20251021173435-e86785845942/go.mod h1:2JTBNp3FlRdO/nHc4dsc9bfxxMClMO1Qt8sLJgtreBY= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260202141300-eb2d1a0d35ae h1:FCNGzGp3cSUdoOyg9KLkaWFT3t2I+HPnbuWlMWpBAcg= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260202141300-eb2d1a0d35ae/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b/go.mod h1:qSTSwX3cBP3FKQwQacdjArqv0g6QnukjV4XuzO6UyoY= github.com/smartcontractkit/freeport v0.1.3-0.20250716200817-cb5dfd0e369e h1:Hv9Mww35LrufCdM9wtS9yVi/rEWGI1UnjHbcKKU0nVY= diff --git a/integration-tests/go.mod b/integration-tests/go.mod index 52c2d7494..bca81a593 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -20,7 +20,7 @@ require ( github.com/smartcontractkit/chain-selectors v1.0.90 github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260121163256-85accaf3d28d github.com/smartcontractkit/chainlink-common v0.9.6-0.20260202175443-ee6c9d2f8935 - github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 + github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260202141300-eb2d1a0d35ae github.com/smartcontractkit/chainlink-solana v1.1.2-0.20260121103211-89fe83165431 github.com/smartcontractkit/chainlink-solana/contracts v0.0.0-00010101000000-000000000000 github.com/smartcontractkit/chainlink-testing-framework/lib v1.54.7 diff --git a/integration-tests/go.sum b/integration-tests/go.sum index 109ae1cdf..e97cd07cb 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1327,8 +1327,8 @@ github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0. github.com/smartcontractkit/chainlink-protos/chainlink-ccv/message-discovery v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:ATjAPIVJibHRcIfiG47rEQkUIOoYa6KDvWj3zwCAw6g= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d h1:AJy55QJ/pBhXkZjc7N+ATnWfxrcjq9BI9DmdtdjwDUQ= github.com/smartcontractkit/chainlink-protos/chainlink-ccv/verifier v0.0.0-20251211142334-5c3421fe2c8d/go.mod h1:5JdppgngCOUS76p61zCinSCgOhPeYQ+OcDUuome5THQ= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9 h1:QRWXJusIj/IRY5Pl3JclNvDre0cZPd/5NbILwc4RV2M= -github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20251124151448-0448aefdaab9/go.mod h1:jUC52kZzEnWF9tddHh85zolKybmLpbQ1oNA4FjOHt1Q= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260202141300-eb2d1a0d35ae h1:FCNGzGp3cSUdoOyg9KLkaWFT3t2I+HPnbuWlMWpBAcg= +github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260202141300-eb2d1a0d35ae/go.mod h1:Jqt53s27Tr0jDl8mdBXg1xhu6F8Fci8JOuq43tgHOM8= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0 h1:xHPmFDhff7QpeFxKsZfk+24j4AlnQiFjjRh5O87Peu4= github.com/smartcontractkit/chainlink-protos/job-distributor v0.17.0/go.mod h1:/dVVLXrsp+V0AbcYGJo3XMzKg3CkELsweA/TTopCsKE= github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b h1:QuI6SmQFK/zyUlVWEf0GMkiUYBPY4lssn26nKSd/bOM= diff --git a/pkg/solana/logpoller/filters.go b/pkg/solana/logpoller/filters.go index 2509e94b0..61a45a901 100644 --- a/pkg/solana/logpoller/filters.go +++ b/pkg/solana/logpoller/filters.go @@ -560,14 +560,23 @@ func (fl *filters) DecodeSubKey(ctx context.Context, lggr logger.SugaredLogger, } decodedEvent, err := decoder.CreateType(filter.EventName, false) if err != nil || decodedEvent == nil { + lggr.Errorw("failed to create type for event", "eventName", filter.EventName, "error", err) return nil, err } + lggr.Debugw("decoding event", "eventName", filter.EventName, "rawLen", len(raw), "rawHex", fmt.Sprintf("%x", raw)) if err = decoder.Decode(ctx, raw, decodedEvent, filter.EventName); err != nil { err = fmt.Errorf("failed to decode sub key raw data: %v, for filter: %s, for subKeyPath: %v, err: %w", raw, subKeyPath, filter.Name, err) lggr.Criticalw(err.Error()) return nil, err } - return ExtractField(decodedEvent, subKeyPath) + lggr.Debugw("decoded event successfully", "eventName", filter.EventName, "decodedEvent", fmt.Sprintf("%+v", decodedEvent), "decodedEventType", fmt.Sprintf("%T", decodedEvent)) + result, extractErr := ExtractField(decodedEvent, subKeyPath) + if extractErr != nil { + lggr.Errorw("failed to extract field", "subKeyPath", subKeyPath, "error", extractErr) + return nil, extractErr + } + lggr.Debugw("extracted field value", "subKeyPath", subKeyPath, "result", result, "resultType", fmt.Sprintf("%T", result)) + return result, nil } // ExtractField extracts the value of a field or nested subfield from a composite datatype composed diff --git a/pkg/solana/logpoller/log_poller.go b/pkg/solana/logpoller/log_poller.go index 4969b9733..2c8c790a7 100644 --- a/pkg/solana/logpoller/log_poller.go +++ b/pkg/solana/logpoller/log_poller.go @@ -205,6 +205,7 @@ func (lp *Service) Process(ctx context.Context, programEvent types.ProgramEvent) } log.SubkeyValues = make([]types.IndexedValue, len(filter.SubkeyPaths)) + lp.lggr.Debugw("extracting subkey values", "filterID", filter.ID, "numPaths", len(filter.SubkeyPaths), "paths", filter.SubkeyPaths) for idx, path := range filter.SubkeyPaths { if len(path) == 0 { continue @@ -212,13 +213,17 @@ func (lp *Service) Process(ctx context.Context, programEvent types.ProgramEvent) subKeyVal, decodeSubKeyErr := lp.filters.DecodeSubKey(ctx, lp.lggr, log.Data, filter.ID, path) if decodeSubKeyErr != nil { + lp.lggr.Errorw("failed to decode subkey", "filterID", filter.ID, "path", path, "error", decodeSubKeyErr) return decodeSubKeyErr } + lp.lggr.Debugw("decoded subkey value", "filterID", filter.ID, "path", path, "idx", idx, "value", subKeyVal, "valueType", fmt.Sprintf("%T", subKeyVal)) indexedVal, newIndexedValErr := types.NewIndexedValue(subKeyVal) if newIndexedValErr != nil { + lp.lggr.Errorw("failed to create indexed value", "filterID", filter.ID, "path", path, "error", newIndexedValErr) return newIndexedValErr } + lp.lggr.Debugw("created indexed value", "filterID", filter.ID, "path", path, "indexedVal", indexedVal) log.SubkeyValues[idx] = indexedVal }