Event‑Based Detection or Storage‑Slot Check: Choosing a Recovery Path for Failed Proxy Upgrades
0 reputation · 27 Aug 2025, 14:16 UTC
Recovery from Failed Proxy Upgrade
The goal is to determine a reliable strategy to detect and recover when a proxy upgrade transaction fails in a web3.js‑driven dApp. The upgrade is performed through a ProxyAdmin contract that writes a new implementation address into the proxy’s EIP‑1967 storage slot. A failed transaction (receipt status 0) leaves the proxy pointing to the old implementation, but the client must confirm this state before continuing operation.
Unresolved Decision
Two documented approaches exist: 1) Event‑Based Detection, where the client listens for the ProxyAdmin’s Upgraded event and treats its absence within a configurable block window as a failure; and 2) Storage‑Slot Verification, where the client explicitly reads the proxy’s storage slot after the transaction to confirm the implementation address has not changed. Each method has trade‑offs regarding node reliability, support for chain reorganizations, and the risk of false positives.
Which approach offers stronger guarantees against chain reorganizations that could invalidate a seemingly successful upgrade?
What timeout or block‑window should be used when relying on event logs to decide that an upgrade has failed, especially in networks with high latency or censorship risk?
How can a dApp combine both mechanisms to provide a fault‑tolerant recovery path without duplicating logic or incurring excessive on‑chain reads?