-
Notifications
You must be signed in to change notification settings - Fork 212
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
Reboot SwingSet on bulldozer upgrade #7684
Conversation
suggsest: refs #6644 |
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.
LGTM with the changes below - except for the Dockerfile changes which I can't really speak to.
@@ -794,7 +794,21 @@ func upgrade10Handler(app *GaiaApp, targetUpgrade string) func(sdk.Context, upgr | |||
app.VstorageKeeper.MigrateNoDataPlaceholders(ctx) // upgrade-10 only | |||
normalizeProvisionAccount(ctx, app.AccountKeeper) | |||
|
|||
return app.mm.RunMigrations(ctx, app.configurator, fromVm) | |||
mvm, err := app.mm.RunMigrations(ctx, app.configurator, fromVm) |
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.
Check if err is non-nil here, and if so return. We don't want to proceed with swingset initialization in this case.
golang/cosmos/app/app.go
Outdated
if err2 != nil { | ||
// NOTE: A failed BOOTSTRAP_BLOCK means that the SwingSet state is inconsistent. | ||
// Panic here, in the hopes that a replay from scratch will fix the problem. | ||
panic(err) |
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.
Should be err2
, but if you return on error right after RunMigrations()
above, you can just reuse err
and this line will be correct.
1704044
to
3bb75e3
Compare
refs: #6644
Description
When upgrading to
agoric-upgrade-10
, SwingSet will be reinitialized. This PR adds that initialization to the upgrade handler so that it completes during upgrade before any new blocks are produced.Security Considerations
Improves security:
Scaling Considerations
Avoids costly upgrade work impacting blocks beyond the upgrade block itself.
Documentation Considerations
Testing Considerations