Skip to content

feat(execute): skip deterministic factory deploy when it can't be bootstrapped#2944

Open
nerolation wants to merge 2 commits into
ethereum:forks/amsterdamfrom
nerolation:execute-skip-undeployable-factory
Open

feat(execute): skip deterministic factory deploy when it can't be bootstrapped#2944
nerolation wants to merge 2 commits into
ethereum:forks/amsterdamfrom
nerolation:execute-skip-undeployable-factory

Conversation

@nerolation
Copy link
Copy Markdown
Contributor

🗒️ Description

The deterministic deployment proxy is deployed by an autouse session fixture (execute_required_contracts) using a keyless transaction with a fixed gas limit. On chains where contract creation requires more gas than that limit (e.g. current Glamsterdam devnets), the deployment always fails and aborts the entire execute session, even for tests that never use the factory.

This PR makes that behavior graceful:

  • Pre-check deployment with eth_estimateGas. If deployment would require more gas than the keyless transaction allows, skip the attempt and raise DeterministicFactoryNotDeployableError.
  • Make the session fixture best-effort: warn instead of failing the session.
  • Skip tests that require deterministic deployment when the factory is unavailable.
  • Add EthRPC.estimate_gas.

Validated against a Glamsterdam devnet. The deployment is skipped after ~10s with a clear error (network requires 324236 gas ... exceeding ... 100000), the test session continues, and deterministic deployment tests are skipped instead of failing the entire run.

🔗 Related Issues or PRs

N/A.

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI failures:

    just static
  • All: PR title follows the repo standard (type(scope):) and can be used as the squash commit message.

  • All: Considered updating the online docs in ./docs/.

  • All: Set appropriate labels for the changes (maintainers only).

Cute Animal Picture

put a link to a cute animal picture inside the parenthesis-->

…ests) when it can't be bootstrapped

The deterministic deployment proxy is bootstrapped in an autouse session
fixture via a keyless transaction with a fixed gas limit. On chains where the
contract-creation intrinsic gas exceeds that limit (so the keyless tx can never
be mined), the deploy aborted the entire execute session, blocking even tests
that never use the factory.

- Pre-flight the deploy with `eth_estimateGas`: if the network requires more
  gas for the creation than the keyless tx's fixed gas limit, raise instead of
  attempting it (no funding tx, no doomed send, no inclusion wait).
- Make the session fixture best-effort: warn instead of raising, so tests that
  don't need the factory still run.
- Skip a test that requests a deterministic deployment when the factory is
  unavailable.
- Add `EthRPC.estimate_gas` for the pre-flight.
@codecov
Copy link
Copy Markdown

codecov Bot commented May 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.49%. Comparing base (efd53ff) to head (3c183a5).
⚠️ Report is 1 commits behind head on forks/amsterdam.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           forks/amsterdam    #2944      +/-   ##
===================================================
+ Coverage            90.43%   90.49%   +0.06%     
===================================================
  Files                  535      535              
  Lines                32430    32430              
  Branches              3012     3012              
===================================================
+ Hits                 29329    29349      +20     
+ Misses                2573     2563      -10     
+ Partials               528      518      -10     
Flag Coverage Δ
unittests 90.49% <ø> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Collaborator

@LouisTsai-Csie LouisTsai-Csie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, this issue should be resolved after eip-7997 activate.

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.

2 participants