Skip to content

Remove legacy global/selected-chain path from GasFeeController #9585

Description

@sirtimid

Summary

GasFeeController supports two modes: the multichain path (fetchGasFeeEstimates({ networkClientId })gasFeeEstimatesByChainId[chainId]) and a legacy global/selected-chain path that predates multichain support. Remove the global path so the per-networkClientId route is the only one.

Surface to remove

  • Constructor options: getProvider, getChainId, getCurrentNetworkEIP1559Compatibility, getCurrentNetworkLegacyGasAPICompatibility, getCurrentAccountEIP1559Compatibility, onNetworkDidChange
  • Flat top-level state: gasFeeEstimates, gasEstimateType, estimatedGasFeeTimeBounds
  • No-arg polling getGasFeeEstimatesAndStartPolling() and the NetworkController:networkDidChange subscription/reset
  • Make networkClientId required in fetchGasFeeEstimates; give getTimeEstimate a chain/networkClientId arg

Impact — BREAKING

  • Core: low risk. No consumer reads the flat state or uses no-arg polling; transaction-controller already passes networkClientId. Mostly mechanical + large GasFeeController.test.ts rewrite (~60-70% is global-path).

Notes

Follow-up to #9569, which made the global path init-order-agnostic — this removal deletes that code path entirely.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions