-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(anvil): 7368 reorg #8489
feat(anvil): 7368 reorg #8489
Conversation
Hey @zerosnacks, @mattsse I've had a go at trying to implement this, from what I can see the logic seems to be sound. However, there are likely some edge cases that were missed, or more efficient code paths could have been taken. I would also appreciate any feedback on the ergonomics of this API. What are your thoughts on supplying a JSON file where each object is Thank you 🙏 |
hey @EdwardJES sorry for missing the pings... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty, I think we can get this supported in some form, but I have some suggestions questions re implementation.
This is supposed to delete a given number of blocks and re-execute transactions to form a new chain, right?
so is this effectively multiple sequential calls of
foundry/crates/anvil/src/eth/backend/mem/mod.rs
Lines 929 to 932 in f2518c9
async fn do_mine_block( | |
&self, | |
pool_transactions: Vec<Arc<PoolTransaction>>, | |
) -> MinedBlockOutcome { |
after blocks and their state have been removed?
I feel like we can simplify a few things here
Hey @mattsse, this is ready for another review. I've simplified the logic that touches storage, but struggled to simplify the logic of transforming the Here is an example payload if you'd like to try it out tyvm 🙏
|
Hey @zerosnacks, @mattsse, could I please get another round of reviews at your earliest convenience? 🙏 Tyvm. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last few nits, otherwise I think this should work.
sorry for the delay
d9c0ffc
to
cddc619
Compare
Thank you @mattsse, I think this is ready for a final review now. |
cddc619
to
df62b3a
Compare
df62b3a
to
d02b291
Compare
Sorry @mattsse, last bump on this one 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
last nits
sorry for taking so long...
1bfa2e1
to
2bcc593
Compare
707dfbe
to
adb438e
Compare
No problems @mattsse, thanks for your help. That should be the last of the nits 🙏 |
Is this should add doc to book? |
That would be great, feel free to open a PR documenting it |
Hi guys , |
closes #7368
Motivation
Chain reorgs are an unavoidable part of the Ethereum PoS network, and applications should be tolerant to them. L2's also often rely on Ethereum for their finality, such as OP and the derivation pipeline. Having functionality to test reorgs is an important part of building fault-tolerant and resilient systems. What happens when your indexer reorgs? How will you relayer service handle duplicate nonces being consumed? Should the reorged relay transactions be resubmitted? Any service that has side effects from chain state needs to be tested against reorg scenarios.
Solution