[phishing-controller] Use new config endpoint for default update intervals
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 413
- Forks
- 308
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 253
Description
The API platform team has requested that we use a new config endpoint for setting the phishing configuration update intervals. This allows them to make optimizations to both the update intervals and their infrastructure together.
The config endpoint is `https://phishing-detection.api.cx.metamask.io/v1/config`. The return value should look like `{"stalelist":2592000,"hotlist":300}`. The numbers are the update intervals for each list, in seconds.
We can send a single request to this endpoint each time the controller is initialized. We should use the values from the config endpoint as defaults, overriding the hard-coded defaults we have in the controller. However, the config values should not override any custom update intervals set in the constructor (we still want to allow the client teams to customize this if necessary).
Acceptance Criteria:
* We send a single request to the config endpoint in the controller `initialize` function
* This function should be called after construction, as part of wallet initialization
* The config endpoint values are used as default update intervals for each list
* We still have fallback update intervals hard-coded in the controller, in case the request to the config endpoint fails
* The update intervals can still be overridden by constructor options
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the phishing controller's initialize function and inspect its constructor options and hard-coded update intervals. Trace how initialization is called during wallet initialization, then implement the single config request with fallback defaults while preserving constructor overrides; done means all four acceptance criteria are met.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100