@agoric/cosmos 0.34.2-upgrade-18-dev-6ddbef0.0 → 0.34.2-upgrade-19-dev-2a71f04.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/ante/inbound_test.go +2 -2
- package/app/app.go +26 -9
- package/app/upgrade.go +84 -66
- package/daemon/cmd/root.go +48 -15
- package/e2e_test/go.mod +25 -3
- package/e2e_test/go.sum +13 -13
- package/git-revision.txt +1 -1
- package/go.mod +85 -74
- package/go.sum +207 -174
- package/package.json +2 -3
- package/proto/agoric/swingset/swingset.proto +25 -0
- package/proto/agoric/vbank/vbank.proto +7 -0
- package/types/address_hooks.go +242 -0
- package/types/address_hooks_test.go +221 -0
- package/x/swingset/genesis.go +99 -21
- package/x/swingset/keeper/keeper.go +19 -14
- package/x/swingset/keeper/keeper_test.go +16 -10
- package/x/swingset/keeper/msg_server.go +1 -1
- package/x/swingset/module.go +17 -2
- package/x/swingset/testing/queue.go +8 -0
- package/x/swingset/types/default-params.go +31 -5
- package/x/swingset/types/expected_keepers.go +2 -2
- package/x/swingset/types/msgs.go +34 -12
- package/x/swingset/types/params.go +53 -43
- package/x/swingset/types/params_test.go +75 -9
- package/x/swingset/types/swingset.pb.go +386 -56
- package/x/vbank/README.md +6 -1
- package/x/vbank/keeper/keeper.go +4 -9
- package/x/vbank/keeper/migrations.go +30 -0
- package/x/vbank/module.go +8 -2
- package/x/vbank/types/params.go +43 -2
- package/x/vbank/types/vbank.pb.go +105 -36
- package/x/vbank/vbank_test.go +12 -7
- package/x/vibc/keeper/keeper.go +2 -5
- package/x/vibc/keeper/triggers.go +3 -6
- package/x/vibc/types/receiver.go +11 -5
- package/x/vstorage/testing/queue.go +10 -3
- package/x/vtransfer/ibc_middleware.go +5 -1
- package/x/vtransfer/ibc_middleware_test.go +511 -145
- package/x/vtransfer/keeper/keeper.go +215 -50
- package/x/vtransfer/types/genesis.pb.go +1 -0
- package/x/vtransfer/utils_test.go +111 -0
package/ante/inbound_test.go
CHANGED
|
@@ -215,7 +215,7 @@ func (msk mockSwingsetKeeper) GetBeansPerUnit(ctx sdk.Context) map[string]sdkmat
|
|
|
215
215
|
return nil
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
-
func (msk mockSwingsetKeeper) ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdkmath.Uint) error {
|
|
218
|
+
func (msk mockSwingsetKeeper) ChargeBeans(ctx sdk.Context, beansPerUnit map[string]sdkmath.Uint, addr sdk.AccAddress, beans sdkmath.Uint) error {
|
|
219
219
|
return fmt.Errorf("not implemented")
|
|
220
220
|
}
|
|
221
221
|
|
|
@@ -223,6 +223,6 @@ func (msk mockSwingsetKeeper) GetSmartWalletState(ctx sdk.Context, addr sdk.AccA
|
|
|
223
223
|
panic(fmt.Errorf("not implemented"))
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
func (msk mockSwingsetKeeper) ChargeForSmartWallet(ctx sdk.Context, addr sdk.AccAddress) error {
|
|
226
|
+
func (msk mockSwingsetKeeper) ChargeForSmartWallet(ctx sdk.Context, beansPerUnit map[string]sdkmath.Uint, addr sdk.AccAddress) error {
|
|
227
227
|
return fmt.Errorf("not implemented")
|
|
228
228
|
}
|
package/app/app.go
CHANGED
|
@@ -137,13 +137,22 @@ import (
|
|
|
137
137
|
|
|
138
138
|
const appName = "agoric"
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
//
|
|
142
|
-
//
|
|
143
|
-
// value is
|
|
144
|
-
//
|
|
145
|
-
//
|
|
146
|
-
|
|
140
|
+
const (
|
|
141
|
+
// FlagSwingStoreExportDir defines the config flag used to specify where a
|
|
142
|
+
// genesis swing-store export is expected. For start from genesis, the default
|
|
143
|
+
// value is config/swing-store in the home directory. For genesis export, the
|
|
144
|
+
// value is always a "swing-store" directory sibling to the exported
|
|
145
|
+
// genesis.json file.
|
|
146
|
+
// TODO: document this flag in config, likely alongside the genesis path
|
|
147
|
+
FlagSwingStoreExportDir = "swing-store-export-dir"
|
|
148
|
+
// FlagSwingStoreExportMode defines the export mode for the swing store
|
|
149
|
+
// Alongside the default mode `operational`, there are two other modes
|
|
150
|
+
//
|
|
151
|
+
// 1- `skip` mode will skip the swing store export altogether
|
|
152
|
+
//
|
|
153
|
+
// 2- `debug` mode will export all the available store
|
|
154
|
+
FlagSwingStoreExportMode = "swing-store-export-mode"
|
|
155
|
+
)
|
|
147
156
|
|
|
148
157
|
var (
|
|
149
158
|
// DefaultNodeHome default home directories for the application daemon
|
|
@@ -673,6 +682,7 @@ func NewAgoricApp(
|
|
|
673
682
|
app.EvidenceKeeper = *evidenceKeeper
|
|
674
683
|
|
|
675
684
|
swingStoreExportDir := cast.ToString(appOpts.Get(FlagSwingStoreExportDir))
|
|
685
|
+
swingStoreExportMode := cast.ToString(appOpts.Get(FlagSwingStoreExportMode))
|
|
676
686
|
|
|
677
687
|
// NOTE: Any module instantiated in the module manager that is later modified
|
|
678
688
|
// must be passed by reference here.
|
|
@@ -702,7 +712,14 @@ func NewAgoricApp(
|
|
|
702
712
|
icaModule,
|
|
703
713
|
packetforward.NewAppModule(app.PacketForwardKeeper),
|
|
704
714
|
vstorage.NewAppModule(app.VstorageKeeper),
|
|
705
|
-
swingset.NewAppModule(
|
|
715
|
+
swingset.NewAppModule(
|
|
716
|
+
app.SwingSetKeeper,
|
|
717
|
+
&app.SwingStoreExportsHandler,
|
|
718
|
+
setBootstrapNeeded,
|
|
719
|
+
app.ensureControllerInited,
|
|
720
|
+
swingStoreExportDir,
|
|
721
|
+
swingStoreExportMode,
|
|
722
|
+
),
|
|
706
723
|
vibcModule,
|
|
707
724
|
vbankModule,
|
|
708
725
|
vtransferModule,
|
|
@@ -877,7 +894,7 @@ func NewAgoricApp(
|
|
|
877
894
|
for _, name := range upgradeNamesOfThisVersion {
|
|
878
895
|
app.UpgradeKeeper.SetUpgradeHandler(
|
|
879
896
|
name,
|
|
880
|
-
|
|
897
|
+
unreleasedUpgradeHandler(app, name),
|
|
881
898
|
)
|
|
882
899
|
}
|
|
883
900
|
|
package/app/upgrade.go
CHANGED
|
@@ -3,6 +3,7 @@ package gaia
|
|
|
3
3
|
import (
|
|
4
4
|
"encoding/json"
|
|
5
5
|
"fmt"
|
|
6
|
+
"reflect"
|
|
6
7
|
"strings"
|
|
7
8
|
"text/template"
|
|
8
9
|
|
|
@@ -14,11 +15,12 @@ import (
|
|
|
14
15
|
)
|
|
15
16
|
|
|
16
17
|
var upgradeNamesOfThisVersion = []string{
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
18
|
+
"UNRELEASED_BASIC", // no-frills
|
|
19
|
+
"UNRELEASED_A3P_INTEGRATION",
|
|
20
|
+
"UNRELEASED_main",
|
|
21
|
+
"UNRELEASED_devnet",
|
|
22
|
+
"UNRELEASED_emerynet",
|
|
23
|
+
"UNRELEASED_REAPPLY",
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
// isUpgradeNameOfThisVersion returns whether the provided plan name is a
|
|
@@ -52,12 +54,14 @@ func isPrimaryUpgradeName(name string) bool {
|
|
|
52
54
|
return false
|
|
53
55
|
}
|
|
54
56
|
switch name {
|
|
55
|
-
case validUpgradeName("
|
|
56
|
-
validUpgradeName("
|
|
57
|
-
validUpgradeName("
|
|
58
|
-
validUpgradeName("
|
|
59
|
-
validUpgradeName("
|
|
57
|
+
case validUpgradeName("UNRELEASED_BASIC"),
|
|
58
|
+
validUpgradeName("UNRELEASED_A3P_INTEGRATION"),
|
|
59
|
+
validUpgradeName("UNRELEASED_main"),
|
|
60
|
+
validUpgradeName("UNRELEASED_devnet"),
|
|
61
|
+
validUpgradeName("UNRELEASED_emerynet"):
|
|
60
62
|
return true
|
|
63
|
+
case validUpgradeName("UNRELEASED_REAPPLY"):
|
|
64
|
+
return false
|
|
61
65
|
default:
|
|
62
66
|
panic(fmt.Errorf("unexpected upgrade name %s", validUpgradeName(name)))
|
|
63
67
|
}
|
|
@@ -74,14 +78,27 @@ func isFirstTimeUpgradeOfThisVersion(app *GaiaApp, ctx sdk.Context) bool {
|
|
|
74
78
|
return true
|
|
75
79
|
}
|
|
76
80
|
|
|
77
|
-
func buildProposalStepWithArgs(moduleName string, entrypoint string,
|
|
81
|
+
func buildProposalStepWithArgs(moduleName string, entrypoint string, extra any) (vm.CoreProposalStep, error) {
|
|
78
82
|
t := template.Must(template.New("").Parse(`{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
"module": "{{.moduleName}}",
|
|
84
|
+
"entrypoint": "{{.entrypoint}}",
|
|
85
|
+
"args": {{.args}}
|
|
86
|
+
}`))
|
|
87
|
+
|
|
88
|
+
var args []byte
|
|
89
|
+
var err error
|
|
90
|
+
if extra == nil {
|
|
91
|
+
// The specified entrypoint will be called with no extra arguments after powers.
|
|
92
|
+
args = []byte(`[]`)
|
|
93
|
+
} else if reflect.TypeOf(extra).Kind() == reflect.Map && reflect.TypeOf(extra).Key().Kind() == reflect.String {
|
|
94
|
+
// The specified entrypoint will be called with this options argument after powers.
|
|
95
|
+
args, err = json.Marshal([]any{extra})
|
|
96
|
+
} else if reflect.TypeOf(extra).Kind() == reflect.Slice {
|
|
97
|
+
// The specified entrypoint will be called with each of these arguments after powers.
|
|
98
|
+
args, err = json.Marshal(extra)
|
|
99
|
+
} else {
|
|
100
|
+
return nil, fmt.Errorf("proposal extra must be nil, array, or string map, not %v", extra)
|
|
101
|
+
}
|
|
85
102
|
if err != nil {
|
|
86
103
|
return nil, err
|
|
87
104
|
}
|
|
@@ -90,7 +107,7 @@ func buildProposalStepWithArgs(moduleName string, entrypoint string, opts map[st
|
|
|
90
107
|
err = t.Execute(&result, map[string]any{
|
|
91
108
|
"moduleName": moduleName,
|
|
92
109
|
"entrypoint": entrypoint,
|
|
93
|
-
"
|
|
110
|
+
"args": string(args),
|
|
94
111
|
})
|
|
95
112
|
if err != nil {
|
|
96
113
|
return nil, err
|
|
@@ -106,46 +123,39 @@ func buildProposalStepWithArgs(moduleName string, entrypoint string, opts map[st
|
|
|
106
123
|
|
|
107
124
|
func getVariantFromUpgradeName(upgradeName string) string {
|
|
108
125
|
switch upgradeName {
|
|
109
|
-
case "
|
|
126
|
+
case "UNRELEASED_A3P_INTEGRATION":
|
|
127
|
+
return "A3P_INTEGRATION"
|
|
128
|
+
case "UNRELEASED_main":
|
|
110
129
|
return "MAINNET"
|
|
111
|
-
case "
|
|
130
|
+
case "UNRELEASED_devnet":
|
|
112
131
|
return "DEVNET"
|
|
113
|
-
case "
|
|
132
|
+
case "UNRELEASED_emerynet":
|
|
114
133
|
return "EMERYNET"
|
|
115
|
-
case "
|
|
134
|
+
case "UNRELEASED_BASIC":
|
|
135
|
+
// Noupgrade for this version.
|
|
116
136
|
return ""
|
|
117
|
-
case "agoric-upgrade-18-a3p":
|
|
118
|
-
return "A3P_INTEGRATION"
|
|
119
137
|
default:
|
|
120
138
|
return ""
|
|
121
139
|
}
|
|
122
140
|
}
|
|
123
141
|
|
|
124
|
-
func
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
if variant == "" {
|
|
128
|
-
return nil, nil
|
|
129
|
-
}
|
|
142
|
+
func upgradeMintHolderCoreProposal(targetUpgrade string) (vm.CoreProposalStep, error) {
|
|
143
|
+
return buildProposalStepFromScript(targetUpgrade, "@agoric/builders/scripts/vats/upgrade-mintHolder.js")
|
|
144
|
+
}
|
|
130
145
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
"defaultProposalBuilder",
|
|
134
|
-
map[string]any{
|
|
135
|
-
"variant": variant,
|
|
136
|
-
},
|
|
137
|
-
)
|
|
146
|
+
func restartFeeDistributorCoreProposal(targetUpgrade string) (vm.CoreProposalStep, error) {
|
|
147
|
+
return buildProposalStepFromScript(targetUpgrade, "@agoric/builders/scripts/inter-protocol/replace-feeDistributor-combo.js")
|
|
138
148
|
}
|
|
139
149
|
|
|
140
|
-
func
|
|
141
|
-
variant := getVariantFromUpgradeName(
|
|
150
|
+
func buildProposalStepFromScript(targetUpgrade string, builderScript string) (vm.CoreProposalStep, error) {
|
|
151
|
+
variant := getVariantFromUpgradeName(targetUpgrade)
|
|
142
152
|
|
|
143
153
|
if variant == "" {
|
|
144
154
|
return nil, nil
|
|
145
155
|
}
|
|
146
156
|
|
|
147
157
|
return buildProposalStepWithArgs(
|
|
148
|
-
|
|
158
|
+
builderScript,
|
|
149
159
|
"defaultProposalBuilder",
|
|
150
160
|
map[string]any{
|
|
151
161
|
"variant": variant,
|
|
@@ -153,8 +163,8 @@ func replacePriceFeedsCoreProposal(upgradeName string) (vm.CoreProposalStep, err
|
|
|
153
163
|
)
|
|
154
164
|
}
|
|
155
165
|
|
|
156
|
-
//
|
|
157
|
-
func
|
|
166
|
+
// unreleasedUpgradeHandler performs standard upgrade actions plus custom actions for the unreleased upgrade.
|
|
167
|
+
func unreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) func(sdk.Context, upgradetypes.Plan, module.VersionMap) (module.VersionMap, error) {
|
|
158
168
|
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVm module.VersionMap) (module.VersionMap, error) {
|
|
159
169
|
app.CheckControllerInited(false)
|
|
160
170
|
|
|
@@ -170,43 +180,51 @@ func upgrade18Handler(app *GaiaApp, targetUpgrade string) func(sdk.Context, upgr
|
|
|
170
180
|
return module.VersionMap{}, fmt.Errorf("cannot run %s as first upgrade", plan.Name)
|
|
171
181
|
}
|
|
172
182
|
|
|
173
|
-
|
|
183
|
+
// Each CoreProposalStep runs sequentially, and can be constructed from
|
|
184
|
+
// one or more modules executing in parallel within the step.
|
|
185
|
+
CoreProposalSteps = append(CoreProposalSteps,
|
|
186
|
+
// Register a new ZCF to be used for all future contract instances and upgrades
|
|
187
|
+
vm.CoreProposalStepForModules(
|
|
188
|
+
"@agoric/builders/scripts/vats/upgrade-zcf.js",
|
|
189
|
+
),
|
|
190
|
+
// because of #10794, we need to do at least a null upgrade of
|
|
191
|
+
// the walletFactory on every software upgrade
|
|
192
|
+
vm.CoreProposalStepForModules(
|
|
193
|
+
"@agoric/builders/scripts/smart-wallet/build-wallet-factory2-upgrade.js",
|
|
194
|
+
),
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
upgradeMintHolderStep, err := upgradeMintHolderCoreProposal(targetUpgrade)
|
|
174
198
|
if err != nil {
|
|
175
199
|
return nil, err
|
|
176
|
-
} else if
|
|
177
|
-
CoreProposalSteps = append(CoreProposalSteps,
|
|
200
|
+
} else if upgradeMintHolderStep != nil {
|
|
201
|
+
CoreProposalSteps = append(CoreProposalSteps, upgradeMintHolderStep)
|
|
178
202
|
}
|
|
179
|
-
|
|
180
|
-
priceFeedUpdate, err := replacePriceFeedsCoreProposal(targetUpgrade)
|
|
203
|
+
restartFeeDistributorStep, err := restartFeeDistributorCoreProposal(targetUpgrade)
|
|
181
204
|
if err != nil {
|
|
182
205
|
return nil, err
|
|
183
|
-
} else if
|
|
184
|
-
CoreProposalSteps = append(CoreProposalSteps,
|
|
185
|
-
priceFeedUpdate,
|
|
186
|
-
// The following have a dependency onto the price feed proposal
|
|
187
|
-
vm.CoreProposalStepForModules(
|
|
188
|
-
"@agoric/builders/scripts/vats/add-auction.js",
|
|
189
|
-
),
|
|
190
|
-
vm.CoreProposalStepForModules(
|
|
191
|
-
"@agoric/builders/scripts/vats/upgradeVaults.js",
|
|
192
|
-
),
|
|
193
|
-
)
|
|
206
|
+
} else if restartFeeDistributorStep != nil {
|
|
207
|
+
CoreProposalSteps = append(CoreProposalSteps, restartFeeDistributorStep)
|
|
194
208
|
}
|
|
195
209
|
|
|
196
|
-
// Each CoreProposalStep runs sequentially, and can be constructed from
|
|
197
|
-
// one or more modules executing in parallel within the step.
|
|
198
210
|
CoreProposalSteps = append(CoreProposalSteps,
|
|
199
211
|
vm.CoreProposalStepForModules(
|
|
200
|
-
|
|
201
|
-
"@agoric/builders/scripts/vats/upgrade-zoe.js",
|
|
212
|
+
"@agoric/builders/scripts/vats/upgrade-paRegistry.js",
|
|
202
213
|
),
|
|
203
|
-
// Revive KREAd characters
|
|
204
214
|
vm.CoreProposalStepForModules(
|
|
205
|
-
"@agoric/builders/scripts/vats/
|
|
215
|
+
"@agoric/builders/scripts/vats/upgrade-provisionPool.js",
|
|
206
216
|
),
|
|
207
217
|
vm.CoreProposalStepForModules(
|
|
208
|
-
|
|
209
|
-
|
|
218
|
+
"@agoric/builders/scripts/vats/upgrade-bank.js",
|
|
219
|
+
),
|
|
220
|
+
vm.CoreProposalStepForModules(
|
|
221
|
+
"@agoric/builders/scripts/vats/upgrade-agoricNames.js",
|
|
222
|
+
),
|
|
223
|
+
vm.CoreProposalStepForModules(
|
|
224
|
+
"@agoric/builders/scripts/vats/upgrade-asset-reserve.js",
|
|
225
|
+
),
|
|
226
|
+
vm.CoreProposalStepForModules(
|
|
227
|
+
"@agoric/builders/scripts/vats/upgrade-psm.js",
|
|
210
228
|
),
|
|
211
229
|
)
|
|
212
230
|
}
|
package/daemon/cmd/root.go
CHANGED
|
@@ -386,6 +386,12 @@ const (
|
|
|
386
386
|
ExportedSwingStoreDirectoryName = "swing-store"
|
|
387
387
|
)
|
|
388
388
|
|
|
389
|
+
var allowedSwingSetExportModes = map[string]bool{
|
|
390
|
+
swingset.SwingStoreExportModeDebug: true,
|
|
391
|
+
swingset.SwingStoreExportModeOperational: true,
|
|
392
|
+
swingset.SwingStoreExportModeSkip: true,
|
|
393
|
+
}
|
|
394
|
+
|
|
389
395
|
// extendCosmosExportCommand monkey-patches the "export" command added by
|
|
390
396
|
// cosmos-sdk to add a required "export-dir" command-line flag, and create the
|
|
391
397
|
// genesis export in the specified directory if the VM is running.
|
|
@@ -396,31 +402,52 @@ func extendCosmosExportCommand(cmd *cobra.Command) {
|
|
|
396
402
|
panic(err)
|
|
397
403
|
}
|
|
398
404
|
|
|
405
|
+
var keys []string
|
|
406
|
+
for key := range allowedSwingSetExportModes {
|
|
407
|
+
keys = append(keys, key)
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
cmd.Flags().String(
|
|
411
|
+
gaia.FlagSwingStoreExportMode,
|
|
412
|
+
swingset.SwingStoreExportModeOperational,
|
|
413
|
+
fmt.Sprintf(
|
|
414
|
+
"The mode for swingstore export (%s)",
|
|
415
|
+
strings.Join(keys, " | "),
|
|
416
|
+
),
|
|
417
|
+
)
|
|
418
|
+
|
|
399
419
|
originalRunE := cmd.RunE
|
|
400
420
|
|
|
401
421
|
extendedRunE := func(cmd *cobra.Command, args []string) error {
|
|
402
422
|
serverCtx := server.GetServerContextFromCmd(cmd)
|
|
403
423
|
|
|
404
424
|
exportDir, _ := cmd.Flags().GetString(FlagExportDir)
|
|
425
|
+
swingStoreExportMode, _ := cmd.Flags().GetString(gaia.FlagSwingStoreExportMode)
|
|
426
|
+
|
|
405
427
|
err := os.MkdirAll(exportDir, os.ModePerm)
|
|
406
428
|
if err != nil {
|
|
407
429
|
return err
|
|
408
430
|
}
|
|
409
431
|
|
|
410
432
|
genesisPath := filepath.Join(exportDir, ExportedGenesisFileName)
|
|
411
|
-
swingStoreExportPath := filepath.Join(exportDir, ExportedSwingStoreDirectoryName)
|
|
412
433
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
434
|
+
// Since none mode doesn't perform any swing store export
|
|
435
|
+
// There is no point in creating the export directory
|
|
436
|
+
if swingStoreExportMode != swingset.SwingStoreExportModeSkip {
|
|
437
|
+
swingStoreExportPath := filepath.Join(exportDir, ExportedSwingStoreDirectoryName)
|
|
438
|
+
|
|
439
|
+
err = os.MkdirAll(swingStoreExportPath, os.ModePerm)
|
|
440
|
+
if err != nil {
|
|
441
|
+
return err
|
|
442
|
+
}
|
|
443
|
+
// We unconditionally set FlagSwingStoreExportDir as for export, it makes
|
|
444
|
+
// little sense for users to control this location separately, and we don't
|
|
445
|
+
// want to override any swing-store artifacts that may be associated to the
|
|
446
|
+
// current genesis.
|
|
447
|
+
serverCtx.Viper.Set(gaia.FlagSwingStoreExportDir, swingStoreExportPath)
|
|
416
448
|
}
|
|
417
|
-
// We unconditionally set FlagSwingStoreExportDir as for export, it makes
|
|
418
|
-
// little sense for users to control this location separately, and we don't
|
|
419
|
-
// want to override any swing-store artifacts that may be associated to the
|
|
420
|
-
// current genesis.
|
|
421
|
-
serverCtx.Viper.Set(gaia.FlagSwingStoreExportDir, swingStoreExportPath)
|
|
422
449
|
|
|
423
|
-
if hasVMController(serverCtx) {
|
|
450
|
+
if hasVMController(serverCtx) || swingStoreExportMode == swingset.SwingStoreExportModeSkip {
|
|
424
451
|
// Capture the export in the genesisPath.
|
|
425
452
|
// This will fail if a genesis.json already exists in the export-dir
|
|
426
453
|
genesisFile, err := os.OpenFile(
|
|
@@ -453,7 +480,16 @@ func (ac appCreator) appExport(
|
|
|
453
480
|
jailAllowedAddrs []string,
|
|
454
481
|
appOpts servertypes.AppOptions,
|
|
455
482
|
) (servertypes.ExportedApp, error) {
|
|
456
|
-
|
|
483
|
+
swingStoreExportMode, ok := appOpts.Get(gaia.FlagSwingStoreExportMode).(string)
|
|
484
|
+
if !(ok && allowedSwingSetExportModes[swingStoreExportMode]) {
|
|
485
|
+
return servertypes.ExportedApp{}, fmt.Errorf(
|
|
486
|
+
"export mode '%s' is not supported",
|
|
487
|
+
swingStoreExportMode,
|
|
488
|
+
)
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
// We don't have to launch VM in case the swing store export is not required
|
|
492
|
+
if swingStoreExportMode != swingset.SwingStoreExportModeSkip && OnExportHook != nil {
|
|
457
493
|
if err := OnExportHook(ac.agdServer, logger, appOpts); err != nil {
|
|
458
494
|
return servertypes.ExportedApp{}, err
|
|
459
495
|
}
|
|
@@ -464,10 +500,7 @@ func (ac appCreator) appExport(
|
|
|
464
500
|
return servertypes.ExportedApp{}, errors.New("application home is not set")
|
|
465
501
|
}
|
|
466
502
|
|
|
467
|
-
|
|
468
|
-
if height == -1 {
|
|
469
|
-
loadLatest = true
|
|
470
|
-
}
|
|
503
|
+
loadLatest := height == -1
|
|
471
504
|
|
|
472
505
|
gaiaApp := gaia.NewAgoricApp(
|
|
473
506
|
ac.sender, ac.agdServer,
|
package/e2e_test/go.mod
CHANGED
|
@@ -6,7 +6,7 @@ require (
|
|
|
6
6
|
github.com/agoric-labs/interchaintest/v6 v6.0.1-agoriclabs
|
|
7
7
|
github.com/cosmos/cosmos-sdk v0.46.13
|
|
8
8
|
github.com/cosmos/ibc-go/v6 v6.2.0
|
|
9
|
-
github.com/stretchr/testify v1.
|
|
9
|
+
github.com/stretchr/testify v1.9.0
|
|
10
10
|
go.uber.org/zap v1.26.0
|
|
11
11
|
)
|
|
12
12
|
|
|
@@ -17,7 +17,7 @@ require (
|
|
|
17
17
|
cloud.google.com/go/iam v1.1.1 // indirect
|
|
18
18
|
cloud.google.com/go/storage v1.30.1 // indirect
|
|
19
19
|
cosmossdk.io/errors v1.0.0-beta.7 // indirect
|
|
20
|
-
cosmossdk.io/math v1.
|
|
20
|
+
cosmossdk.io/math v1.4.0 // indirect
|
|
21
21
|
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
|
|
22
22
|
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
|
|
23
23
|
github.com/99designs/keyring v1.2.2 // indirect
|
|
@@ -200,7 +200,7 @@ require (
|
|
|
200
200
|
modernc.org/sqlite v1.23.1 // indirect
|
|
201
201
|
modernc.org/strutil v1.1.3 // indirect
|
|
202
202
|
modernc.org/token v1.0.1 // indirect
|
|
203
|
-
sigs.k8s.io/yaml v1.
|
|
203
|
+
sigs.k8s.io/yaml v1.4.0 // indirect
|
|
204
204
|
)
|
|
205
205
|
|
|
206
206
|
// Some replace copied from https://github.com/gjermundgaraba/ibctest/blob/110aa579a5a889b2af760bed4f3d90e0d2475e7a/go.mod
|
|
@@ -215,3 +215,25 @@ replace (
|
|
|
215
215
|
github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27
|
|
216
216
|
github.com/vedhavyas/go-subkey => github.com/strangelove-ventures/go-subkey v1.0.7
|
|
217
217
|
)
|
|
218
|
+
|
|
219
|
+
// Agoric-specific replacements:
|
|
220
|
+
replace (
|
|
221
|
+
// We need a fork of cosmos-sdk until all of the differences are merged.
|
|
222
|
+
github.com/cosmos/cosmos-sdk => github.com/agoric-labs/cosmos-sdk v0.46.16-alpha.agoric.2.5
|
|
223
|
+
|
|
224
|
+
// Pick up an IAVL race fix.
|
|
225
|
+
github.com/cosmos/iavl => github.com/cosmos/iavl v0.19.7
|
|
226
|
+
|
|
227
|
+
// Use a version of ibc-go that is compatible with the above forks.
|
|
228
|
+
github.com/cosmos/ibc-go/v6 => github.com/agoric-labs/ibc-go/v6 v6.3.1-alpha.agoric.2
|
|
229
|
+
|
|
230
|
+
// use cometbft
|
|
231
|
+
// Use our fork at least until post-v0.34.14 is released with
|
|
232
|
+
// https://github.com/tendermint/tendermint/issue/6899 resolved.
|
|
233
|
+
// github.com/tendermint/tendermint => github.com/agoric-labs/cometbft v0.34.30-alpha.agoric.1
|
|
234
|
+
|
|
235
|
+
// For testing against a local cosmos-sdk, ibc-go, or cometbft
|
|
236
|
+
// github.com/cosmos/cosmos-sdk => ../../../forks/cosmos-sdk
|
|
237
|
+
// github.com/cosmos/ibc-go/v6 => ../../../forks/ibc-go/v6
|
|
238
|
+
// github.com/tendermint/tendermint => ../../../forks/cometbft
|
|
239
|
+
)
|
package/e2e_test/go.sum
CHANGED
|
@@ -51,8 +51,8 @@ cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7Biccwk
|
|
|
51
51
|
collectd.org v0.3.0/go.mod h1:A/8DzQBkF6abtvrT2j/AU/4tiBgJWYyh0y/oB/4MlWE=
|
|
52
52
|
cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w=
|
|
53
53
|
cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE=
|
|
54
|
-
cosmossdk.io/math v1.
|
|
55
|
-
cosmossdk.io/math v1.
|
|
54
|
+
cosmossdk.io/math v1.4.0 h1:XbgExXFnXmF/CccPPEto40gOO7FpWu9yWNAZPN3nkNQ=
|
|
55
|
+
cosmossdk.io/math v1.4.0/go.mod h1:O5PkD4apz2jZs4zqFdTr16e1dcaQCc5z6lkEnrrppuk=
|
|
56
56
|
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
|
57
57
|
filippo.io/edwards25519 v1.0.0-rc.1 h1:m0VOOB23frXZvAOK44usCgLWvtsxIoMCTBGJZlpmGfU=
|
|
58
58
|
filippo.io/edwards25519 v1.0.0-rc.1/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns=
|
|
@@ -85,6 +85,10 @@ github.com/StirlingMarketingGroup/go-namecase v1.0.0/go.mod h1:ZsoSKcafcAzuBx+sn
|
|
|
85
85
|
github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw=
|
|
86
86
|
github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE=
|
|
87
87
|
github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig=
|
|
88
|
+
github.com/agoric-labs/cosmos-sdk v0.46.16-alpha.agoric.2.5 h1:cwbONQaVbGEPzfVqvTY9PGcLZptlR9LTPunZ9La0QCg=
|
|
89
|
+
github.com/agoric-labs/cosmos-sdk v0.46.16-alpha.agoric.2.5/go.mod h1:Yny/YE+GJ+y/++UgvraITGzfLhXCnwETSWw3dAY5NDg=
|
|
90
|
+
github.com/agoric-labs/ibc-go/v6 v6.3.1-alpha.agoric.2 h1:vEzy4JaExzlWNHV3ZSVXEVZcRE9loEFUjieE2TXwDdI=
|
|
91
|
+
github.com/agoric-labs/ibc-go/v6 v6.3.1-alpha.agoric.2/go.mod h1:L1xcBjCLIHN7Wd9j6cAQvZertn56pq+eRGFZjRO5bsY=
|
|
88
92
|
github.com/agoric-labs/interchaintest/v6 v6.0.1-agoriclabs h1:OG3Z7F9YsqFKCi2w/JZVhMWs+VWNsAEujy39/I2Clxo=
|
|
89
93
|
github.com/agoric-labs/interchaintest/v6 v6.0.1-agoriclabs/go.mod h1:B/KLzyRfuZI+uFKDQe+AXrvjJKRBjl5gds27iOwT9mM=
|
|
90
94
|
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
|
|
@@ -179,17 +183,13 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk=
|
|
|
179
183
|
github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis=
|
|
180
184
|
github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw=
|
|
181
185
|
github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I=
|
|
182
|
-
github.com/cosmos/cosmos-sdk v0.46.13 h1:LhL6WDBadczqBuCW0t5BHUzGQR3vbujdOYOfU0ORt+o=
|
|
183
|
-
github.com/cosmos/cosmos-sdk v0.46.13/go.mod h1:EfY521ATNEla8eJ6oJuZBdgP5+p360s7InnRqX+TWdM=
|
|
184
186
|
github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y=
|
|
185
187
|
github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=
|
|
186
188
|
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
|
|
187
189
|
github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y=
|
|
188
190
|
github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw=
|
|
189
|
-
github.com/cosmos/iavl v0.19.
|
|
190
|
-
github.com/cosmos/iavl v0.19.
|
|
191
|
-
github.com/cosmos/ibc-go/v6 v6.2.0 h1:HKS5WNxQrlmjowHb73J9LqlNJfvTnvkbhXZ9QzNTU7Q=
|
|
192
|
-
github.com/cosmos/ibc-go/v6 v6.2.0/go.mod h1:+S3sxcNwOhgraYDJAhIFDg5ipXHaUnJrg7tOQqGyWlc=
|
|
191
|
+
github.com/cosmos/iavl v0.19.7 h1:ij32FaEnwxfEurtK0QKDNhTWFnz6NUmrI5gky/WnoY0=
|
|
192
|
+
github.com/cosmos/iavl v0.19.7/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
|
|
193
193
|
github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw=
|
|
194
194
|
github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M=
|
|
195
195
|
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
|
@@ -752,8 +752,8 @@ github.com/strangelove-ventures/go-subkey v1.0.7/go.mod h1:E34izOIEm+sZ1YmYawYRq
|
|
|
752
752
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
|
753
753
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
|
754
754
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
|
755
|
-
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
|
|
756
755
|
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
|
756
|
+
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
|
|
757
757
|
github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
|
758
758
|
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
|
759
759
|
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
|
@@ -766,8 +766,8 @@ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1F
|
|
|
766
766
|
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
|
767
767
|
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
|
768
768
|
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
|
769
|
-
github.com/stretchr/testify v1.
|
|
770
|
-
github.com/stretchr/testify v1.
|
|
769
|
+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
|
770
|
+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
|
771
771
|
github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs=
|
|
772
772
|
github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
|
|
773
773
|
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
|
|
@@ -1319,5 +1319,5 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8
|
|
|
1319
1319
|
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
|
1320
1320
|
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
|
1321
1321
|
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
|
1322
|
-
sigs.k8s.io/yaml v1.
|
|
1323
|
-
sigs.k8s.io/yaml v1.
|
|
1322
|
+
sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E=
|
|
1323
|
+
sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY=
|
package/git-revision.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2a71f04
|