-
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
): support for multi-block depth reorgs in Anvil
#7368
Comments
this would be nice to have indeed. we need to come up with a solution that makes the behaviour derivable from the rpc request. I think the most powerful method would be to give the user control over how to rearrange the blocks. although I'm not sure what the best ergonomics would look like here maybe a function that reorgs x number of blocks, returning those blocks, then the user can manually construct the new chain, but this is a bit cumbersome and could be combined into a single call, though the question here is what rules the reorg should follow:
what else? |
hmmm as to what "rules" the reorg should follow, i think the best possible method would be to
Does that make sense or would that be too cumbersome? |
i think that makes sense |
Thanks! |
anvil
): support for multi-block depth reorgs in Anvil
Hey @zerosnacks, I'd love to take this one please. |
Hey @EdwardJES would you like to collaborate on this? |
Hey @ameya-deshmukh, I'm happy to take the development on this one. I could have a draft PR up in the next coming days that will build towards the interface you've suggested above. Your early feedback on it would be greatly appreciated🙏 |
Hey @ameya-deshmukh, @zerosnacks, @mattsse this one is ready for review at your earliest convenience #8489. Tyvm 🙏 |
Hi guys, very pleased to see that Foundry will soon support the testing function of reorg! I wonder would the simulation of reorg include resending events being affected by reorg with the |
Component
Anvil
Describe the feature you would like
Add support for simulating reorgs of multiple block depths (n ≥ 1) in Anvil, enabling developers to thoroughly test smart contracts and infrastructure against reorg scenarios.
Example of a 3-block deep reorg:
Additional discussion and insights are sought from @mattsse on how best to implement this feature, including:
Additional context
Reorgs can cause critical infrastructure to break if not handled correctly. Implementing a testing framework for multi-block depth reorgs in Anvil would help mitigate these risks and promote best practices in reorg testing. This issue is inspired from issue 1799.
The text was updated successfully, but these errors were encountered: