Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCIP-3420: Fix IsRequestTriggeredWithinTimeframe #14498

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Conversation

b-gopalswami
Copy link
Contributor

@b-gopalswami b-gopalswami commented Sep 19, 2024

Porting this change from CCIP. PR: smartcontractkit/ccip#1445

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

Requires

Resolves

## 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
@b-gopalswami b-gopalswami requested a review from a team as a code owner September 19, 2024 13:58
@b-gopalswami b-gopalswami changed the title CCIP-3420: Fix IsRequestTriggeredWithinTimeframe (#1445) CCIP-3420: Fix IsRequestTriggeredWithinTimeframe Sep 19, 2024
@Bwest981 Bwest981 added this pull request to the merge queue Sep 19, 2024
Merged via the queue into develop with commit 0aa5985 Sep 19, 2024
74 of 76 checks passed
@Bwest981 Bwest981 deleted the ccip-3420-1 branch September 19, 2024 16:50
momentmaker added a commit that referenced this pull request Sep 19, 2024
…tractkit/chainlink into re-2964/goreleaser-ccip

* 're-2964/goreleaser-ccip' of https://github.com/smartcontractkit/chainlink:
  Fix data race in TestLogPoller_Replay (#14431)
  Fix CCIP Load Test Faulty Fund Return (#14499)
  use tx in insertLogsWithinTx (#14361)
  Bring KMS client and multiclient over to chainlink (#14484)
  CCIP-3420: Fix IsRequestTriggeredWithinTimeframe (#1445) (#14498)
  [TT-1345] option to use predeployed contracts in OCR tests (#13758)
  CCIP-3428 Enabling ccip smoke test for testnet (#14452)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants