You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes when I have a snapshot I'd like to replay those blocks against the state machine. This would allow teams that modify events and/or data to not have to replay from genesis.
Problem Definition
Currently to replay a specific block in the past you must either find a snapshot before the height or resync from genesis. There is the potential for comsprund to help with this but it would need modifications in the sdk.
Proposal
If I have a snapshot or db with 1m blocks I'd like the ability to replay the last 500k against the application. This would utilize the replay functionality of a node but instead of the network sending me blocks I would use the local db.
yea, that is the idea. replay would be very fast and people would be able to reconstruct events without needing to have tx_index.db around. This would save space on snapshots. The only issue is you can only replay from the latest upgrade height
The only issue is you can only replay from the latest upgrade height
unless using cosmovisor and update the symbolic link manually I guess.
And there's a quick way to rollback, which is set the latest version in rootmulti metadata directly, that probably work if replaying don't get a different root-hash.
The only issue is you can only replay from the latest upgrade height
unless using cosmovisor and update the symbolic link manually I guess.
Would it not be possible to just swap out the state-machine/app part depending on block height instead of using cosmovisor and swapping out the whole binary? That would be cleaner in many ways anyways.
Unless there was a breaking change in cometBFT that would enable replaying from a single binary even if there was an upgrade.
Would it not be possible to just swap out the state-machine/app part depending on block height instead of using cosmovisor and swapping out the whole binary?
you can but your node needs to have comet and sdk as two separate processes. this is a simple thing to do in the sdk currently
I think it could even be done in-process. Comet or the SDK just need to know from which height onwards things change in the state machine or in comet itself. Though I guess if the changes were only in the state machine the new code-path could live only in the state machine anyways (with no changes to comet). Things become trickier if there are breaking changes in comet. Let's chat more about this in person.
Hi @tac0turtle, just catching up on old issues. Sorry this been sitting here for a while. I believe you mentioned in other channels the desire to have this feature. But just reading it through it seems to be more complicated than anticipated and might need coordination between Comet or the SDK and would be interesting to gather more feedback from operators on the benefits of implementing this issue.
Should we close this issue and open a discussion ?
Activity
spec: migrate v0.7.1. into v0.34 (#9262)
yihuang commentedon Mar 14, 2023
If you can rollback app state by 500k blocks, it'll replay local blocks automatically on restart?
tac0turtle commentedon Mar 15, 2023
yea, that is the idea. replay would be very fast and people would be able to reconstruct events without needing to have tx_index.db around. This would save space on snapshots. The only issue is you can only replay from the latest upgrade height
yihuang commentedon Mar 15, 2023
unless using cosmovisor and update the symbolic link manually I guess.
And there's a quick way to rollback, which is set the latest version in rootmulti metadata directly, that probably work if replaying don't get a different root-hash.
liamsi commentedon Mar 20, 2023
Would it not be possible to just swap out the state-machine/app part depending on block height instead of using cosmovisor and swapping out the whole binary? That would be cleaner in many ways anyways.
Unless there was a breaking change in cometBFT that would enable replaying from a single binary even if there was an upgrade.
tac0turtle commentedon Mar 20, 2023
you can but your node needs to have comet and sdk as two separate processes. this is a simple thing to do in the sdk currently
liamsi commentedon Mar 20, 2023
I think it could even be done in-process. Comet or the SDK just need to know from which height onwards things change in the state machine or in comet itself. Though I guess if the changes were only in the state machine the new code-path could live only in the state machine anyways (with no changes to comet). Things become trickier if there are breaking changes in comet. Let's chat more about this in person.
tac0turtle commentedon Mar 20, 2023
oh sorry, wasnt thinking in that context, was thinking in todays code path. Agree with you
andynog commentedon Nov 9, 2023
Hi @tac0turtle, just catching up on old issues. Sorry this been sitting here for a while. I believe you mentioned in other channels the desire to have this feature. But just reading it through it seems to be more complicated than anticipated and might need coordination between Comet or the SDK and would be interesting to gather more feedback from operators on the benefits of implementing this issue.
Should we close this issue and open a discussion ?
tac0turtle commentedon Nov 10, 2023
the issue seems fairly well outlined, what do you feel like is missing that a discussion is needed?