Skip to content

41.0.0

Choose a tag to compare

@github-actions github-actions released this 08 Feb 19:55
· 5516 commits to main since this release

@metamask/phishing-controller

Changed

  • BREAKING: Refactor to Cost-Optimized Phishing List Data Architecture. (#1080)
    • Rather than periodically downloading two separate configurations (MetaMask and Phishfort), we now download a combined "stalelist" and "hotlist". The stalelist is downloaded every 4 days, and the hotlist is downloaded every 30 minutes. The hotlist only includes data from the last 8 days, which should dramatically reduce the required network traffic for phishing config updates.
    • When a site is blocked, we no longer know which list is responsible due to the combined format. We will need to come up with another way to attribute blocks to a specific list; this controller will no longer be responsible for that.
    • This change includes the removal of the exports:
      • METAMASK_CONFIG_FILE and PHISHFORT_HOTLIST_FILE (replaced by METAMASK_STALELIST_FILE and METAMASK_HOTLIST_DIFF_FILE)
      • METAMASK_CONFIG_URL and PHISHFORT_HOTLIST_URL (replaced by METAMASK_STALELIST_URL and METAMASK_HOTLIST_DIFF_URL)
      • EthPhishingResponse (replaced by PhishingStalelist for the API response and PhishingListState for the list in controller state, as they're now different)
    • The configuration has changed:
      • Instead of accepting a refreshInterval, we now accept a separate interval for the stalelist and hotlist (stalelistRefreshInterval and hotlistRefreshInterval)
    • The controller state has been updated:
      • The phishing list itself has been renamed from phishing to listState, and the shape has changed. Removing the old phishing state would be advised, as it will get replaced by an updated configuration immediately anyway.
      • lastFetched has been replaced by hotlistLastFetched and stalelistLastFetched. The old lastFetched state can be removed as well (it never needed to be persisted anyway).
    • The setRefreshInterval method has been replaced by setStalelistRefreshInterval and setHotlistRefreshInterval
    • The isOutOfDate method has been replaced by isStalelistOutOfDate and isHotlistOutOfDate
    • The maybeUpdatePhishingLists method has been replaced by maybeUpdateState
    • The updatePhishingLists method has been replaced by updateStalelist and updateHotlist