Negative refund counter after an authorization destroys an empty account with storage

Aperta
#4,095 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start by tracing how process_message_call passes the refund counter and how modify_state, authorization handling, and SSTORE accounting affect the described transaction. Reproduce the case with the stated authorization sequence and storage pre-state, then determine whether the state should be excluded or the counter clamped. Done means the project has a defined outcome for this case and a regression test covering it.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

From Prague, the refund counter that process_message_call passes on can be negative. Then U256(evm.refund_counter) raises, so the transaction has no defined outcome.

It needs a pre-state with an empty account that holds storage, which EIP-7523 excludes on mainnet. The state model and test fixtures do not exclude it.

Steps, with an authority A that has nonce 0, balance 0, no code and slot k = 1:

  1. A type 4 transaction carries two authorizations from A: nonce 0 to the zero address, then nonce 1 to a contract D.
  2. The first set_code leaves A empty, so modify_state destroys it with its storage. Then increment_nonce gives it nonce 1.
  3. The second authorization delegates A to D, whose code writes 1 at slot k.
  4. The transaction calls A. The SSTORE sees original 1 (A is not in created_accounts), current 0 and new 1. Its refund is -4800 + 2800 = -2000, and no earlier write added the 4800.

The frame succeeds with a refund counter of -2000.

Should such pre-states be ruled out, or should the counter be clamped at 0?

Lingua principale
Python
Stelle
1.2k
Fork
543
Merge medio
2g 19h
PR unite (30g)
81

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ethereum/execution-specs

Tutte le issue di ethereum/execution-specs

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.