state: build_diff() reports deletions for accounts that never existed
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- cpp
- Ambito
- blockchain
Direzione di ricerca
Start at build_diff() in test/state/state.cpp (the erase_if_empty / deleted_accounts path around the linked lines). Reproduce with state_transition.tx_legacy and state_transition.touch_nonexistent_sd, then add the pre.contains check on receipt.state_diff.deleted_accounts (fails 28/132). Decide a flag or skip for accounts inserted only because they were touched; #1717’s in_diff expectation can pin the chosen behaviour. Done when those accounts are not listed as deleted and related modified_accounts TODOs are considered.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
#1709 fixed one instance of this: an account warmed up by a cold access and then reverted was reported in StateDiff::deleted_accounts. The artifact still appears when the account is inserted some other way and ends up empty.
The shortest case is a transaction to an address that does not exist — state_transition.tx_legacy, where 0xc0de is not in the pre-state:
tx.to = To; // no code, no value
execute_message() inserts the recipient with erase_if_empty, it ends empty, and build_diff() puts it in deleted_accounts. Same for a non-existent SELFDESTRUCT beneficiary (state_transition.touch_nonexistent_sd, 0x4e).
build_diff() skips m.nonexistent (set only when a revert restores the account) and m.just_created (set only by CREATE). There is no flag for "inserted because it was touched", so these fall through to the erase_if_empty branch.
As with #1709 the state is correct — applying such a delete is a no-op — so only the diff is affected.
Scale: adding this to the state_transition fixture fails 28 of 132 tests on master:
for (const auto& a : receipt.state_diff.deleted_accounts)
EXPECT_TRUE(pre.contains(a)) << a << ": deleted, never existed";
Related, and already noted in the TODO below: modified_accounts also lists accounts that were only read or warmed, with nonce and balance unchanged — e.g. state_transition.touch_access_list_storage_only, where 0x5a is warmed by the access list alone.
#1717 adds an in_diff expectation to the state_transition fixture, which can be used to pin down whatever behaviour is decided here.
- Lingua principale
- C++
- Stelle
- 979
- Fork
- 340
- Merge medio
- 12h 16m
- PR unite (30g)
- 25
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ipsilon/evmone
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ipsilon/evmone
Issue simili
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
phantoslayer21/wronggpu#275 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
ReyeMe/SaturnRingLib#155 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Nheko-Reborn/nheko#2092 ·
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
isocpp/CppCoreGuidelines#2345 ·