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

[gas-fee-controller] Cache chains supported by Gas API #4605

Open
Gudahtt opened this issue Aug 13, 2024 · 0 comments
Open

[gas-fee-controller] Cache chains supported by Gas API #4605

Gudahtt opened this issue Aug 13, 2024 · 0 comments
Labels
enhancement New feature or request team-confirmations

Comments

@Gudahtt
Copy link
Member

Gudahtt commented Aug 13, 2024

We request gas prices from the API for every single request, making no attempt to cache which chains are supported or not. This makes gas estimates for unsupported chains slower, and unnecessarily increases network traffic.

We should instead cache the chains that we know to be unsupported by the API. We don't add support for new chains so often that we need to check every minute. Checking every day or week should suffice.

Acceptance criteria:

  • If we find that a chain is not supported by our gas API, we cache that information locally so that no reattempts are made
  • The cache expires periodically, so that clients can discover automatically when support has been added for new chains
    • Minimum expiry of 1 day, though it might make sense to make it longer, e.g. 1 week.
  • We use a console warning when we discover that a chain is not supported, rather than throwing an error.
    • Today we throw an error, but this is incorrect semantically because this scenario is expected and not indicative of any problem, and it's useless because the error is silently caught and ignored.
@Gudahtt Gudahtt added enhancement New feature or request team-confirmations labels Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request team-confirmations
Projects
None yet
Development

No branches or pull requests

1 participant