Skip to content

Conversation

@fselmo
Copy link
Owner

@fselmo fselmo commented Oct 9, 2025

What was wrong?

Nothing is "wrong" and currently we pass all tests. However, the explicitness with which accounts are tracked within CALLCODE and DELEGATECALL was removed by me in the commit below. It was still tracked because the access_delegation would track the address before it checked if it was a delegation or not, so it would always track the address.

For the specs, this needs to be more explicit. The only missing piece of the commit below was tracking the delegation target after it was accessed. This puts everything back to the way it should be imo for a reader of the specs.

Related to commit 67404ac

cc: @nerolation

How was it fixed?

  • Put back explicit account tracking inside CALLCODE and DELEGATECALL.
  • Only track the address within access_delegation if it passes the is_valid_delegation(...) check.

Cute Animal Picture

Picture of my across-the-street neighbor's house, middle of the day, the other day 😅

Screenshot 2025-10-09 at 09 22 13

@fselmo
Copy link
Owner Author

fselmo commented Oct 9, 2025

@nerolation I found out why the tests still pass but it's not ideal. access_delegation was tracking the account whether it passed the is_valid_delegation check or not. This isn't explicit, so we should put this part back. My fault for messing with it too much 😅.

So it isn't "wrong" code but it's not clear specifications code.

@cr-gpt
Copy link

cr-gpt bot commented Oct 9, 2025

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@fselmo fselmo force-pushed the refactor/delegation-vs-no-delegation-code-paths branch from 2713b55 to b993577 Compare October 9, 2025 15:34
@fselmo fselmo force-pushed the refactor/delegation-vs-no-delegation-code-paths branch from b993577 to 83c0014 Compare October 13, 2025 01:42
@cr-gpt
Copy link

cr-gpt bot commented Oct 13, 2025

Seems you are using me but didn't get OPENAI_API_KEY seted in Variables/Secrets for this repo. you could follow readme for more information

@nerolation
Copy link
Collaborator

yeah looks good to me! Thanks! 👍

@fselmo fselmo merged commit f3ad599 into feat/amsterdam-fork-and-block-access-lists Oct 13, 2025
3 of 7 checks passed
fselmo pushed a commit that referenced this pull request Oct 27, 2025
- bal -> block_access_list; re-add custom rlp encoding for block access list
- bytes to uint
- move away from method-style

- Update EIP-7928 implementation: system contracts at index 0, migrate to RLP
  - System contracts (parent hash, beacon root) now use block_access_index 0
  - Transactions use block_access_index 1 to len(transactions)
  - Post-execution changes use block_access_index len(transactions) + 1
  - Migrated from SSZ to RLP encoding as per updated EIP-7928 spec
  - Updated all tests to match new API and structure
  - Replaced tx_index with block_access_index throughout codebase

- add system contract logic
- add markdown docstrings
- update BAL format; address comments
- ssz encoding and bal validation
- six ssz types
- bal tests
- balspecs

fix: do not track setting empty code to a new account (#19)
fix: track implicit SLOAD within SSTORE for OOG cases (#18)
refactor: Put back explicit acct tracking outside of 7702 delegation path (#17)
fix non-tracked 7702 authority for invalid delegations (#16)
    * fix non-tracked 7702 authority for invalid delegations
    * fix: lint issues
    * fix: track delegation target when loaded as call target
    * fix: track delegation target when loaded as call target from call opcodes
    * chore: fix issues with documentation generation

Fix self-destruct cases with pre-execution balance cache / tracking
    * fix self-destruct implementation
    * fix self-destruct tracking balance
    * fix it in the bal finalization by filtering
    * add balance reset and fix tests
    * simplify pre-balance tracking not using snapshots

fix duplicated code entries for in transaction self destruct
fix self destruct in same transaction bug
fix call/delagate call tracking bug
fix zero-value transfer tracking (#6)
    * fix zero-value transfer tracking
    * fix reverted frame tracking
    * rename variables
    * fix missing addresses bug
    * fix: docs run & move imports to top of file

refactor: move rlp_utils to block_access_lists; bal -> block_access_lists
Some remaining fixes due to large refactor in `forks/osaka`:

- Move BALs from amsterdam -> forks/amsterdam
- rename: build -> build_block_access_list
- fix docc issues

move state change tracker to State

correct system contract addresses

Fixes to communicate with BALs EEST branch:

- fix(bal): Initialize the state tracker before system contract calls

- We were missing system contract calls to beacon roots and history
  contracts. This change initializes the state tracker before system
  contract calls and passes the tracker to these calls if post-Amsterdam.

- fix(docs): Fix issues with toxenvs: lint, doc, json_infra
- fix(t8n): Only initialize the bal_change_tracker for amsterdam
- feat(fork criteria): Index upcoming forks for better ordering / fix issues
- chore(forks): Fix issues from lint after rebase with Osaka latest
- fix(setuptools): Update packages to include amsterdam
- chore(lint): Fix 'tox -e static' issues

- Fix bug in tracker
  Manually cherry-picked from e72991b
  Author: nerolation

- chore(tests): Attempt to resolve issues with CI tests
- chore(lint): fix issues from running ``tox -e static`` locally
- refactor(bal): Send BAL as a list over t8n tool
- fix(amsterdam): Add change tracker to state test in t8n
- chore(lint,tests): Fix tests after moving bal from osaka -> amsterdam
- chore(forks): Move bals from Osaka to Amsterdam
- chore(lint): Fix lint issues

- refactor(bal): Send the full bal object and bal_hash over t8n

  - If we send the full object over JSON, we can model_validate() on ESST.
  - If we send the hash, once we fill the pydantic model, we can get the rlp
    and the hash and validate that our objects match while only really
    validating the parts of the BAL we are interested in for each test.

- chore: point to working eest branch
- chore(bals): Remove unused SSZ utils.py
  The SSZ implementation is no longer needed as we are now using RLP
- refactor(bals): Clean up BAL module types and imports
  - Bytes -> Bytes32 type for storage slots
  - Remove unused imports / fix imports / fix linting
  - Update function signatures to match tracker

- fix(bals-tx-index): Track bal indexes in t8n
  Keep track of BAL index state in t8n as is done in the Osaka ``fork.py`` implementation.
fselmo pushed a commit that referenced this pull request Oct 27, 2025
- bal -> block_access_list; re-add custom rlp encoding for block access list
- bytes to uint
- move away from method-style

- Update EIP-7928 implementation: system contracts at index 0, migrate to RLP
  - System contracts (parent hash, beacon root) now use block_access_index 0
  - Transactions use block_access_index 1 to len(transactions)
  - Post-execution changes use block_access_index len(transactions) + 1
  - Migrated from SSZ to RLP encoding as per updated EIP-7928 spec
  - Updated all tests to match new API and structure
  - Replaced tx_index with block_access_index throughout codebase

- add system contract logic
- add markdown docstrings
- update BAL format; address comments
- ssz encoding and bal validation
- six ssz types
- bal tests
- balspecs

fix: do not track setting empty code to a new account (#19)
fix: track implicit SLOAD within SSTORE for OOG cases (#18)
refactor: Put back explicit acct tracking outside of 7702 delegation path (#17)
fix non-tracked 7702 authority for invalid delegations (#16)
    * fix non-tracked 7702 authority for invalid delegations
    * fix: lint issues
    * fix: track delegation target when loaded as call target
    * fix: track delegation target when loaded as call target from call opcodes
    * chore: fix issues with documentation generation

Fix self-destruct cases with pre-execution balance cache / tracking
    * fix self-destruct implementation
    * fix self-destruct tracking balance
    * fix it in the bal finalization by filtering
    * add balance reset and fix tests
    * simplify pre-balance tracking not using snapshots

fix duplicated code entries for in transaction self destruct
fix self destruct in same transaction bug
fix call/delagate call tracking bug
fix zero-value transfer tracking (#6)
    * fix zero-value transfer tracking
    * fix reverted frame tracking
    * rename variables
    * fix missing addresses bug
    * fix: docs run & move imports to top of file

refactor: move rlp_utils to block_access_lists; bal -> block_access_lists
Some remaining fixes due to large refactor in `forks/osaka`:

- Move BALs from amsterdam -> forks/amsterdam
- rename: build -> build_block_access_list
- fix docc issues

move state change tracker to State

correct system contract addresses

Fixes to communicate with BALs EEST branch:

- fix(bal): Initialize the state tracker before system contract calls

- We were missing system contract calls to beacon roots and history
  contracts. This change initializes the state tracker before system
  contract calls and passes the tracker to these calls if post-Amsterdam.

- fix(docs): Fix issues with toxenvs: lint, doc, json_infra
- fix(t8n): Only initialize the bal_change_tracker for amsterdam
- feat(fork criteria): Index upcoming forks for better ordering / fix issues
- chore(forks): Fix issues from lint after rebase with Osaka latest
- fix(setuptools): Update packages to include amsterdam
- chore(lint): Fix 'tox -e static' issues

- Fix bug in tracker
  Manually cherry-picked from e72991b
  Author: nerolation

- chore(tests): Attempt to resolve issues with CI tests
- chore(lint): fix issues from running ``tox -e static`` locally
- refactor(bal): Send BAL as a list over t8n tool
- fix(amsterdam): Add change tracker to state test in t8n
- chore(lint,tests): Fix tests after moving bal from osaka -> amsterdam
- chore(forks): Move bals from Osaka to Amsterdam
- chore(lint): Fix lint issues

- refactor(bal): Send the full bal object and bal_hash over t8n

  - If we send the full object over JSON, we can model_validate() on ESST.
  - If we send the hash, once we fill the pydantic model, we can get the rlp
    and the hash and validate that our objects match while only really
    validating the parts of the BAL we are interested in for each test.

- chore: point to working eest branch
- chore(bals): Remove unused SSZ utils.py
  The SSZ implementation is no longer needed as we are now using RLP
- refactor(bals): Clean up BAL module types and imports
  - Bytes -> Bytes32 type for storage slots
  - Remove unused imports / fix imports / fix linting
  - Update function signatures to match tracker

- fix(bals-tx-index): Track bal indexes in t8n
  Keep track of BAL index state in t8n as is done in the Osaka ``fork.py`` implementation.
fselmo pushed a commit that referenced this pull request Oct 27, 2025
- bal -> block_access_list; re-add custom rlp encoding for block access list
- bytes to uint
- move away from method-style

- Update EIP-7928 implementation: system contracts at index 0, migrate to RLP
  - System contracts (parent hash, beacon root) now use block_access_index 0
  - Transactions use block_access_index 1 to len(transactions)
  - Post-execution changes use block_access_index len(transactions) + 1
  - Migrated from SSZ to RLP encoding as per updated EIP-7928 spec
  - Updated all tests to match new API and structure
  - Replaced tx_index with block_access_index throughout codebase

- add system contract logic
- add markdown docstrings
- update BAL format; address comments
- ssz encoding and bal validation
- six ssz types
- bal tests
- balspecs

fix: do not track setting empty code to a new account (#19)
fix: track implicit SLOAD within SSTORE for OOG cases (#18)
refactor: Put back explicit acct tracking outside 7702 delegation path (#17)
fix non-tracked 7702 authority for invalid delegations (#16)
    * fix non-tracked 7702 authority for invalid delegations
    * fix: lint issues
    * fix: track delegation target when loaded as call target
    * fix: track delegation target when loaded as call target from call
      opcodes
    * chore: fix issues with documentation generation

Fix self-destruct cases with pre-execution balance cache / tracking
    * fix self-destruct implementation
    * fix self-destruct tracking balance
    * fix it in the bal finalization by filtering
    * add balance reset and fix tests
    * simplify pre-balance tracking not using snapshots

fix duplicated code entries for in transaction self destruct
fix self destruct in same transaction bug
fix call/delagate call tracking bug
fix zero-value transfer tracking (#6)
    * fix zero-value transfer tracking
    * fix reverted frame tracking
    * rename variables
    * fix missing addresses bug
    * fix: docs run & move imports to top of file

refactor: move rlp_utils to block_access_lists; bal -> block_access_lists
Some remaining fixes due to large refactor in `forks/osaka`:

- Move BALs from amsterdam -> forks/amsterdam
- rename: build -> build_block_access_list
- fix docc issues

move state change tracker to State

correct system contract addresses

Fixes to communicate with BALs EEST branch:

- fix(bal): Initialize the state tracker before system contract calls

- We were missing system contract calls to beacon roots and history
  contracts. This change initializes the state tracker before system
  contract calls and passes the tracker to these calls if post-Amsterdam.

- fix(docs): Fix issues with toxenvs: lint, doc, json_infra
- fix(t8n): Only initialize the bal_change_tracker for amsterdam
- feat(fork criteria): Index upcoming forks for better ordering / fix issues
- chore(forks): Fix issues from lint after rebase with Osaka latest
- fix(setuptools): Update packages to include amsterdam
- chore(lint): Fix 'tox -e static' issues

- Fix bug in tracker
  Manually cherry-picked from e72991b
  Author: nerolation

- chore(tests): Attempt to resolve issues with CI tests
- chore(lint): fix issues from running ``tox -e static`` locally
- refactor(bal): Send BAL as a list over t8n tool
- fix(amsterdam): Add change tracker to state test in t8n
- chore(lint,tests): Fix tests after moving bal from osaka -> amsterdam
- chore(forks): Move bals from Osaka to Amsterdam
- chore(lint): Fix lint issues

- refactor(bal): Send the full bal object and bal_hash over t8n

  - If we send the full object over JSON, we can model_validate() on ESST.
  - If we send the hash, once we fill the pydantic model, we can get the rlp
    and the hash and validate that our objects match while only really
    validating the parts of the BAL we are interested in for each test.

- chore: point to working eest branch
- chore(bals): Remove unused SSZ utils.py
  The SSZ implementation is no longer needed as we are now using RLP
- refactor(bals): Clean up BAL module types and imports
  - Bytes -> Bytes32 type for storage slots
  - Remove unused imports / fix imports / fix linting
  - Update function signatures to match tracker

- fix(bals-tx-index): Track bal indexes in t8n
  Keep track of BAL index state in t8n
fselmo pushed a commit that referenced this pull request Oct 31, 2025
- bal -> block_access_list; re-add custom rlp encoding for block access list
- bytes to uint
- move away from method-style

- Update EIP-7928 implementation: system contracts at index 0, migrate to RLP
  - System contracts (parent hash, beacon root) now use block_access_index 0
  - Transactions use block_access_index 1 to len(transactions)
  - Post-execution changes use block_access_index len(transactions) + 1
  - Migrated from SSZ to RLP encoding as per updated EIP-7928 spec
  - Updated all tests to match new API and structure
  - Replaced tx_index with block_access_index throughout codebase

- add system contract logic
- add markdown docstrings
- update BAL format; address comments
- ssz encoding and bal validation
- six ssz types
- bal tests
- balspecs

fix: do not track setting empty code to a new account (#19)
fix: track implicit SLOAD within SSTORE for OOG cases (#18)
refactor: Put back explicit acct tracking outside 7702 delegation path (#17)
fix non-tracked 7702 authority for invalid delegations (#16)
    * fix non-tracked 7702 authority for invalid delegations
    * fix: lint issues
    * fix: track delegation target when loaded as call target
    * fix: track delegation target when loaded as call target from call
      opcodes
    * chore: fix issues with documentation generation

Fix self-destruct cases with pre-execution balance cache / tracking
    * fix self-destruct implementation
    * fix self-destruct tracking balance
    * fix it in the bal finalization by filtering
    * add balance reset and fix tests
    * simplify pre-balance tracking not using snapshots

fix duplicated code entries for in transaction self destruct
fix self destruct in same transaction bug
fix call/delagate call tracking bug
fix zero-value transfer tracking (#6)
    * fix zero-value transfer tracking
    * fix reverted frame tracking
    * rename variables
    * fix missing addresses bug
    * fix: docs run & move imports to top of file

refactor: move rlp_utils to block_access_lists; bal -> block_access_lists
Some remaining fixes due to large refactor in `forks/osaka`:

- Move BALs from amsterdam -> forks/amsterdam
- rename: build -> build_block_access_list
- fix docc issues

move state change tracker to State

correct system contract addresses

Fixes to communicate with BALs EEST branch:

- fix(bal): Initialize the state tracker before system contract calls

- We were missing system contract calls to beacon roots and history
  contracts. This change initializes the state tracker before system
  contract calls and passes the tracker to these calls if post-Amsterdam.

- fix(docs): Fix issues with toxenvs: lint, doc, json_infra
- fix(t8n): Only initialize the bal_change_tracker for amsterdam
- feat(fork criteria): Index upcoming forks for better ordering / fix issues
- chore(forks): Fix issues from lint after rebase with Osaka latest
- fix(setuptools): Update packages to include amsterdam
- chore(lint): Fix 'tox -e static' issues

- Fix bug in tracker
  Manually cherry-picked from e72991b
  Author: nerolation

- chore(tests): Attempt to resolve issues with CI tests
- chore(lint): fix issues from running ``tox -e static`` locally
- refactor(bal): Send BAL as a list over t8n tool
- fix(amsterdam): Add change tracker to state test in t8n
- chore(lint,tests): Fix tests after moving bal from osaka -> amsterdam
- chore(forks): Move bals from Osaka to Amsterdam
- chore(lint): Fix lint issues

- refactor(bal): Send the full bal object and bal_hash over t8n

  - If we send the full object over JSON, we can model_validate() on ESST.
  - If we send the hash, once we fill the pydantic model, we can get the rlp
    and the hash and validate that our objects match while only really
    validating the parts of the BAL we are interested in for each test.

- chore: point to working eest branch
- chore(bals): Remove unused SSZ utils.py
  The SSZ implementation is no longer needed as we are now using RLP
- refactor(bals): Clean up BAL module types and imports
  - Bytes -> Bytes32 type for storage slots
  - Remove unused imports / fix imports / fix linting
  - Update function signatures to match tracker

- fix(bals-tx-index): Track bal indexes in t8n
  Keep track of BAL index state in t8n
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