@agoric/cosmos 0.34.2-upgrade-18-dev-d7c994b.0 → 0.34.2-upgrade-18-dev-ef001c0.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/app/upgrade.go +47 -30
- package/cmd/agd/agvm.go +3 -3
- package/cmd/agd/find_binary.go +2 -2
- package/git-revision.txt +1 -1
- package/package.json +2 -2
- package/vm/client.go +15 -13
- package/x/vbank/types/key.go +3 -3
package/app/upgrade.go
CHANGED
|
@@ -79,10 +79,10 @@ func buildProposalStepWithArgs(moduleName string, entrypoint string, opts map[st
|
|
|
79
79
|
t := template.Must(template.New("").Parse(`{
|
|
80
80
|
"module": "{{.moduleName}}",
|
|
81
81
|
"entrypoint": "{{.entrypoint}}",
|
|
82
|
-
"args": [ {{.
|
|
82
|
+
"args": [ {{.optsArg}} ]
|
|
83
83
|
}`))
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
optsArg, err := json.Marshal(opts)
|
|
86
86
|
if err != nil {
|
|
87
87
|
return nil, err
|
|
88
88
|
}
|
|
@@ -91,7 +91,7 @@ func buildProposalStepWithArgs(moduleName string, entrypoint string, opts map[st
|
|
|
91
91
|
err = t.Execute(&result, map[string]any{
|
|
92
92
|
"moduleName": moduleName,
|
|
93
93
|
"entrypoint": entrypoint,
|
|
94
|
-
"
|
|
94
|
+
"optsArg": string(optsArg),
|
|
95
95
|
})
|
|
96
96
|
if err != nil {
|
|
97
97
|
return nil, err
|
|
@@ -106,23 +106,27 @@ func buildProposalStepWithArgs(moduleName string, entrypoint string, opts map[st
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
func getVariantFromUpgradeName(upgradeName string) string {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
109
|
+
switch upgradeName {
|
|
110
|
+
case "UNRELEASED_A3P_INTEGRATION":
|
|
111
|
+
return "A3P_INTEGRATION"
|
|
112
|
+
case "UNRELEASED_main":
|
|
113
|
+
return "MAINNET"
|
|
114
|
+
case "UNRELEASED_devnet":
|
|
115
|
+
return "DEVNET"
|
|
116
|
+
// Noupgrade for this version.
|
|
117
|
+
case "UNRELEASED_BASIC":
|
|
118
|
+
return ""
|
|
119
|
+
default:
|
|
120
|
+
return ""
|
|
121
|
+
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
func replaceElectorateCoreProposalStep(upgradeName string) (vm.CoreProposalStep, error) {
|
|
125
|
-
|
|
125
|
+
variant := getVariantFromUpgradeName(upgradeName)
|
|
126
|
+
|
|
127
|
+
if variant == "" {
|
|
128
|
+
return nil, nil
|
|
129
|
+
}
|
|
126
130
|
|
|
127
131
|
return buildProposalStepWithArgs(
|
|
128
132
|
"@agoric/builders/scripts/inter-protocol/replace-electorate-core.js",
|
|
@@ -134,7 +138,11 @@ func replaceElectorateCoreProposalStep(upgradeName string) (vm.CoreProposalStep,
|
|
|
134
138
|
}
|
|
135
139
|
|
|
136
140
|
func replacePriceFeedsCoreProposal(upgradeName string) (vm.CoreProposalStep, error) {
|
|
137
|
-
|
|
141
|
+
variant := getVariantFromUpgradeName(upgradeName)
|
|
142
|
+
|
|
143
|
+
if variant == "" {
|
|
144
|
+
return nil, nil
|
|
145
|
+
}
|
|
138
146
|
|
|
139
147
|
return buildProposalStepWithArgs(
|
|
140
148
|
"@agoric/builders/scripts/inter-protocol/updatePriceFeeds.js",
|
|
@@ -165,33 +173,42 @@ func unreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) func(sdk.Conte
|
|
|
165
173
|
replaceElectorateStep, err := replaceElectorateCoreProposalStep(targetUpgrade)
|
|
166
174
|
if err != nil {
|
|
167
175
|
return nil, err
|
|
176
|
+
} else if replaceElectorateStep != nil {
|
|
177
|
+
CoreProposalSteps = append(CoreProposalSteps, replaceElectorateStep)
|
|
168
178
|
}
|
|
169
179
|
|
|
170
180
|
priceFeedUpdate, err := replacePriceFeedsCoreProposal(targetUpgrade)
|
|
171
181
|
if err != nil {
|
|
172
182
|
return nil, err
|
|
183
|
+
} else if priceFeedUpdate != nil {
|
|
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
|
+
)
|
|
173
194
|
}
|
|
174
195
|
|
|
175
196
|
// Each CoreProposalStep runs sequentially, and can be constructed from
|
|
176
197
|
// one or more modules executing in parallel within the step.
|
|
177
|
-
CoreProposalSteps =
|
|
178
|
-
replaceElectorateStep,
|
|
179
|
-
priceFeedUpdate,
|
|
198
|
+
CoreProposalSteps = append(CoreProposalSteps,
|
|
180
199
|
vm.CoreProposalStepForModules(
|
|
181
|
-
|
|
200
|
+
// Upgrade Zoe (no new ZCF needed).
|
|
201
|
+
"@agoric/builders/scripts/vats/upgrade-zoe.js",
|
|
182
202
|
),
|
|
203
|
+
// Revive KREAd characters
|
|
183
204
|
vm.CoreProposalStepForModules(
|
|
184
|
-
"@agoric/builders/scripts/vats/
|
|
205
|
+
"@agoric/builders/scripts/vats/revive-kread.js",
|
|
185
206
|
),
|
|
186
207
|
vm.CoreProposalStepForModules(
|
|
187
|
-
// Upgrade
|
|
188
|
-
"@agoric/builders/scripts/
|
|
208
|
+
// Upgrade to include a cleanup from https://github.com/Agoric/agoric-sdk/pull/10319
|
|
209
|
+
"@agoric/builders/scripts/smart-wallet/build-wallet-factory2-upgrade.js",
|
|
189
210
|
),
|
|
190
|
-
|
|
191
|
-
vm.CoreProposalStepForModules(
|
|
192
|
-
"@agoric/builders/scripts/vats/revive-kread.js",
|
|
193
|
-
),
|
|
194
|
-
}
|
|
211
|
+
)
|
|
195
212
|
}
|
|
196
213
|
|
|
197
214
|
app.upgradeDetails = &upgradeDetails{
|
package/cmd/agd/agvm.go
CHANGED
|
@@ -27,9 +27,9 @@ func NewVMCommand(logger log.Logger, binary string, args []string, vmFromAgd, vm
|
|
|
27
27
|
fdToAgd := fdFromAgd + 1
|
|
28
28
|
|
|
29
29
|
// ExtraFiles begins at fd numStdFiles, so we need to compute the array.
|
|
30
|
-
cmd.ExtraFiles = make([]*os.File, fdToAgd
|
|
31
|
-
cmd.ExtraFiles[fdFromAgd
|
|
32
|
-
cmd.ExtraFiles[fdToAgd
|
|
30
|
+
cmd.ExtraFiles = make([]*os.File, fdToAgd-numStdFiles+1)
|
|
31
|
+
cmd.ExtraFiles[fdFromAgd-numStdFiles] = vmFromAgd
|
|
32
|
+
cmd.ExtraFiles[fdToAgd-numStdFiles] = vmToAgd
|
|
33
33
|
|
|
34
34
|
// Pass the file descriptor numbers in the environment.
|
|
35
35
|
cmd.Env = append(
|
package/cmd/agd/find_binary.go
CHANGED
|
@@ -8,7 +8,7 @@ import (
|
|
|
8
8
|
|
|
9
9
|
// FindBinaryNextToMe looks for binName next to the current executable.
|
|
10
10
|
// It returns an absolute filename for binName, or an error.
|
|
11
|
-
func FindBinaryNextToMe(walkUp int, path...
|
|
11
|
+
func FindBinaryNextToMe(walkUp int, path ...string) (string, error) {
|
|
12
12
|
ex, err := os.Executable()
|
|
13
13
|
if err != nil {
|
|
14
14
|
return "", err
|
|
@@ -32,7 +32,7 @@ func FindBinaryNextToMe(walkUp int, path... string) (string, error) {
|
|
|
32
32
|
if _, err = os.Stat(bin); err != nil {
|
|
33
33
|
return "", err
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
return bin, nil
|
|
37
37
|
}
|
|
38
38
|
|
package/git-revision.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ef001c0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/cosmos",
|
|
3
|
-
"version": "0.34.2-upgrade-18-dev-
|
|
3
|
+
"version": "0.34.2-upgrade-18-dev-ef001c0.0+ef001c0",
|
|
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": "ef001c015ac66ff65840bee1f7fd3847e999154d"
|
|
43
43
|
}
|
package/vm/client.go
CHANGED
|
@@ -12,8 +12,8 @@ const ReceiveMessageMethod = "agvm.ReceiveMessage"
|
|
|
12
12
|
|
|
13
13
|
// Message is what we send to the VM.
|
|
14
14
|
type Message struct {
|
|
15
|
-
Port
|
|
16
|
-
Data
|
|
15
|
+
Port int
|
|
16
|
+
Data string
|
|
17
17
|
NeedsReply bool
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -24,7 +24,9 @@ var _ rpc.ClientCodec = (*ClientCodec)(nil)
|
|
|
24
24
|
// runtime and the VM in the single-process dual-runtime configuration.
|
|
25
25
|
//
|
|
26
26
|
// We expect to call it via the legacy API with signature:
|
|
27
|
-
//
|
|
27
|
+
//
|
|
28
|
+
// sendToController func(needsReply bool, msg string) (string, error)
|
|
29
|
+
//
|
|
28
30
|
// where msg and the returned string are JSON-encoded values.
|
|
29
31
|
//
|
|
30
32
|
// Note that the net/rpc framework cannot express a call that does not expect a
|
|
@@ -32,22 +34,22 @@ var _ rpc.ClientCodec = (*ClientCodec)(nil)
|
|
|
32
34
|
// having the WriteRequest() method fabricate a Receive() call to clear the rpc
|
|
33
35
|
// state.
|
|
34
36
|
type ClientCodec struct {
|
|
35
|
-
ctx
|
|
36
|
-
send
|
|
37
|
-
outbound
|
|
38
|
-
inbound
|
|
39
|
-
replies
|
|
37
|
+
ctx context.Context
|
|
38
|
+
send func(port, rPort int, msg string)
|
|
39
|
+
outbound map[int]rpc.Request
|
|
40
|
+
inbound chan *rpc.Response
|
|
41
|
+
replies map[uint64]string
|
|
40
42
|
replyToRead uint64
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
// NewClientCodec creates a new ClientCodec.
|
|
44
46
|
func NewClientCodec(ctx context.Context, send func(int, int, string)) *ClientCodec {
|
|
45
47
|
return &ClientCodec{
|
|
46
|
-
ctx:
|
|
47
|
-
send:
|
|
48
|
+
ctx: ctx,
|
|
49
|
+
send: send,
|
|
48
50
|
outbound: make(map[int]rpc.Request),
|
|
49
|
-
inbound:
|
|
50
|
-
replies:
|
|
51
|
+
inbound: make(chan *rpc.Response),
|
|
52
|
+
replies: make(map[uint64]string),
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
|
|
@@ -97,7 +99,7 @@ func (cc *ClientCodec) Receive(rPort int, isError bool, data string) error {
|
|
|
97
99
|
delete(cc.outbound, rPort)
|
|
98
100
|
resp := &rpc.Response{
|
|
99
101
|
ServiceMethod: outb.ServiceMethod,
|
|
100
|
-
Seq:
|
|
102
|
+
Seq: outb.Seq,
|
|
101
103
|
}
|
|
102
104
|
if isError {
|
|
103
105
|
resp.Error = data
|
package/x/vbank/types/key.go
CHANGED
|
@@ -7,7 +7,7 @@ const (
|
|
|
7
7
|
// StoreKey to be used when creating the KVStore
|
|
8
8
|
StoreKey = ModuleName
|
|
9
9
|
|
|
10
|
-
ReservePoolName
|
|
11
|
-
GiveawayPoolName
|
|
12
|
-
ProvisionPoolName
|
|
10
|
+
ReservePoolName = "vbank/reserve"
|
|
11
|
+
GiveawayPoolName = "vbank/giveaway"
|
|
12
|
+
ProvisionPoolName = "vbank/provision"
|
|
13
13
|
)
|