Skip to content

Conversation

@raxhvl
Copy link
Member

@raxhvl raxhvl commented Dec 7, 2025

πŸ—’οΈ Description

The PR adds two test cases targeting OOG scenarios when accessing 7702 delegation:

  1. Case 1: OOG at Authority access; Neither authority or delegation target is expected in BAL.
  2. Case 2: OOG at Delegation access; Authority MUST be present but Delegation target is NOT expected in BAL.

The overall goal is to ensure when an account access runs out of gas, it does not make it to BAL.

πŸ”— Related Issues or PRs

N/A.

βœ… Checklist

  • All: Ran fast tox checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    uvx tox -e static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered adding an entry to CHANGELOG.md.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).

Cute Animal Picture

    |
    \\ A _.-''.-""
    /`''`    /
   |__  @)   |
    '-....--'\
              \
              |

@codecov
Copy link

codecov bot commented Dec 7, 2025

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 83.85%. Comparing base (6044b67) to head (3c37b64).

Additional details and impacted files
@@                   Coverage Diff                    @@
##           eips/amsterdam/eip-7928    #1856   +/-   ##
========================================================
  Coverage                    83.85%   83.85%           
========================================================
  Files                          402      402           
  Lines                        25105    25105           
  Branches                      2287     2287           
========================================================
  Hits                         21051    21051           
  Misses                        3615     3615           
  Partials                       439      439           
Flag Coverage Ξ”
unittests 83.85% <ΓΈ> (ΓΈ)

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.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@jochem-brouwer jochem-brouwer left a comment

Choose a reason for hiding this comment

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

Two comments πŸ˜„ πŸ‘

# Bob is a pre-deployed account with 7702 delegation to target_contract
bob = pre.deploy_contract(
nonce=1,
code=Spec7702.delegation_designation(target_contract),
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure how the test framework translates this, but if it tries to deploy a contract with the designated 7702 delegation pointer then this will not work (contract deployment will fail because it attempts to deploy 0xEF-prefixed code (see EIP-3541)

Copy link
Member Author

Choose a reason for hiding this comment

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

The deployment goes through (we've done the same for the other tests). My understanding that this just adds to the pre-state before invoking EVM so its fine.

cc: @fselmo

Copy link
Member

Choose a reason for hiding this comment

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

Ah right, yes this would work to generate the fixtures but it would fail on a live network (uv run execute remote)

# Provide enough for intrinsic + pushes + Bob access,
# but not TargetContract
tx_gas_limit = (
intrinsic_gas_cost + push_cost + bob_cold_cost + target_cold_cost - 1
Copy link
Member

Choose a reason for hiding this comment

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

This test is almost similar to the previous one, right? The only difference is the gas limit of the tx and the expected BAL πŸ€” I think those should be merged in one test (and it should be parametrized)

@fselmo fselmo force-pushed the eips/amsterdam/eip-7928 branch 2 times, most recently from ebc749e to 6044b67 Compare December 9, 2025 01:58
πŸ“„ docs: Changelog entry
✨ feat(tests): test_bal_7702_oog_at_target
πŸ₯’ nit: reduce gas stipend to zero
✨ feat: test_bal_7702_oog_at_authority
πŸ“„ docs: Update 7702 OOG desc
@fselmo fselmo force-pushed the feat/eip-7928/7702-tests branch from 2d2473d to 3c37b64 Compare December 9, 2025 02:19
@fselmo
Copy link
Contributor

fselmo commented Dec 9, 2025

@raxhvl, we had a lot of changes this time that came from forks/osaka and I rebased here. Just letting you know :)

SamWilsn pushed a commit that referenced this pull request Dec 9, 2025
* fix(tests): fix invalid kwarg fails in 7702 `test_set_code_to_log`

* docs: update and fix changelog
SamWilsn pushed a commit that referenced this pull request Dec 9, 2025
* fix(tests): fix invalid kwarg fails in 7702 `test_set_code_to_log`

* docs: update and fix changelog
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.

3 participants