Unifying anvil_reorg
and anvil_rollback
#10267
spalladino
started this conversation in
Ideas
Replies: 2 comments
-
bonus points: fix the WS api, right now the |
Beta Was this translation helpful? Give feedback.
0 replies
-
@jorgemmsilva that'd be great, but one step at a time. I'm waiting for green light from a maintainer before going forward! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Looking into how to simulate reorgs in Anvil, I found two methods:
anvil_reorg(depth, new_txs)
, implemented by @tsnewnami will rollbackdepth
blocks, and create new ones in their place, optionally using txs provided.anvil_rollback(depth)
, implemented by @jorgemmsilva, will rollbackdepth
blocks.Aside from being quite similar, there is no method to reorg N blocks and add M blocks in their place (with N != M), since
anvil_reorg
will guarantee the block height is preserved.Would it make sense to invest effort in unifying the two methods, and allowing to mine a customisable amount of blocks? So instead of having the following, where always
depth
new blocks are mined:Have something like:
Assuming there is appetite for a change like this, would it be best to implement as a new method, or to break compatibility and replace the existing
anvil_reorg
?Beta Was this translation helpful? Give feedback.
All reactions