@agoric/cosmos 0.35.0-upgrade-16-dev-5a29e6a.0 → 0.35.0-upgrade-16-dev-12b78e3.0
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/CHANGELOG.md +8 -0
- package/app/app.go +7 -2
- package/app/upgrade.go +23 -4
- package/git-revision.txt +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.35.0-u16.1](https://github.com/Agoric/agoric-sdk/compare/@agoric/cosmos@0.35.0-u16.0...@agoric/cosmos@0.35.0-u16.1) (2024-07-10)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @agoric/cosmos
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [0.35.0-u16.0](https://github.com/Agoric/agoric-sdk/compare/@agoric/cosmos@0.34.1...@agoric/cosmos@0.35.0-u16.0) (2024-07-02)
|
|
7
15
|
|
|
8
16
|
|
package/app/app.go
CHANGED
|
@@ -862,18 +862,23 @@ func NewAgoricApp(
|
|
|
862
862
|
app.SetBeginBlocker(app.BeginBlocker)
|
|
863
863
|
app.SetEndBlocker(app.EndBlocker)
|
|
864
864
|
|
|
865
|
-
for name := range upgradeNamesOfThisVersion {
|
|
865
|
+
for _, name := range upgradeNamesOfThisVersion {
|
|
866
866
|
app.UpgradeKeeper.SetUpgradeHandler(
|
|
867
867
|
name,
|
|
868
868
|
upgrade16Handler(app, name),
|
|
869
869
|
)
|
|
870
870
|
}
|
|
871
871
|
|
|
872
|
+
// At this point we don't have a way to read from the store, so we have to
|
|
873
|
+
// rely on data saved by the x/upgrade module in the previous software.
|
|
872
874
|
upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
|
|
873
875
|
if err != nil {
|
|
874
876
|
panic(err)
|
|
875
877
|
}
|
|
876
|
-
|
|
878
|
+
// Store migrations can only run once, so we use a notion of "primary upgrade
|
|
879
|
+
// name" to trigger them. Testnets may end up upgrading from one rc to
|
|
880
|
+
// another, which shouldn't re-run store upgrades.
|
|
881
|
+
if isPrimaryUpgradeName(upgradeInfo.Name) && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) {
|
|
877
882
|
storeUpgrades := storetypes.StoreUpgrades{
|
|
878
883
|
Added: []string{
|
|
879
884
|
packetforwardtypes.ModuleName, // Added PFM
|
package/app/upgrade.go
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
package gaia
|
|
2
2
|
|
|
3
3
|
import (
|
|
4
|
+
"fmt"
|
|
5
|
+
|
|
4
6
|
"github.com/Agoric/agoric-sdk/golang/cosmos/vm"
|
|
5
7
|
swingsetkeeper "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/keeper"
|
|
6
8
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
@@ -8,13 +10,23 @@ import (
|
|
|
8
10
|
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
|
|
9
11
|
)
|
|
10
12
|
|
|
11
|
-
var upgradeNamesOfThisVersion =
|
|
12
|
-
"agoric-upgrade-16"
|
|
13
|
-
"agoric-upgrade-16-2"
|
|
13
|
+
var upgradeNamesOfThisVersion = []string{
|
|
14
|
+
"agoric-upgrade-16",
|
|
15
|
+
"agoric-upgrade-16-2",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// isPrimaryUpgradeName returns wether the provided plan name is considered a
|
|
19
|
+
// primary for the purpose of applying store migrations for the first upgrade
|
|
20
|
+
// of this version.
|
|
21
|
+
// It is expected that only primary plan names are used for non testing chains.
|
|
22
|
+
func isPrimaryUpgradeName(name string) bool {
|
|
23
|
+
return upgradeNamesOfThisVersion[0] == name
|
|
14
24
|
}
|
|
15
25
|
|
|
26
|
+
// isFirstTimeUpgradeOfThisVersion looks up in the upgrade store whether no
|
|
27
|
+
// upgrade plan name of this version have previously been applied.
|
|
16
28
|
func isFirstTimeUpgradeOfThisVersion(app *GaiaApp, ctx sdk.Context) bool {
|
|
17
|
-
for name := range upgradeNamesOfThisVersion {
|
|
29
|
+
for _, name := range upgradeNamesOfThisVersion {
|
|
18
30
|
if app.UpgradeKeeper.GetDoneHeight(ctx, name) != 0 {
|
|
19
31
|
return false
|
|
20
32
|
}
|
|
@@ -49,6 +61,13 @@ func upgrade16Handler(app *GaiaApp, targetUpgrade string) func(sdk.Context, upgr
|
|
|
49
61
|
"@agoric/builders/scripts/vats/init-transfer.js",
|
|
50
62
|
),
|
|
51
63
|
}
|
|
64
|
+
|
|
65
|
+
// The storeUpgrades defined in app.go only execute for the primary upgrade name
|
|
66
|
+
// If we got here and this first upgrade of this version does not use the
|
|
67
|
+
// primary upgrade name, stores have not been initialized correctly.
|
|
68
|
+
if !isPrimaryUpgradeName(plan.Name) {
|
|
69
|
+
return module.VersionMap{}, fmt.Errorf("cannot run %s as first upgrade", plan.Name)
|
|
70
|
+
}
|
|
52
71
|
}
|
|
53
72
|
|
|
54
73
|
app.upgradeDetails = &upgradeDetails{
|
package/git-revision.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
12b78e3
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/cosmos",
|
|
3
|
-
"version": "0.35.0-upgrade-16-dev-
|
|
3
|
+
"version": "0.35.0-upgrade-16-dev-12b78e3.0+12b78e3",
|
|
4
4
|
"description": "Connect JS to the Cosmos blockchain SDK",
|
|
5
5
|
"parsers": {
|
|
6
6
|
"js": "mjs"
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"typeCoverage": {
|
|
40
40
|
"atLeast": 0
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "12b78e307e22d0dc0c95f40099300e16655781c4"
|
|
43
43
|
}
|