Skip to content

fix(config): warn on unknown keys in rpc_endpoints and etherscan entries - #17981

Open
aelmanaa wants to merge 1 commit into
foundry-rs:masterfrom
aelmanaa:fix/warn-unknown-endpoint-keys
Open

aelmanaa wants to merge 1 commit into
foundry-rs:masterfrom
aelmanaa:fix/warn-unknown-endpoint-keys

Conversation

@aelmanaa

Copy link
Copy Markdown
Contributor

Motivation

Closes #17978.

Unknown keys inside [rpc_endpoints] and [etherscan] entries are dropped without a warning, unlike everywhere else in foundry.toml. For example chainId = 1 in an [etherscan] entry, as in aave-v3-origin, or a misspelled retries.

Solution

WarningsProvider checks the keys of each entry in these two sections, whether they are at the top level or in a profile, against the keys their deserializers accept:

  • RPC endpoints: endpoint, url, endpoints, retries, retry_backoff, compute_units_per_second, auth;
  • explorers: key, url, chain.

An unknown key gives the existing UnknownSectionKey warning, with the entry in the section name (etherscan.mainnet). Plain-URL RPC entries are not tables and are skipped. Configs that still set api_version in an explorer entry, which forge no longer reads, now get a warning as well.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

🤖 Generated with Claude Code

Unknown keys inside [rpc_endpoints] and [etherscan] entries were dropped
without a warning, because WarningsProvider takes allowed keys from the
default config, where both sections are empty. Check each entry against
the keys its deserializer accepts and report UnknownSectionKey with the
entry in the section name, e.g. `etherscan.mainnet`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unknown keys in [rpc_endpoints] and [etherscan] entries are ignored without a warning

1 participant