-
Notifications
You must be signed in to change notification settings - Fork 7
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-3664 Single rate limiter per attestation http client #209
Conversation
// GetHTTPClient returns a singleton instance of the httpClient for the given API URL. | ||
// It's critical to reuse existing clients because of the self-rate limiting mechanism. Being rate limited by | ||
// Circle comes with a long cool down period, so we should always self-rate limit before hitting the API rate limit. | ||
func GetHTTPClient( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to understand the benefits of this - I see that this is the following call stack:
- factory.go: calls tokendata.NewConfigBasedCompositeObservers
- observer.go: calls createUSDCTokenObserver
- observer.go: calls NewSequentialAttestationClient
- attestation.go: calls NewHTTPClient
To me it seems like only one client is created for a single plugin instance. In the LOOPP world, I believe we will spawn a different LOOPP chainlink-ccip process for each chain (right now, its not a separate process, so this singleton logic would work as expected).
However in a LOOPP world, with different processes, this won't have the expected behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me it seems like only one client is created for a single plugin instance.
That's correct, but we still run all the plugins from a single process.
Yeah, loops will make this kind of synchronization would be painful, maybe we will need to make httpclient loop or something? I don't know the answer. Correct me if I'm wrong but we are far from a loop world and we need this rate limiting to work properly anyway.
I can add a comment about loopification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, yeah in LOOPP settings lots of things will probably break :P
|
* Change OCR3Config to reflect latest CCIPHome changes Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Change OCR3ConfigWithMeta to mirror latest CCIPHome Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Expose OCR3Node Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * ChainConfigInfo => ChainConfigArgs Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Revert "ChainConfigInfo => ChainConfigArgs" This reverts commit d433a65. * Fix ActiveCandidate return type from contract Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Fix Json name for candidate config Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Change Active Candidate to concrete types instead of pointers * debugging * debugging cl-common * Use `GetAllConfigs` in expected mock argument * Small fixes * debugging with cl-common * debugging with cl-common * cleaning round and use latest cl-common * Remove CommitPluginConfig and use OffchainConfig instead (#195) * Use digest instead of version to determine activity * Deprecating the ExecutePluginConfig (#203) * Remove non-necessary plugin Close calls (#202) * remove non-necessary plugin Close calls * remov Close() from ccipReader * Add SignObservationPrefix in the OffchainConfig (#208) * Move exec Observation into a separate file. (#205) * Move exec Outcome into a separate file. (#206) * CCIP-3664 Single rate limiter per attestation http client (#209) * rename blue-green to active-candidate * RMN config integration (#211) * bump cl-common * Revert "bump cl-common" This reverts commit 58e5f5b. * WIP bump cl-common Add OnRampAddress * Fix onRamp with merkleRoot * Add dummy RMNRawVs * Implement ccipChainReader.LinkPriceUSD() (#207) * logging updates * Fix the QueryCheck method (#213) * fix ccip reader * typos * commit/merkleroot: use auxilliary type as set key (#215) * bump chainlink-common --------- Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> Co-authored-by: nogo <110664798+0xnogo@users.noreply.github.com> Co-authored-by: dimitris <dimitrios.kouveris@smartcontract.com> Co-authored-by: Will Winder <wwinder.unh@gmail.com> Co-authored-by: Mateusz Sekara <mateusz.sekara@gmail.com> Co-authored-by: Ryan Stout <rstout610@gmail.com> Co-authored-by: Makram Kamaleddine <makramkd@users.noreply.github.com>
* Fix homechain ocr3 (#199) * Change OCR3Config to reflect latest CCIPHome changes Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Change OCR3ConfigWithMeta to mirror latest CCIPHome Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Expose OCR3Node Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * ChainConfigInfo => ChainConfigArgs Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Revert "ChainConfigInfo => ChainConfigArgs" This reverts commit d433a65. * Fix ActiveCandidate return type from contract Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Fix Json name for candidate config Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Change Active Candidate to concrete types instead of pointers * debugging * debugging cl-common * Use `GetAllConfigs` in expected mock argument * Small fixes * debugging with cl-common * debugging with cl-common * cleaning round and use latest cl-common * Remove CommitPluginConfig and use OffchainConfig instead (#195) * Use digest instead of version to determine activity * Deprecating the ExecutePluginConfig (#203) * Remove non-necessary plugin Close calls (#202) * remove non-necessary plugin Close calls * remov Close() from ccipReader * Add SignObservationPrefix in the OffchainConfig (#208) * Move exec Observation into a separate file. (#205) * Move exec Outcome into a separate file. (#206) * CCIP-3664 Single rate limiter per attestation http client (#209) * rename blue-green to active-candidate * RMN config integration (#211) * bump cl-common * Revert "bump cl-common" This reverts commit 58e5f5b. * WIP bump cl-common Add OnRampAddress * Fix onRamp with merkleRoot * Add dummy RMNRawVs * Implement ccipChainReader.LinkPriceUSD() (#207) * logging updates * Fix the QueryCheck method (#213) * fix ccip reader * typos * commit/merkleroot: use auxilliary type as set key (#215) * bump chainlink-common --------- Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> Co-authored-by: nogo <110664798+0xnogo@users.noreply.github.com> Co-authored-by: dimitris <dimitrios.kouveris@smartcontract.com> Co-authored-by: Will Winder <wwinder.unh@gmail.com> Co-authored-by: Mateusz Sekara <mateusz.sekara@gmail.com> Co-authored-by: Ryan Stout <rstout610@gmail.com> Co-authored-by: Makram Kamaleddine <makramkd@users.noreply.github.com> * misc fixes * fix commit e2e test * address comments * fix nolint comments * fix test * Use string() instead of hex.EncodeToString Co-authored-by: Will Winder <wwinder.unh@gmail.com> * fix build --------- Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> Co-authored-by: Abdelrahman Soliman (Boda) <2677789+asoliman92@users.noreply.github.com> Co-authored-by: nogo <110664798+0xnogo@users.noreply.github.com> Co-authored-by: dimitris <dimitrios.kouveris@smartcontract.com> Co-authored-by: Will Winder <wwinder.unh@gmail.com> Co-authored-by: Mateusz Sekara <mateusz.sekara@gmail.com> Co-authored-by: Ryan Stout <rstout610@gmail.com>
* Fix homechain ocr3 (#199) * Change OCR3Config to reflect latest CCIPHome changes Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Change OCR3ConfigWithMeta to mirror latest CCIPHome Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Expose OCR3Node Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * ChainConfigInfo => ChainConfigArgs Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Revert "ChainConfigInfo => ChainConfigArgs" This reverts commit d433a65. * Fix ActiveCandidate return type from contract Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Fix Json name for candidate config Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> * Change Active Candidate to concrete types instead of pointers * debugging * debugging cl-common * Use `GetAllConfigs` in expected mock argument * Small fixes * debugging with cl-common * debugging with cl-common * cleaning round and use latest cl-common * Remove CommitPluginConfig and use OffchainConfig instead (#195) * Use digest instead of version to determine activity * Deprecating the ExecutePluginConfig (#203) * Remove non-necessary plugin Close calls (#202) * remove non-necessary plugin Close calls * remov Close() from ccipReader * Add SignObservationPrefix in the OffchainConfig (#208) * Move exec Observation into a separate file. (#205) * Move exec Outcome into a separate file. (#206) * CCIP-3664 Single rate limiter per attestation http client (#209) * rename blue-green to active-candidate * RMN config integration (#211) * bump cl-common * Revert "bump cl-common" This reverts commit 58e5f5b. * WIP bump cl-common Add OnRampAddress * Fix onRamp with merkleRoot * Add dummy RMNRawVs * Implement ccipChainReader.LinkPriceUSD() (#207) * logging updates * Fix the QueryCheck method (#213) * fix ccip reader * typos * commit/merkleroot: use auxilliary type as set key (#215) * bump chainlink-common --------- Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> Co-authored-by: nogo <110664798+0xnogo@users.noreply.github.com> Co-authored-by: dimitris <dimitrios.kouveris@smartcontract.com> Co-authored-by: Will Winder <wwinder.unh@gmail.com> Co-authored-by: Mateusz Sekara <mateusz.sekara@gmail.com> Co-authored-by: Ryan Stout <rstout610@gmail.com> Co-authored-by: Makram Kamaleddine <makramkd@users.noreply.github.com> * misc fixes * fix commit e2e test * address comments * fix nolint comments * fix test * Use string() instead of hex.EncodeToString Co-authored-by: Will Winder <wwinder.unh@gmail.com> * fix build --------- Signed-off-by: asoliman <abdelrahman.soliman@smartcontract.com> Co-authored-by: Abdelrahman Soliman (Boda) <2677789+asoliman92@users.noreply.github.com> Co-authored-by: nogo <110664798+0xnogo@users.noreply.github.com> Co-authored-by: dimitris <dimitrios.kouveris@smartcontract.com> Co-authored-by: Will Winder <wwinder.unh@gmail.com> Co-authored-by: Mateusz Sekara <mateusz.sekara@gmail.com> Co-authored-by: Ryan Stout <rstout610@gmail.com>
No description provided.