-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
support new heads polling over http rpc client #14373
support new heads polling over http rpc client #14373
Conversation
…n-of-head-subscriptions
…-flag-for-NewHeadsPollInterval add new flag, NewHeadsPollInterval
…op handling logic. To add unit test
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.
Nice work. Feel free to ignore nit comments, unless there is need for additional changes
Quality Gate passedIssues Measures |
if r.newHeadsPollInterval > 0 { | ||
interval := r.newHeadsPollInterval | ||
timeout := interval | ||
poller, _ := commonclient.NewPoller[*evmtypes.Head](interval, r.latestBlock, timeout, r.rpcLog) |
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.
Why copy r.newHeadsPollInterval
twice? Not a big deal either way I guess, just wondering why not just:
poller, _ := commonclient.NewPoller[*evmtypes.Head](interval, r.latestBlock, interval, r.rpcLog)
or even:
poller, _ := commonclient.NewPoller[*evmtypes.Head](r.newHeadsPollInterval, r.latestBlock, r.newHeadsPollInterval, r.rpcLog)
?
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.
It makes the line 499 more readable, so it's not looking like passing the same parameter twice. And it's more configurable if we decided to update the timeout value later. And it's consistent with the SubscribeToFinalizedHeads
function
…develop * origin/develop: (233 commits) update Smoke Test TestAutomationBasic to load pre-deployed contracts if given (#14537) CCIP-2881 USDC Reader integration tests (#14516) [TT-1624] link PR to solidity review issue (#14521) Fix skipped notification in E2E test workflow (#14538) Add regression testing for pruning bug (#14454) Bump owner dep (#14531) Fix state view (#14532) Deployment tooling (#14533) CCIP 3388 - add offramp generation (#14526) CCIP-3416 paginate token admin registry get all tokens call (#14514) Change Polygon zkEVM to use FeeHistory estimator (#14161) [TT-1747] fix core changeset (#14524) TT-1459 Use CTF actions from .github repo (#14522) [TT-1693] try more universal Solidity scripts (#14436) Remove unused workflow for e2e tests (#14520) BCI-3668 Optimise HeadTracker's memory usage (#14130) BCFR-888 LP support chains that have not reached finality yet (#14366) support new heads polling over http rpc client (#14373) Bump CTF (#14518) TT-1550 Migrate remaining E2E workflows to the reusable workflow (#14403) ...
Optional WS URL for RPCs to unblock new chain integration. Charry-picks from: smartcontractkit/chainlink#14354 smartcontractkit/chainlink#14373 smartcontractkit/chainlink#14534 smartcontractkit/chainlink#14364 smartcontractkit/chainlink#14929 --------- Co-authored-by: Joe Huang <[email protected]>
Description
EVM RPCClient uses web sockets to provide users with nearly real-time access to new blocks. While WS provides better performance, its reliability is sometimes not sufficient. We should be able to use HTTP instead.
In this PR:
NewHeadsPollInterval
(>0 indicate the polling new head is enabled), it's done with a separate PR for better readability hopefully.In another PR we make the ws url optional if Logbroadcaster is disabled.
Tickets:
BCFR-706