Skip to content

fix: respect local ethereum provider config - #2772

Merged
fubuloubu merged 2 commits into
ApeWorX:mainfrom
Genmin:fix/local-default-provider-config
Jun 11, 2026
Merged

fix: respect local ethereum provider config#2772
fubuloubu merged 2 commits into
ApeWorX:mainfrom
Genmin:fix/local-default-provider-config

Conversation

@Genmin

@Genmin Genmin commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

What I changed

  • Updated BaseEthereumConfig.local to merge configured ethereum.local values into the existing local-network defaults instead of always returning the hard-coded default provider.
  • Added a regression test covering ethereum.local.default_provider while preserving local defaults such as gas_limit="max" and required_confirmations=0.

Why

networks.ethereum.local.default_provider can resolve from config, but project.config.ethereum.local.default_provider was still reporting the computed default (test) because the computed local config ignored the raw configured local section.

Validation

  • uv run pytest tests/functional/test_config.py -k "ethereum_local_network_config or ethereum_network_configs or network_gas_limit_default"
  • uv run ruff check src/ape_ethereum/ecosystem.py tests/functional/test_config.py
  • Manual sanity check: EthereumConfig.model_validate({'local': {'default_provider': 'node'}}).local.default_provider == 'node' and EthereumConfig().local.default_provider == 'test'

Closes #2490

fubuloubu
fubuloubu previously approved these changes May 6, 2026
@Genmin
Genmin force-pushed the fix/local-default-provider-config branch from e41f635 to 1f381d7 Compare May 12, 2026 01:18
@Genmin

Genmin commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and addressed the mypy failure by annotating configured_local in BaseEthereumConfig.local. The previous markdown formatting failure was on an unrelated docs file and is green on the rebased branch.\n\nLocal validation after the update:\n\n- uv run --group lint ruff check src/ape_ethereum/ecosystem.py tests/functional/test_config.py\n- uv run --group lint ruff format --check src/ape_ethereum/ecosystem.py tests/functional/test_config.py\n- uv run --group lint --group test mypy src/ape_ethereum/ecosystem.py\n- uv run --group lint mdformat --check .md docs/**/.md\n- uv run --group test pytest tests/functional/test_config.py -k ethereum_local_network_config

@github-actions

Copy link
Copy Markdown

This pull request is considered stale because it has been open 30 days with no activity. Remove stale label, add a comment, or make a new commit, otherwise this PR will be closed in 5 days.

@github-actions github-actions Bot added the stale No activity for 30 days label Jun 11, 2026
@fubuloubu
fubuloubu enabled auto-merge (squash) June 11, 2026 21:39
@fubuloubu fubuloubu removed the stale No activity for 30 days label Jun 11, 2026
@fubuloubu
fubuloubu merged commit 252a657 into ApeWorX:main Jun 11, 2026
27 checks passed
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.

project.config.ethereum.local.default_provider has a different value than networks.ethereum.local.default_provider

2 participants