Governance
Who cleans up the code? SETCODEFROM's dangling bytecode and futureproof design choices
Publication: Ethereum Research - Latest topics
Author: CPerezz
Source published: 06/10/2026, 21:00:56 UTC
Briefing created: 07/10/2026, 01:38:21 UTC
Based on a feed excerpt; full article content has not been acquired. Source evidence retrieved 06/10/2026, 21:13:25 UTC.
Briefings
SETCODEFROM and the partitioned binary tree (PBT) design allow Ethereum clients to keep bytecode that no account points to, turning dangling code into a consensus decision. Unlike previous mechanisms requiring reference counts, PBT stores one copy per code hash, ensuring that if the last account holding a code chunk upgrades it, the old code has no holder and must be removed from the state root. This design was proposed for Hegotà and is currently in draft 8297, with 27,869 dangling codes on full-synced nodes as of Cancun. The evidence indicates that while reverts and reorgs previously caused code to persist, only Nethermind and reorgs currently leave code behind, making SETCODEFROM a critical design choice for future-proofing.
Key points
- SETCODEFROM and the partitioned binary tree (PBT) allow clients to keep bytecode that no account points to, turning dangling code into a consensus decision by storing one copy per code hash.
- Under PBT, removing code requires exactly the count nobody keeps, ensuring that if the last account holding a code chunk upgrades it, the old code has no holder and must be removed from the state root.
Context and limitations
Evidence covers only the Cancun era and pre-EIP-8369 state; full node state size estimates are approximate; specific implementation details of SETCODEFROM's source code are unavailable.
Generated by Bittrees-hosted qwen35-2b sha256:aaf42c8b7c3c on 07/10/2026, 01:38:21 UTC. Based on publisher-provided feed evidence; may not cover the full original article. Check the source for details.
View archived briefing on IPFS
bafybeibc5xmzox6572oh2vqj72mmdbuiiywq3qhsli63f4yqk67amxuita