Skip to content

Token-list fetcher cannot read runtime CHAIN_ID #17

Description

@DenisCarriere

Problem

Explorer.Market.Fetcher.TokenList reads the chain ID from:

chain_id: [:explorer, :chain_id]

but config/runtime.exs currently assigns CHAIN_ID only to :block_scout_web and :indexer. It does not set config :explorer, chain_id: ....

As a result, a deployment with both CHAIN_ID and TOKEN_LIST_URL set logs:

Token list: CHAIN_ID is not set, importing all tokens from the list

and skips the intended chainId filter.

Live evidence

Robinhood Chain has CHAIN_ID=4663 and imported CoinGecko’s chain-specific list successfully, but the warning was emitted at startup. The current URL contains only chain 4663, so production data is correct; a multi-chain token list could import unrelated contracts.

Suggested fix

Expose the existing CHAIN_ID value under the Explorer application runtime config, for example:

config :explorer, chain_id: System.get_env("CHAIN_ID")

Keep the existing token-list tests and add a runtime configuration assertion or test that proves CHAIN_ID reaches Explorer.Market.Fetcher.TokenList.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions