smartcontractkit / ccip

Cross Chain Interoperability Protocol
Other
119 stars 47 forks source link

CCIP-3420: Fix IsRequestTriggeredWithinTimeframe #1445

Closed b-gopalswami closed 4 weeks ago

b-gopalswami commented 1 month ago

Motivation

The prior approach to find if there is traffic in a lane was not detecting the transactions properly. It could be due to the CCIPSendRequestedWatcher captures the event after it is initiated not any transaction before that.

Solution

The revised approach is to use the FilterCCIPSendRequested by a past derived block number and see if there is any traffic. The block number is derived by this formula: filterFromBlock = latestBlockNumber - (SkipRequestIfAnotherRequestTriggeredWithin/avgBlockTime) By this approach, we will be able to find traffic better.

https://smartcontract-it.atlassian.net/browse/CCIP-3420