@agoric/cosmos 0.34.2-upgrade-18-dev-d7c994b.0 → 0.34.2-upgrade-18-dev-a0f4883.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 CHANGED
@@ -18,6 +18,7 @@ var upgradeNamesOfThisVersion = []string{
18
18
  "UNRELEASED_A3P_INTEGRATION",
19
19
  "UNRELEASED_main",
20
20
  "UNRELEASED_devnet",
21
+ "UNRELEASED_emerynet",
21
22
  "UNRELEASED_REAPPLY",
22
23
  }
23
24
 
@@ -55,7 +56,8 @@ func isPrimaryUpgradeName(name string) bool {
55
56
  case validUpgradeName("UNRELEASED_BASIC"),
56
57
  validUpgradeName("UNRELEASED_A3P_INTEGRATION"),
57
58
  validUpgradeName("UNRELEASED_main"),
58
- validUpgradeName("UNRELEASED_devnet"):
59
+ validUpgradeName("UNRELEASED_devnet"),
60
+ validUpgradeName("UNRELEASED_emerynet"):
59
61
  return true
60
62
  case validUpgradeName("UNRELEASED_REAPPLY"):
61
63
  return false
@@ -79,10 +81,10 @@ func buildProposalStepWithArgs(moduleName string, entrypoint string, opts map[st
79
81
  t := template.Must(template.New("").Parse(`{
80
82
  "module": "{{.moduleName}}",
81
83
  "entrypoint": "{{.entrypoint}}",
82
- "args": [ {{.args}} ]
84
+ "args": [ {{.optsArg}} ]
83
85
  }`))
84
86
 
85
- args, err := json.Marshal(opts)
87
+ optsArg, err := json.Marshal(opts)
86
88
  if err != nil {
87
89
  return nil, err
88
90
  }
@@ -91,7 +93,7 @@ func buildProposalStepWithArgs(moduleName string, entrypoint string, opts map[st
91
93
  err = t.Execute(&result, map[string]any{
92
94
  "moduleName": moduleName,
93
95
  "entrypoint": entrypoint,
94
- "args": string(args),
96
+ "optsArg": string(optsArg),
95
97
  })
96
98
  if err != nil {
97
99
  return nil, err
@@ -106,23 +108,29 @@ func buildProposalStepWithArgs(moduleName string, entrypoint string, opts map[st
106
108
  }
107
109
 
108
110
  func getVariantFromUpgradeName(upgradeName string) string {
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
- }
111
+ switch upgradeName {
112
+ case "UNRELEASED_A3P_INTEGRATION":
113
+ return "A3P_INTEGRATION"
114
+ case "UNRELEASED_main":
115
+ return "MAINNET"
116
+ case "UNRELEASED_devnet":
117
+ return "DEVNET"
118
+ case "UNRELEASED_emerynet":
119
+ return "EMERYNET"
120
+ // Noupgrade for this version.
121
+ case "UNRELEASED_BASIC":
122
+ return ""
123
+ default:
124
+ return ""
125
+ }
122
126
  }
123
127
 
124
128
  func replaceElectorateCoreProposalStep(upgradeName string) (vm.CoreProposalStep, error) {
125
- variant := getVariantFromUpgradeName(upgradeName)
129
+ variant := getVariantFromUpgradeName(upgradeName)
130
+
131
+ if variant == "" {
132
+ return nil, nil
133
+ }
126
134
 
127
135
  return buildProposalStepWithArgs(
128
136
  "@agoric/builders/scripts/inter-protocol/replace-electorate-core.js",
@@ -134,7 +142,11 @@ func replaceElectorateCoreProposalStep(upgradeName string) (vm.CoreProposalStep,
134
142
  }
135
143
 
136
144
  func replacePriceFeedsCoreProposal(upgradeName string) (vm.CoreProposalStep, error) {
137
- variant := getVariantFromUpgradeName(upgradeName)
145
+ variant := getVariantFromUpgradeName(upgradeName)
146
+
147
+ if variant == "" {
148
+ return nil, nil
149
+ }
138
150
 
139
151
  return buildProposalStepWithArgs(
140
152
  "@agoric/builders/scripts/inter-protocol/updatePriceFeeds.js",
@@ -165,33 +177,42 @@ func unreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) func(sdk.Conte
165
177
  replaceElectorateStep, err := replaceElectorateCoreProposalStep(targetUpgrade)
166
178
  if err != nil {
167
179
  return nil, err
180
+ } else if replaceElectorateStep != nil {
181
+ CoreProposalSteps = append(CoreProposalSteps, replaceElectorateStep)
168
182
  }
169
183
 
170
184
  priceFeedUpdate, err := replacePriceFeedsCoreProposal(targetUpgrade)
171
185
  if err != nil {
172
186
  return nil, err
187
+ } else if priceFeedUpdate != nil {
188
+ CoreProposalSteps = append(CoreProposalSteps,
189
+ priceFeedUpdate,
190
+ // The following have a dependency onto the price feed proposal
191
+ vm.CoreProposalStepForModules(
192
+ "@agoric/builders/scripts/vats/add-auction.js",
193
+ ),
194
+ vm.CoreProposalStepForModules(
195
+ "@agoric/builders/scripts/vats/upgradeVaults.js",
196
+ ),
197
+ )
173
198
  }
174
199
 
175
200
  // Each CoreProposalStep runs sequentially, and can be constructed from
176
201
  // one or more modules executing in parallel within the step.
177
- CoreProposalSteps = []vm.CoreProposalStep{
178
- replaceElectorateStep,
179
- priceFeedUpdate,
202
+ CoreProposalSteps = append(CoreProposalSteps,
180
203
  vm.CoreProposalStepForModules(
181
- "@agoric/builders/scripts/vats/add-auction.js",
204
+ // Upgrade Zoe (no new ZCF needed).
205
+ "@agoric/builders/scripts/vats/upgrade-zoe.js",
182
206
  ),
207
+ // Revive KREAd characters
183
208
  vm.CoreProposalStepForModules(
184
- "@agoric/builders/scripts/vats/upgradeVaults.js",
209
+ "@agoric/builders/scripts/vats/revive-kread.js",
185
210
  ),
186
211
  vm.CoreProposalStepForModules(
187
- // Upgrade Zoe (no new ZCF needed).
188
- "@agoric/builders/scripts/vats/upgrade-zoe.js",
212
+ // Upgrade to include a cleanup from https://github.com/Agoric/agoric-sdk/pull/10319
213
+ "@agoric/builders/scripts/smart-wallet/build-wallet-factory2-upgrade.js",
189
214
  ),
190
- // Revive KREAd characters
191
- vm.CoreProposalStepForModules(
192
- "@agoric/builders/scripts/vats/revive-kread.js",
193
- ),
194
- }
215
+ )
195
216
  }
196
217
 
197
218
  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 - numStdFiles + 1)
31
- cmd.ExtraFiles[fdFromAgd - numStdFiles] = vmFromAgd
32
- cmd.ExtraFiles[fdToAgd - numStdFiles] = vmToAgd
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(
@@ -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... string) (string, error) {
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
- d7c994b
1
+ a0f4883
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/cosmos",
3
- "version": "0.34.2-upgrade-18-dev-d7c994b.0+d7c994b",
3
+ "version": "0.34.2-upgrade-18-dev-a0f4883.0+a0f4883",
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": "d7c994b8d33c0cd22b257f3e33b579588ab6c6d8"
42
+ "gitHead": "a0f4883edbdc9809543c6f63a6a49d5390b40902"
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 int
16
- Data string
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
- // sendToController func(needsReply bool, msg string) (string, error)
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 context.Context
36
- send func(port, rPort int, msg string)
37
- outbound map[int]rpc.Request
38
- inbound chan *rpc.Response
39
- replies map[uint64]string
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: ctx,
47
- send: send,
48
+ ctx: ctx,
49
+ send: send,
48
50
  outbound: make(map[int]rpc.Request),
49
- inbound: make(chan *rpc.Response),
50
- replies: make(map[uint64]string),
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: outb.Seq,
102
+ Seq: outb.Seq,
101
103
  }
102
104
  if isError {
103
105
  resp.Error = data
@@ -7,7 +7,7 @@ const (
7
7
  // StoreKey to be used when creating the KVStore
8
8
  StoreKey = ModuleName
9
9
 
10
- ReservePoolName = "vbank/reserve"
11
- GiveawayPoolName = "vbank/giveaway"
12
- ProvisionPoolName = "vbank/provision"
10
+ ReservePoolName = "vbank/reserve"
11
+ GiveawayPoolName = "vbank/giveaway"
12
+ ProvisionPoolName = "vbank/provision"
13
13
  )