@agoric/cosmos 0.34.2-orchestration-dev-096c4e8.0 → 0.34.2-upgrade-16-dev-8879538.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.
@@ -1,13 +1,24 @@
1
1
  package cmd_test
2
2
 
3
3
  import (
4
+ "bytes"
5
+ "io"
6
+ "os"
4
7
  "testing"
8
+ "text/template"
5
9
 
10
+ "github.com/spf13/pflag"
11
+ "github.com/stretchr/testify/require"
12
+
13
+ "github.com/cosmos/cosmos-sdk/server"
6
14
  svrcmd "github.com/cosmos/cosmos-sdk/server/cmd"
15
+ serverconfig "github.com/cosmos/cosmos-sdk/server/config"
16
+ servertypes "github.com/cosmos/cosmos-sdk/server/types"
17
+ "github.com/tendermint/tendermint/libs/log"
18
+ dbm "github.com/tendermint/tm-db"
7
19
 
8
20
  app "github.com/Agoric/agoric-sdk/golang/cosmos/app"
9
21
  "github.com/Agoric/agoric-sdk/golang/cosmos/daemon/cmd"
10
- "github.com/stretchr/testify/require"
11
22
  )
12
23
 
13
24
  func TestRootCmdConfig(t *testing.T) {
@@ -21,3 +32,180 @@ func TestRootCmdConfig(t *testing.T) {
21
32
 
22
33
  require.NoError(t, svrcmd.Execute(rootCmd, "", app.DefaultNodeHome))
23
34
  }
35
+
36
+ func TestCLIFlags(t *testing.T) {
37
+ // List of flags we have so far observed as used by the base cosmos sdk
38
+ // Before adding any flag to this list, the author should audit if explicit
39
+ // handling should not be added in the Agoric app (most likely in root.go)
40
+ expectedFlagNames := map[string]interface{}{
41
+ "abci": "",
42
+ "abci-client-type": "",
43
+ "address": "",
44
+ "app-db-backend": "",
45
+ "cpu-profile": "",
46
+ "db_backend": "",
47
+ "db_dir": "",
48
+ "fast_sync": "",
49
+ "genesis_hash": "",
50
+ "grpc-only": "",
51
+ "halt-height": "",
52
+ "halt-time": "",
53
+ "home": "",
54
+ "iavl-cache-size": "",
55
+ "iavl-disable-fastnode": "",
56
+ "iavl-lazy-loading": "",
57
+ "index-events": "",
58
+ "inter-block-cache": "",
59
+ "inv-check-period": "",
60
+ "min-retain-blocks": "",
61
+ "minimum-gas-prices": "",
62
+ "moniker": "",
63
+ "priv_validator_laddr": "",
64
+ "proxy_app": "",
65
+ "pruning": "default",
66
+ "pruning-interval": "",
67
+ "pruning-keep-recent": "",
68
+ "trace": "",
69
+ "trace-store": "",
70
+ "transport": "",
71
+ "unsafe-skip-upgrades": "",
72
+ "with-tendermint": "",
73
+
74
+ "api.address": "",
75
+ "api.enable": "",
76
+ "api.enabled-unsafe-cors": "",
77
+ "api.max-open-connections": "",
78
+ "api.rpc-max-body-bytes": "",
79
+ "api.rpc-read-timeout": "",
80
+ "api.rpc-write-timeout": "",
81
+ "api.swagger": "",
82
+
83
+ "consensus.create_empty_blocks": "",
84
+ "consensus.create_empty_blocks_interval": "",
85
+ "consensus.double_sign_check_height": "",
86
+
87
+ "grpc-web.address": "",
88
+ "grpc-web.enable": "",
89
+ "grpc-web.enable-unsafe-cors": "",
90
+
91
+ "grpc.address": "",
92
+ "grpc.enable": "",
93
+ "grpc.max-recv-msg-size": "",
94
+ "grpc.max-send-msg-size": "",
95
+
96
+ "p2p.external-address": "",
97
+ "p2p.laddr": "",
98
+ "p2p.persistent_peers": "",
99
+ "p2p.pex": "",
100
+ "p2p.private_peer_ids": "",
101
+ "p2p.seed_mode": "",
102
+ "p2p.seeds": "",
103
+ "p2p.unconditional_peer_ids": "",
104
+ "p2p.upnp": "",
105
+
106
+ "rpc.grpc_laddr": "",
107
+ "rpc.laddr": "",
108
+ "rpc.pprof_laddr": "",
109
+ "rpc.unsafe": "",
110
+
111
+ "rosetta.address": "",
112
+ "rosetta.blockchain": "",
113
+ "rosetta.denom-to-suggest": "",
114
+ "rosetta.enable-fee-suggestion": "",
115
+ "rosetta.enable": "",
116
+ "rosetta.gas-to-suggest": "",
117
+ "rosetta.network": "",
118
+ "rosetta.offline": "",
119
+ "rosetta.retries": "",
120
+
121
+ "state-sync.snapshot-interval": "",
122
+ "state-sync.snapshot-keep-recent": "",
123
+
124
+ "store.streamers": "",
125
+
126
+ "streamers.file.fsync": "",
127
+ "streamers.file.keys": "",
128
+ "streamers.file.output-metadata": "",
129
+ "streamers.file.prefix": "",
130
+ "streamers.file.stop-node-on-error": "",
131
+ "streamers.file.write_dir": "",
132
+
133
+ "telemetry.enable-hostname-label": "",
134
+ "telemetry.enable-hostname": "",
135
+ "telemetry.enable-service-label": "",
136
+ "telemetry.enabled": "",
137
+ "telemetry.global-labels": "",
138
+ "telemetry.prometheus-retention-time": "",
139
+ "telemetry.service-name": "",
140
+ }
141
+ unknownFlagNames := []string{}
142
+ missingFlagNames := map[string]bool{}
143
+ for name := range expectedFlagNames {
144
+ missingFlagNames[name] = true
145
+ }
146
+ readFlag := func(name string) interface{} {
147
+ if defaultValue, found := expectedFlagNames[name]; found {
148
+ delete(missingFlagNames, name)
149
+ return defaultValue
150
+ }
151
+ unknownFlagNames = append(unknownFlagNames, name)
152
+ return nil
153
+ }
154
+
155
+ homeDir, err := os.MkdirTemp("", "cosmos-sdk-home")
156
+ if err != nil {
157
+ panic(err)
158
+ }
159
+ defer os.RemoveAll(homeDir)
160
+
161
+ // First get the command line flags that the base cosmos-sdk defines
162
+ dummyAppCreator := func(
163
+ logger log.Logger,
164
+ db dbm.DB,
165
+ traceStore io.Writer,
166
+ appOpts servertypes.AppOptions,
167
+ ) servertypes.Application {
168
+ return new(app.GaiaApp)
169
+ }
170
+ cmd := server.StartCmd(dummyAppCreator, homeDir)
171
+ flags := cmd.Flags()
172
+ flags.SortFlags = true
173
+ flags.VisitAll(func(flag *pflag.Flag) {
174
+ readFlag(flag.Name)
175
+ })
176
+
177
+ // Then get the options parsing the default config file.
178
+ serverCtx := server.NewDefaultContext()
179
+ // appTemplate, appConfig := initAppConfig()
180
+ appTemplate := serverconfig.DefaultConfigTemplate
181
+ appConfig := serverconfig.DefaultConfig()
182
+ configTemplate := template.Must(template.New("").Parse(appTemplate))
183
+ var buffer bytes.Buffer
184
+ if err := configTemplate.Execute(&buffer, appConfig); err != nil {
185
+ panic(err)
186
+ }
187
+ serverCtx.Viper.SetConfigType("toml")
188
+ if err := serverCtx.Viper.MergeConfig(&buffer); err != nil {
189
+ panic(err)
190
+ }
191
+ for _, configKey := range serverCtx.Viper.AllKeys() {
192
+ readFlag(configKey)
193
+ }
194
+
195
+ if len(unknownFlagNames) != 0 {
196
+ t.Error(
197
+ "unknown CLI flags in cosmos-sdk; incorporate as needed and update this test",
198
+ unknownFlagNames,
199
+ )
200
+ }
201
+ if len(missingFlagNames) != 0 {
202
+ missing := []string{}
203
+ for name := range missingFlagNames {
204
+ missing = append(missing, name)
205
+ }
206
+ t.Error(
207
+ "expected CLI flags missing from cosmos-sdk; remove from this test",
208
+ missing,
209
+ )
210
+ }
211
+ }
package/git-revision.txt CHANGED
@@ -1 +1 @@
1
- 096c4e8
1
+ 8879538
package/go.mod CHANGED
@@ -7,8 +7,8 @@ require (
7
7
  cosmossdk.io/math v1.0.0-rc.0
8
8
  github.com/armon/go-metrics v0.4.1
9
9
  github.com/cosmos/cosmos-sdk v0.46.16
10
- github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.1
11
- github.com/cosmos/ibc-go/v6 v6.2.1
10
+ github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.2
11
+ github.com/cosmos/ibc-go/v6 v6.3.1
12
12
  github.com/gogo/protobuf v1.3.3
13
13
  github.com/golang/protobuf v1.5.3
14
14
  github.com/gorilla/mux v1.8.0
@@ -16,9 +16,9 @@ require (
16
16
  github.com/pkg/errors v0.9.1
17
17
  github.com/rakyll/statik v0.1.7
18
18
  github.com/spf13/cast v1.5.0
19
- github.com/spf13/cobra v1.6.1
19
+ github.com/spf13/cobra v1.7.0
20
20
  github.com/spf13/viper v1.14.0
21
- github.com/stretchr/testify v1.8.2
21
+ github.com/stretchr/testify v1.8.4
22
22
  github.com/tendermint/tendermint v0.34.29
23
23
  github.com/tendermint/tm-db v0.6.7
24
24
  google.golang.org/genproto/googleapis/api v0.0.0-20230711160842-782d3b101e98
@@ -101,7 +101,7 @@ require (
101
101
  github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect
102
102
  github.com/iancoleman/orderedmap v0.2.0 // indirect
103
103
  github.com/improbable-eng/grpc-web v0.15.0 // indirect
104
- github.com/inconshreveable/mousetrap v1.0.1 // indirect
104
+ github.com/inconshreveable/mousetrap v1.1.0 // indirect
105
105
  github.com/jmespath/go-jmespath v0.4.0 // indirect
106
106
  github.com/jmhodges/levigo v1.0.0 // indirect
107
107
  github.com/klauspost/compress v1.16.0 // indirect
@@ -187,10 +187,10 @@ replace (
187
187
  // Agoric-specific replacements:
188
188
  replace (
189
189
  // We need a fork of cosmos-sdk until all of the differences are merged.
190
- github.com/cosmos/cosmos-sdk => github.com/agoric-labs/cosmos-sdk v0.46.16-alpha.agoric.2
190
+ github.com/cosmos/cosmos-sdk => github.com/agoric-labs/cosmos-sdk v0.46.16-alpha.agoric.2.4
191
191
 
192
- // Async version negotiation
193
- github.com/cosmos/ibc-go/v6 => github.com/agoric-labs/ibc-go/v6 v6.2.1-alpha.agoric.3
192
+ // Pick up an IAVL race fix.
193
+ github.com/cosmos/iavl => github.com/cosmos/iavl v0.19.7
194
194
 
195
195
  // use cometbft
196
196
  // Use our fork at least until post-v0.34.14 is released with
package/go.sum CHANGED
@@ -232,12 +232,10 @@ github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBA
232
232
  github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c=
233
233
  github.com/agoric-labs/cometbft v0.34.30-alpha.agoric.1 h1:tqCNL72pQXdUmBzgv1md5SN2U3K/PaYQ4qZ5pFv8v6w=
234
234
  github.com/agoric-labs/cometbft v0.34.30-alpha.agoric.1/go.mod h1:myvkihZD8eg9jKE3WFaugkNoL5nvEqlP7Jbjg98pCek=
235
- github.com/agoric-labs/cosmos-sdk v0.46.16-alpha.agoric.2 h1:iHHqpYC0JzMbH4UYnQrcwVjLyHJuQphB0ogHbuLz44c=
236
- github.com/agoric-labs/cosmos-sdk v0.46.16-alpha.agoric.2/go.mod h1:zUe5lsg/X7SeSO1nGkzOh9EGKO295szfrxIxYmeLYic=
235
+ github.com/agoric-labs/cosmos-sdk v0.46.16-alpha.agoric.2.4 h1:i5IgChQjTyWulV/y5NpVBB5qBJETQ59hYglod6vhok0=
236
+ github.com/agoric-labs/cosmos-sdk v0.46.16-alpha.agoric.2.4/go.mod h1:d7e4h+w7FNBNmE6ysp6duBVuQg67pqMtvsLwpT9ca3E=
237
237
  github.com/agoric-labs/cosmos-sdk/ics23/go v0.8.0-alpha.agoric.1 h1:2jvHI/2d+psWAZy6FQ0vXJCHUtfU3ZbbW+pQFL04arQ=
238
238
  github.com/agoric-labs/cosmos-sdk/ics23/go v0.8.0-alpha.agoric.1/go.mod h1:E45NqnlpxGnpfTWL/xauN7MRwEE28T4Dd4uraToOaKg=
239
- github.com/agoric-labs/ibc-go/v6 v6.2.1-alpha.agoric.3 h1:YqvVwK+Lg/ZsuwyVm9UbPs8K55fg00R3Y9KnmaTBdgc=
240
- github.com/agoric-labs/ibc-go/v6 v6.2.1-alpha.agoric.3/go.mod h1:V9NOCRS9RPkSJNJQIPRAjZn/lo2mCAAKOSv3/83ISDY=
241
239
  github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
242
240
  github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
243
241
  github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
@@ -378,10 +376,12 @@ github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY
378
376
  github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
379
377
  github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y=
380
378
  github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw=
381
- github.com/cosmos/iavl v0.19.6 h1:XY78yEeNPrEYyNCKlqr9chrwoeSDJ0bV2VjocTk//OU=
382
- github.com/cosmos/iavl v0.19.6/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
383
- github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.1 h1:2geCtV4PoNPeRnVc0HMAcRcv+7W3Mvk2nmASkGkOdzE=
384
- github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.1/go.mod h1:ovYRGX7P7Vq0D54JIVlIm/47STEKgWJfw9frvL0AWGQ=
379
+ github.com/cosmos/iavl v0.19.7 h1:ij32FaEnwxfEurtK0QKDNhTWFnz6NUmrI5gky/WnoY0=
380
+ github.com/cosmos/iavl v0.19.7/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
381
+ github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.2 h1:Hz4nkpStoXIHrC77CIEyu2mRiN2qysGEZPFRf0fpv7w=
382
+ github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.2/go.mod h1:Jo934o/sW7fNxuOa/TjCalSalz+1Fd649eLyANaJx8g=
383
+ github.com/cosmos/ibc-go/v6 v6.3.1 h1:/5ur3AsmNW8WuOevfODHlaY5Ze236PBNE3vVo9o3fQA=
384
+ github.com/cosmos/ibc-go/v6 v6.3.1/go.mod h1:Dm14j9s094bGyCEE8W4fD+2t8IneHv+cz+80Mvwjr1w=
385
385
  github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo=
386
386
  github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA=
387
387
  github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw=
@@ -733,8 +733,8 @@ github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:
733
733
  github.com/improbable-eng/grpc-web v0.15.0 h1:BN+7z6uNXZ1tQGcNAuaU1YjsLTApzkjt2tzCixLaUPQ=
734
734
  github.com/improbable-eng/grpc-web v0.15.0/go.mod h1:1sy9HKV4Jt9aEs9JSnkWlRJPuPtwNr0l57L4f878wP8=
735
735
  github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
736
- github.com/inconshreveable/mousetrap v1.0.1 h1:U3uMjPSQEBMNp1lFxmllqCPM6P5u/Xq7Pgzkat/bFNc=
737
- github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
736
+ github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
737
+ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
738
738
  github.com/influxdata/flux v0.65.1/go.mod h1:J754/zds0vvpfwuq7Gc2wRdVwEodfpCFM7mYlOw2LqY=
739
739
  github.com/influxdata/influxdb v1.8.3/go.mod h1:JugdFhsvvI8gadxOI6noqNeeBHvWNTbfYGtiAn+2jhI=
740
740
  github.com/influxdata/influxdb-client-go/v2 v2.4.0/go.mod h1:vLNHdxTJkIf2mSLvGrpj8TCcISApPoXkaxP8g9uRlW8=
@@ -1060,8 +1060,8 @@ github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
1060
1060
  github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
1061
1061
  github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
1062
1062
  github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
1063
- github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA=
1064
- github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY=
1063
+ github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
1064
+ github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
1065
1065
  github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
1066
1066
  github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
1067
1067
  github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
@@ -1091,8 +1091,8 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
1091
1091
  github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
1092
1092
  github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
1093
1093
  github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
1094
- github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
1095
- github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
1094
+ github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
1095
+ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
1096
1096
  github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs=
1097
1097
  github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
1098
1098
  github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
@@ -1168,6 +1168,7 @@ go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqe
1168
1168
  go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
1169
1169
  go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
1170
1170
  go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
1171
+ go.uber.org/mock v0.2.0 h1:TaP3xedm7JaAgScZO7tlvlKrqT0p7I6OsdGB5YNSMDU=
1171
1172
  go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
1172
1173
  go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4=
1173
1174
  go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA=
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@agoric/cosmos",
3
- "version": "0.34.2-orchestration-dev-096c4e8.0+096c4e8",
3
+ "version": "0.34.2-upgrade-16-dev-8879538.0+8879538",
4
4
  "description": "Connect JS to the Cosmos blockchain SDK",
5
5
  "parsers": {
6
6
  "js": "mjs"
7
7
  },
8
8
  "main": "index.cjs",
9
9
  "engines": {
10
- "node": ">=14.15.0"
10
+ "node": "^18.12 || ^20.9"
11
11
  },
12
+ "packageManager": "yarn@1.22.19",
12
13
  "scripts": {
13
14
  "test": "exit 0",
14
15
  "build:all": "make",
@@ -38,5 +39,5 @@
38
39
  "typeCoverage": {
39
40
  "atLeast": 0
40
41
  },
41
- "gitHead": "096c4e8fce80e9a509b0e1a30fda11736c4570e1"
42
+ "gitHead": "8879538cd1d125a08346f02dd5701d0d70c90bb8"
42
43
  }
@@ -8,7 +8,7 @@ option go_package = "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types
8
8
 
9
9
  // CoreEvalProposal is a gov Content type for evaluating code in the SwingSet
10
10
  // core.
11
- // See `agoric-sdk/packages/vats/src/core/eval.js`.
11
+ // See `bridgeCoreEval` in agoric-sdk packages/vats/src/core/chain-behaviors.js.
12
12
  message CoreEvalProposal {
13
13
  option (gogoproto.goproto_getters) = false;
14
14
 
@@ -3,12 +3,12 @@
3
3
  set -eo pipefail
4
4
 
5
5
  protoc_gen_gocosmos() {
6
- if ! grep "github.com/gogo/protobuf => github.com/regen-network/protobuf" go.mod &>/dev/null ; then
6
+ if ! grep "github.com/gogo/protobuf => github.com/regen-network/protobuf" go.mod &> /dev/null; then
7
7
  echo -e "\tPlease run this command from somewhere inside the ibc-go folder."
8
8
  return 1
9
9
  fi
10
10
 
11
- go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@latest 2>/dev/null
11
+ go get github.com/regen-network/cosmos-proto/protoc-gen-gocosmos@latest 2> /dev/null
12
12
  }
13
13
 
14
14
  protoc_gen_gocosmos
@@ -19,12 +19,11 @@ for dir in $proto_dirs; do
19
19
  # allow_colon_final_segments=true
20
20
  # as per https://grpc-ecosystem.github.io/grpc-gateway/docs/development/grpc-gateway_v2_migration_guide/#withlastmatchwins-and-allow_colon_final_segmentstrue-is-now-default-behaviour
21
21
  protoc \
22
- -I proto \
23
- -I third_party/proto \
24
- --gocosmos_out=plugins=grpc,\
25
- Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \
26
- --grpc-gateway_out=logtostderr=true,allow_colon_final_segments=true:. \
27
- $(find "${dir}" -maxdepth 1 -name '*.proto')
22
+ -I proto \
23
+ -I third_party/proto \
24
+ --gocosmos_out=plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types:. \
25
+ --grpc-gateway_out=logtostderr=true,allow_colon_final_segments=true:. \
26
+ $(find "${dir}" -maxdepth 1 -name '*.proto')
28
27
  done
29
28
 
30
29
  # move proto files to the right places
package/upgradegaia.sh CHANGED
@@ -8,8 +8,8 @@
8
8
  set -ueo pipefail
9
9
 
10
10
  test $# -eq 2 || {
11
- echo "Usage: $0 <FROM_BRANCH> <TO_BRANCH>" 1>&2
12
- exit 1
11
+ echo "Usage: $0 <FROM_BRANCH> <TO_BRANCH>" 1>&2
12
+ exit 1
13
13
  }
14
14
 
15
15
  FROM_BRANCH="$1"
@@ -23,8 +23,8 @@ for tag in "$FROM_BRANCH" "$TO_BRANCH"; do
23
23
  qtag=${tag//\//_}
24
24
  for root in Makefile app cmd/gaiad; do
25
25
  case "$root" in
26
- Makefile) echo "$root" ;;
27
- *) git ls-tree --name-only --full-tree -r "$tag:$root" | sed -e "s!^!$root/!" ;;
26
+ Makefile) echo "$root" ;;
27
+ *) git ls-tree --name-only --full-tree -r "$tag:$root" | sed -e "s!^!$root/!" ;;
28
28
  esac
29
29
  done | while read -r src; do
30
30
  # echo "$src"
@@ -36,12 +36,12 @@ for tag in "$FROM_BRANCH" "$TO_BRANCH"; do
36
36
  done
37
37
 
38
38
  echo "Compute 3-way diffs between Gaia and us"
39
- (cd "$tmp/${FROM_BRANCH//\//_}" && find . -type f -print) | \
40
- while read -r src; do
39
+ (cd "$tmp/${FROM_BRANCH//\//_}" && find . -type f -print) \
40
+ | while read -r src; do
41
41
  # echo "$src"
42
42
  case "$src" in
43
- ./cmd/gaiad/*) our=${src//cmd\/gaiad/daemon} ;;
44
- *) our=$src ;;
43
+ ./cmd/gaiad/*) our=${src//cmd\/gaiad/daemon} ;;
44
+ *) our=$src ;;
45
45
  esac
46
46
 
47
47
  new="$tmp/diff3/$our"
package/vm/client_test.go CHANGED
@@ -20,7 +20,7 @@ type errorWrapper struct {
20
20
  // ConnectVMClientCodec creates an RPC client codec and a sender to the
21
21
  // in-process implementation of the VM.
22
22
  func ConnectVMClientCodec(ctx context.Context, nodePort int, sendFunc func(int, int, string)) (*vm.ClientCodec, Sender) {
23
- vmClientCodec := vm.NewClientCodec(context.Background(), sendFunc)
23
+ vmClientCodec := vm.NewClientCodec(ctx, sendFunc)
24
24
  vmClient := rpc.NewClientWithCodec(vmClientCodec)
25
25
 
26
26
  sendToNode := func(ctx context.Context, needReply bool, str string) (string, error) {
@@ -29,9 +29,9 @@ func ConnectVMClientCodec(ctx context.Context, nodePort int, sendFunc func(int,
29
29
  }
30
30
 
31
31
  msg := vm.Message{
32
- Port: nodePort,
32
+ Port: nodePort,
33
33
  NeedsReply: needReply,
34
- Data: str,
34
+ Data: str,
35
35
  }
36
36
  var reply string
37
37
  err := vmClient.Call(vm.ReceiveMessageMethod, msg, &reply)
@@ -43,33 +43,34 @@ func ConnectVMClientCodec(ctx context.Context, nodePort int, sendFunc func(int,
43
43
 
44
44
  type Fixture struct {
45
45
  SendToNode Sender
46
- SendToGo func (port int, msgStr string) string
47
- ReplyToGo func (replyPort int, isError bool, respStr string) int
46
+ SendToGo func(port int, msgStr string) string
47
+ ReplyToGo func(replyPort int, isError bool, respStr string) int
48
48
  }
49
49
 
50
- func NewFixture(t *testing.T) (*Fixture) {
50
+ func NewFixture(t *testing.T) *Fixture {
51
51
  nodePort := 42
52
52
 
53
53
  f := &Fixture{}
54
+ agdServer := vm.NewAgdServer()
54
55
 
55
56
  sendFunc := func(port int, reply int, str string) {
56
57
  switch str {
57
- case "ping":
58
- time.AfterFunc(100*time.Millisecond, func() {
59
- fmt.Printf("sendFunc: port=%d, reply=%d, str=%s\n", port, reply, str)
60
- if reply != 0 {
61
- f.ReplyToGo(reply, false, "pong")
62
- }
63
- })
64
- case "wait":
65
- time.AfterFunc(300*time.Millisecond, func() {
66
- fmt.Printf("sendFunc: port=%d, reply=%d, str=%s\n", port, reply, str)
67
- if reply != 0 {
68
- f.ReplyToGo(reply, false, "done-waiting")
69
- }
70
- })
71
- default:
72
- t.Errorf("Unexpected message %s", str)
58
+ case "ping":
59
+ time.AfterFunc(100*time.Millisecond, func() {
60
+ fmt.Printf("sendFunc: port=%d, reply=%d, str=%s\n", port, reply, str)
61
+ if reply != 0 {
62
+ f.ReplyToGo(reply, false, "pong")
63
+ }
64
+ })
65
+ case "wait":
66
+ time.AfterFunc(300*time.Millisecond, func() {
67
+ fmt.Printf("sendFunc: port=%d, reply=%d, str=%s\n", port, reply, str)
68
+ if reply != 0 {
69
+ f.ReplyToGo(reply, false, "done-waiting")
70
+ }
71
+ })
72
+ default:
73
+ t.Errorf("Unexpected message %s", str)
73
74
  }
74
75
  }
75
76
 
@@ -78,23 +79,22 @@ func NewFixture(t *testing.T) (*Fixture) {
78
79
  int(nodePort),
79
80
  sendFunc,
80
81
  )
81
- agdServer := vm.NewAgdServer()
82
82
 
83
83
  f.SendToNode = sendToNode
84
- f.SendToGo = func (port int, msgStr string) string {
84
+ f.SendToGo = func(port int, msgStr string) string {
85
85
  fmt.Println("Send to Go", msgStr)
86
86
  var respStr string
87
87
  message := &vm.Message{
88
- Port: int(port),
88
+ Port: int(port),
89
89
  NeedsReply: true,
90
- Data: msgStr,
90
+ Data: msgStr,
91
91
  }
92
-
92
+
93
93
  err := agdServer.ReceiveMessage(message, &respStr)
94
94
  if err == nil {
95
95
  return respStr
96
96
  }
97
-
97
+
98
98
  // fmt.Fprintln(os.Stderr, "Cannot receive from controller", err)
99
99
  errResp := errorWrapper{
100
100
  Error: err.Error(),
@@ -106,7 +106,7 @@ func NewFixture(t *testing.T) (*Fixture) {
106
106
  return string(respBytes)
107
107
  }
108
108
 
109
- f.ReplyToGo = func (replyPort int, isError bool, respStr string) int {
109
+ f.ReplyToGo = func(replyPort int, isError bool, respStr string) int {
110
110
  if err := vmClientCodec.Receive(replyPort, isError, respStr); err != nil {
111
111
  return 1
112
112
  }
package/vm/controller.go CHANGED
@@ -21,20 +21,10 @@ type ControllerAdmissionMsg interface {
21
21
  IsHighPriority(sdk.Context, interface{}) (bool, error)
22
22
  }
23
23
 
24
- var wrappedEmptySDKContext = sdk.WrapSDKContext(
25
- sdk.Context{}.WithContext(context.Background()),
26
- )
27
- var controllerContext context.Context = wrappedEmptySDKContext
28
-
29
24
  type PortHandler interface {
30
25
  Receive(context.Context, string) (string, error)
31
26
  }
32
27
 
33
- var portToHandler = make(map[int]PortHandler)
34
- var portToName = make(map[int]string)
35
- var nameToPort = make(map[string]int)
36
- var lastPort = 0
37
-
38
28
  type protectedPortHandler struct {
39
29
  inner PortHandler
40
30
  }
@@ -54,31 +44,3 @@ func (h protectedPortHandler) Receive(ctx context.Context, str string) (ret stri
54
44
  func NewProtectedPortHandler(inner PortHandler) PortHandler {
55
45
  return protectedPortHandler{inner}
56
46
  }
57
-
58
- func SetControllerContext(ctx sdk.Context) func() {
59
- // We are only called by the controller, so we assume that it is billing its
60
- // own meter usage.
61
- controllerContext = sdk.WrapSDKContext(ctx.WithGasMeter(sdk.NewInfiniteGasMeter()))
62
- return func() {
63
- controllerContext = wrappedEmptySDKContext
64
- }
65
- }
66
-
67
- func GetPort(name string) int {
68
- return nameToPort[name]
69
- }
70
-
71
- func RegisterPortHandler(name string, portHandler PortHandler) int {
72
- lastPort++
73
- portToHandler[lastPort] = NewProtectedPortHandler(portHandler)
74
- portToName[lastPort] = name
75
- nameToPort[name] = lastPort
76
- return lastPort
77
- }
78
- func UnregisterPortHandler(portNum int) error {
79
- delete(portToHandler, portNum)
80
- name := portToName[portNum]
81
- delete(portToName, portNum)
82
- delete(nameToPort, name)
83
- return nil
84
- }