Skip to content

Commit 13e3460

Browse files
committed
Fixed event filter include reverted flag
1 parent ca049ff commit 13e3460

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

pkg/solana/ccip/chainaccessor/event.go

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,12 @@ type IndexedField struct {
5454
}
5555

5656
type filterConfig struct {
57-
idl string
58-
IndexedField0 *string
59-
IndexedField1 *string
60-
IndexedField2 *string
61-
IndexedField3 *string
57+
idl string
58+
includeReverted bool
59+
indexedField0 *string
60+
indexedField1 *string
61+
indexedField2 *string
62+
indexedField3 *string
6263
}
6364

6465
var (
@@ -76,19 +77,22 @@ var (
7677
// Map of relevant events and their metadata required to build the codec and bind program addresses
7778
var eventFilterConfigMap = map[string]filterConfig{
7879
consts.EventNameCCIPMessageSent: {
79-
idl: ccipRouterIDL,
80-
IndexedField0: &msgSentSrcChainPath,
81-
IndexedField1: &msgSentDestChainPath,
82-
IndexedField2: &msgSentSeqNumPath,
80+
idl: ccipRouterIDL,
81+
includeReverted: false,
82+
indexedField0: &msgSentSrcChainPath,
83+
indexedField1: &msgSentDestChainPath,
84+
indexedField2: &msgSentSeqNumPath,
8385
},
8486
consts.EventNameCommitReportAccepted: {
85-
idl: ccipOffRampIDL,
87+
idl: ccipOffRampIDL,
88+
includeReverted: false,
8689
},
8790
consts.EventNameExecutionStateChanged: {
88-
idl: ccipOffRampIDL,
89-
IndexedField0: &execStateChangedSrcChainPath,
90-
IndexedField1: &execStateChangedSeqNumPath,
91-
IndexedField2: &execStateChangedStatePath,
91+
idl: ccipOffRampIDL,
92+
includeReverted: true,
93+
indexedField0: &execStateChangedSrcChainPath,
94+
indexedField1: &execStateChangedSeqNumPath,
95+
indexedField2: &execStateChangedStatePath,
9296
},
9397
}
9498

@@ -203,7 +207,7 @@ func (a *SolanaAccessor) registerFilterIfNotExists(
203207
StartingBlock: conf.GetStartingBlock(),
204208
Retention: conf.GetRetention(),
205209
MaxLogsKept: conf.GetMaxLogsKept(),
206-
IncludeReverted: conf.GetIncludeReverted(),
210+
IncludeReverted: filterConfig.includeReverted,
207211
}
208212

209213
filterName := deriveName(filter)
@@ -303,17 +307,17 @@ func deriveName(filter logpollertypes.Filter) string {
303307
func processSubKeyPaths(cfg filterConfig) [][]string {
304308
subKeyPaths := make([][]string, 0)
305309

306-
if cfg.IndexedField0 != nil {
307-
subKeyPaths = append(subKeyPaths, strings.Split(*cfg.IndexedField0, "."))
310+
if cfg.indexedField0 != nil {
311+
subKeyPaths = append(subKeyPaths, strings.Split(*cfg.indexedField0, "."))
308312
}
309-
if cfg.IndexedField1 != nil {
310-
subKeyPaths = append(subKeyPaths, strings.Split(*cfg.IndexedField1, "."))
313+
if cfg.indexedField1 != nil {
314+
subKeyPaths = append(subKeyPaths, strings.Split(*cfg.indexedField1, "."))
311315
}
312-
if cfg.IndexedField2 != nil {
313-
subKeyPaths = append(subKeyPaths, strings.Split(*cfg.IndexedField2, "."))
316+
if cfg.indexedField2 != nil {
317+
subKeyPaths = append(subKeyPaths, strings.Split(*cfg.indexedField2, "."))
314318
}
315-
if cfg.IndexedField3 != nil {
316-
subKeyPaths = append(subKeyPaths, strings.Split(*cfg.IndexedField3, "."))
319+
if cfg.indexedField3 != nil {
320+
subKeyPaths = append(subKeyPaths, strings.Split(*cfg.indexedField3, "."))
317321
}
318322

319323
return subKeyPaths

pkg/solana/ccip/chainaccessor/solana_accessor.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ func (a *SolanaAccessor) GetAllConfigsLegacy(ctx context.Context, destChainSelec
131131

132132
a.lggr.Debugw("feeQuoterStaticConfig", "config", feeQuoterStaticConfig)
133133

134-
135134
rmnRemoteProxyAddr, err := a.getBinding(consts.ContractNameRMNProxy)
136135
if !errors.Is(err, ErrNoBindings) && err != nil {
137136
return ccipocr3.ChainConfigSnapshot{}, nil, fmt.Errorf("failed to get binding for rmn remote proxy: %w", err)

0 commit comments

Comments
 (0)