-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pool: Handle reorgs #87
Comments
Since the builder does validation again before submitting it on chain, the impact here should be minimal right? Though I'm not super familiar with the effects of re-orgs more generally |
The problem is that a UO might get mined in a block, removed from the mempool, and then the chain re-orgs to and the UO is no longer mined. Since we removed the UO from the pool, its lost forever. |
oh I see, that makes sense. Is this something that's mitigated by waiting for some N number of confirmations or is there some other approach that needs to be taken to handle this? |
I'm planning on looking at Geth/Reth for inspiration. Its possible they don't try to handle this at all and just rely on the wallet layer to resubmit if they notice their transaction has been dropped. If that's the case I'll likely push this out to a later release (I actually think this is going to be the case). To mitigate this we would have to wait for some notion of "finality" in the L1 blocks (applies to both L1 and L2s that post data there). L1 ethereum has |
Looks like Geth handles it here: https://github.com/ethereum/go-ethereum/blob/2d1492821d058a3488b4da2c1f62906eaf6d7c95/core/txpool/txpool.go#L1292 |
To summarize Geth's approach:
|
Geth doesn't hold any extra state besides this block database and can removes included transactions from its pool when it gets a new block header. If a reorg is detected it can recover the transaction from the reorg-ed block's transactions. We can take a similar approach. The user operations that are no longer included will be held in the block's transaction data and can be recovered there. |
General idea that we should pursue:
From Dror in the 4337 Bundlers TG:
|
From what I can tell Reth doesn't handle reorgs. Some discussion here paradigmxyz/reth#662 but more related to the database. Asking in their TG and my start a discussion post. |
Added an issue to Reth here: paradigmxyz/reth#2040 |
Reth's implementation: paradigmxyz/reth#2298 |
Closed by #276 |
No description provided.
The text was updated successfully, but these errors were encountered: