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

Reduce Chain Queries & Subscriptions #79

Merged
merged 2 commits into from
Apr 11, 2024
Merged

Conversation

joelsmith-2019
Copy link
Contributor

Closes #78

Changes:

  • Swaps newHead subscriptions to ETH based chains with periodic (every 30s) RPC queries for the chain's latest height.
  • Removes overkill flushing. Previously the flushing mechanism would partially overlap the same range of blocks multiple times, increasing our request count and monthly bill simultaneously. This PR removes the overlap entirely. If the TX isn't picked up the first time naturally, nor the second time via a flush, something else has to be wrong.

Example of previous flushing overlap on Optimism:

Optimism: 900 block lookback period
Flush started from 118,630,819 to 118,632,023
Flush started from 118,631,123 to 118,632,327
Flush started from 118,631,427 to 118,632,632
Flush started from 118,631,732 to 118,632,936

As seen, the 2nd, 3rd, and 4th flush are all overlapping blocks covered by the first flush.

@joelsmith-2019 joelsmith-2019 self-assigned this Apr 11, 2024
ethereum/listener.go Show resolved Hide resolved
@joelsmith-2019 joelsmith-2019 merged commit b12fcf5 into main Apr 11, 2024
5 checks passed
@joelsmith-2019 joelsmith-2019 deleted the joel/reduce-chain-queries branch April 11, 2024 22:53
@joelsmith-2019 joelsmith-2019 restored the joel/reduce-chain-queries branch April 11, 2024 22:53
@joelsmith-2019 joelsmith-2019 deleted the joel/reduce-chain-queries branch April 11, 2024 22:53
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.

Excessive Chain Requests / Subscriptions
2 participants