@agoric/cosmos 0.34.2-dev-57db88d.0.57db88d → 0.34.2-dev-2362584.0.2362584
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/app.go +13 -2
- package/app/upgrade.go +29 -0
- package/git-revision.txt +1 -1
- package/package.json +2 -2
package/app/app.go
CHANGED
|
@@ -1008,9 +1008,20 @@ func normalizeModuleAccount(ctx sdk.Context, ak authkeeper.AccountKeeper, name s
|
|
|
1008
1008
|
ak.SetModuleAccount(ctx, ma)
|
|
1009
1009
|
}
|
|
1010
1010
|
|
|
1011
|
+
// vatOptionUpdate is an in-place change to a single running vat's persisted
|
|
1012
|
+
// options, applied by cosmic-swingset at the reboot point of a software
|
|
1013
|
+
// upgrade. Selection is by exact VatID; currently only Critical is supported
|
|
1014
|
+
// (promote a contract vat so its termination halts the chain instead of
|
|
1015
|
+
// severing it).
|
|
1016
|
+
type vatOptionUpdate struct {
|
|
1017
|
+
VatID string `json:"vatID"`
|
|
1018
|
+
Critical *bool `json:"critical,omitempty"`
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1011
1021
|
type upgradeDetails struct {
|
|
1012
|
-
Plan
|
|
1013
|
-
CoreProposals
|
|
1022
|
+
Plan upgradetypes.Plan `json:"plan"`
|
|
1023
|
+
CoreProposals *vm.CoreProposals `json:"coreProposals,omitempty"`
|
|
1024
|
+
VatOptionUpdates []vatOptionUpdate `json:"vatOptionUpdates,omitempty"`
|
|
1014
1025
|
}
|
|
1015
1026
|
|
|
1016
1027
|
type cosmosInitAction struct {
|
package/app/upgrade.go
CHANGED
|
@@ -193,6 +193,15 @@ func makeUnreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) upgradetyp
|
|
|
193
193
|
|
|
194
194
|
CoreProposalSteps := []vm.CoreProposalStep{}
|
|
195
195
|
|
|
196
|
+
// vatOptionUpdates are in-place per-vat option changes handed to
|
|
197
|
+
// cosmic-swingset to apply at this upgrade's reboot point. Unlike the
|
|
198
|
+
// CoreProposalSteps below, they are not core-evals: there is no
|
|
199
|
+
// supported runtime path for a core-eval to flip an already-running
|
|
200
|
+
// vat's `critical` flag, so this writes the kernel kvStore directly
|
|
201
|
+
// (applyVatOptionUpdates, packages/SwingSet/src/controller/
|
|
202
|
+
// upgradeSwingset.js). Chain selection lives here, cosmos-side.
|
|
203
|
+
var vatOptionUpdates []vatOptionUpdate
|
|
204
|
+
|
|
196
205
|
// These CoreProposalSteps are not idempotent and should only be executed
|
|
197
206
|
// as part of the first upgrade using this handler on any given chain.
|
|
198
207
|
if isFirstTimeUpgradeOfThisVersion(app, ctx) {
|
|
@@ -243,6 +252,24 @@ func makeUnreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) upgradetyp
|
|
|
243
252
|
}
|
|
244
253
|
CoreProposalSteps = append(CoreProposalSteps, terminationStep)
|
|
245
254
|
}
|
|
255
|
+
|
|
256
|
+
// Promote the running ymax contract vat to `critical`. These are
|
|
257
|
+
// the known vatIDs for the ymax contract on each chain: ymax1 on
|
|
258
|
+
// mainnet, ymax0 on devnet.
|
|
259
|
+
promote := true
|
|
260
|
+
switch ctx.ChainID() {
|
|
261
|
+
case "agoric-3": // MAINNET (ymax1)
|
|
262
|
+
vatOptionUpdates = []vatOptionUpdate{{VatID: "v288", Critical: &promote}}
|
|
263
|
+
case "agoricdev-25": // DEVNET (ymax0)
|
|
264
|
+
vatOptionUpdates = []vatOptionUpdate{{VatID: "v320", Critical: &promote}}
|
|
265
|
+
}
|
|
266
|
+
if len(vatOptionUpdates) > 0 {
|
|
267
|
+
ctx.Logger().Info(
|
|
268
|
+
"upgrade will apply in-place vat option updates",
|
|
269
|
+
"chainID", ctx.ChainID(),
|
|
270
|
+
"vatOptionUpdates", vatOptionUpdates,
|
|
271
|
+
)
|
|
272
|
+
}
|
|
246
273
|
}
|
|
247
274
|
|
|
248
275
|
app.upgradeDetails = &upgradeDetails{
|
|
@@ -252,6 +279,8 @@ func makeUnreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) upgradetyp
|
|
|
252
279
|
// These will be merged with any coreProposals specified in the
|
|
253
280
|
// upgradeInfo field of the upgrade plan ran as subsequent steps
|
|
254
281
|
CoreProposals: vm.CoreProposalsFromSteps(CoreProposalSteps...),
|
|
282
|
+
// In-place vat option updates applied at the reboot point (see above)
|
|
283
|
+
VatOptionUpdates: vatOptionUpdates,
|
|
255
284
|
}
|
|
256
285
|
|
|
257
286
|
// Always run module migrations
|
package/git-revision.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2362584
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/cosmos",
|
|
3
|
-
"version": "0.34.2-dev-
|
|
3
|
+
"version": "0.34.2-dev-2362584.0.2362584",
|
|
4
4
|
"description": "Connect JS to the Cosmos blockchain SDK",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"typeCoverage": {
|
|
46
46
|
"atLeast": 0
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "236258498f84e140b3ebf5a36907c036acdeaaf4"
|
|
49
49
|
}
|