babylonchain / babylon

Main repo for Babylon full node
https://babylonchain.io
Other
239 stars 165 forks source link

fix: execute `PreBlocker` for upgrade module #707

Closed SebastianElvis closed 3 months ago

SebastianElvis commented 3 months ago

This PR fixes a bug to execute PreBlocker for the upgrade module, such that the chain will handle software upgrade logic properly (i.e., at the upgrade height, the old version panicks, while the new version handles the upgrade logic and makes progress). This PR also refactors the vanilla upgrade for testing purposes.

As Babylon has a PreBlocker in the proposal handler (for BTC timestamping), this PR has taken care of this by appending checkpointing module's PreBlocker after the upgrade modules'.

Test plan: https://babylon-chain.atlassian.net/wiki/spaces/BABYLON/pages/340721842/PoC+for+software+upgrade+with+arbitrary+state+update. Testing this e2e requires significant amount of work that is out of this PR's scope, so suggest we do this in subsequent PRs.