@agoric/cosmos 0.34.2-orchestration-dev-096c4e8.0 → 0.34.2-other-dev-3eb1a1d.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.
Files changed (90) hide show
  1. package/MAINTAINERS.md +3 -0
  2. package/Makefile +38 -34
  3. package/ante/ante.go +1 -4
  4. package/ante/inbound_test.go +2 -2
  5. package/app/app.go +198 -137
  6. package/app/upgrade.go +248 -0
  7. package/cmd/agd/agvm.go +3 -3
  8. package/cmd/agd/find_binary.go +2 -2
  9. package/cmd/agd/main.go +9 -10
  10. package/cmd/libdaemon/main.go +13 -13
  11. package/daemon/cmd/root.go +235 -92
  12. package/daemon/cmd/root_test.go +189 -1
  13. package/daemon/main.go +3 -2
  14. package/git-revision.txt +1 -1
  15. package/go.mod +14 -11
  16. package/go.sum +20 -19
  17. package/index.cjs +1 -1
  18. package/package.json +4 -3
  19. package/proto/agoric/swingset/genesis.proto +4 -0
  20. package/proto/agoric/swingset/swingset.proto +26 -1
  21. package/proto/agoric/vbank/vbank.proto +7 -0
  22. package/proto/agoric/vtransfer/genesis.proto +18 -0
  23. package/scripts/protocgen.sh +7 -8
  24. package/types/kv_entry_helpers.go +42 -0
  25. package/upgradegaia.sh +8 -8
  26. package/util/util.go +21 -0
  27. package/vm/action.go +1 -1
  28. package/vm/client.go +15 -13
  29. package/vm/client_test.go +34 -36
  30. package/vm/controller.go +3 -38
  31. package/vm/core_proposals.go +22 -2
  32. package/vm/proto_json.go +38 -0
  33. package/vm/proto_json_test.go +103 -0
  34. package/vm/server.go +106 -5
  35. package/x/swingset/alias.go +2 -0
  36. package/x/swingset/config.go +234 -0
  37. package/x/swingset/genesis.go +178 -40
  38. package/x/swingset/keeper/extension_snapshotter.go +2 -2
  39. package/x/swingset/keeper/keeper.go +24 -27
  40. package/x/swingset/keeper/swing_store_exports_handler.go +14 -3
  41. package/x/swingset/keeper/test_utils.go +16 -0
  42. package/x/swingset/module.go +24 -9
  43. package/x/swingset/testing/queue.go +17 -0
  44. package/x/swingset/types/default-params.go +31 -5
  45. package/x/swingset/types/expected_keepers.go +2 -2
  46. package/x/swingset/types/genesis.pb.go +78 -25
  47. package/x/swingset/types/msgs.go +53 -12
  48. package/x/swingset/types/params.go +53 -43
  49. package/x/swingset/types/params_test.go +75 -9
  50. package/x/swingset/types/swingset.pb.go +387 -57
  51. package/x/vbank/README.md +6 -1
  52. package/x/vbank/genesis.go +0 -2
  53. package/x/vbank/keeper/keeper.go +4 -9
  54. package/x/vbank/keeper/migrations.go +30 -0
  55. package/x/vbank/module.go +8 -7
  56. package/x/vbank/types/key.go +3 -3
  57. package/x/vbank/types/msgs.go +0 -12
  58. package/x/vbank/types/params.go +43 -2
  59. package/x/vbank/types/vbank.pb.go +105 -36
  60. package/x/vbank/vbank.go +8 -13
  61. package/x/vbank/vbank_test.go +14 -9
  62. package/x/vibc/alias.go +1 -1
  63. package/x/vibc/module.go +2 -7
  64. package/x/vibc/types/ibc_module.go +9 -3
  65. package/x/vibc/types/receiver.go +17 -7
  66. package/x/vlocalchain/handler.go +2 -1
  67. package/x/vlocalchain/keeper/keeper.go +24 -8
  68. package/x/vlocalchain/keeper/keeper_test.go +65 -1
  69. package/x/vlocalchain/types/expected_keepers.go +12 -0
  70. package/x/vlocalchain/vlocalchain.go +27 -22
  71. package/x/vlocalchain/vlocalchain_test.go +163 -8
  72. package/x/vstorage/keeper/grpc_query.go +0 -1
  73. package/x/vstorage/keeper/keeper.go +9 -17
  74. package/x/vstorage/module.go +0 -5
  75. package/x/vstorage/testing/queue.go +28 -0
  76. package/x/vtransfer/alias.go +13 -0
  77. package/x/vtransfer/genesis.go +39 -0
  78. package/x/vtransfer/genesis_test.go +12 -0
  79. package/x/vtransfer/handler.go +20 -0
  80. package/x/vtransfer/ibc_middleware.go +186 -0
  81. package/x/vtransfer/ibc_middleware_test.go +449 -0
  82. package/x/vtransfer/keeper/keeper.go +282 -0
  83. package/x/vtransfer/module.go +124 -0
  84. package/x/vtransfer/types/baseaddr.go +156 -0
  85. package/x/vtransfer/types/baseaddr_test.go +167 -0
  86. package/x/vtransfer/types/expected_keepers.go +38 -0
  87. package/x/vtransfer/types/genesis.pb.go +328 -0
  88. package/x/vtransfer/types/key.go +9 -0
  89. package/x/vtransfer/types/msgs.go +9 -0
  90. package/ante/fee.go +0 -97
package/MAINTAINERS.md ADDED
@@ -0,0 +1,3 @@
1
+ When updating the protos here, be mindful that `@agoric/cosmic-proto` will need refreshing to get them.
2
+
3
+ https://github.com/Agoric/agoric-sdk/issues/8131 will help automate updating protos, but not the publishing to NPM of the codegen-ed JS utilities for working with the APIs they define.
package/Makefile CHANGED
@@ -61,10 +61,10 @@ node-compile-gyp:
61
61
  npm run build:gyp; \
62
62
  fi
63
63
 
64
- compile-agd: go-mod-cache
64
+ compile-agd: go.sum
65
65
  go build -v $(MOD_READONLY) $(BUILD_FLAGS) -buildmode=exe -o build/agd ./cmd/agd
66
66
 
67
- install-agd: go-mod-cache
67
+ install-agd: go.sum
68
68
  go install -v $(MOD_READONLY) $(BUILD_FLAGS) -buildmode=exe ./cmd/agd
69
69
 
70
70
  # Only run from the package.json build:gyp script.
@@ -73,17 +73,18 @@ compile-gyp:
73
73
  node-gyp configure build $(GYP_DEBUG) || { status=$$?; rm -f binding.gyp; exit $$status; }
74
74
  rm -f binding.gyp
75
75
 
76
- compile-libdaemon: go-mod-cache
76
+ compile-libdaemon: go.sum
77
77
  go build -v $(MOD_READONLY) $(SHARED_BUILD_FLAGS) -buildmode=c-shared \
78
78
  -o build/libagcosmosdaemon.so ./cmd/libdaemon/main.go
79
79
 
80
- go-mod-cache: go.sum
81
- @echo "--> Download go modules to local cache"
82
- @go mod download
83
-
84
80
  go.sum: go.mod
85
- @echo "--> Ensure dependencies have not been modified"
81
+ @echo "--> Ensure dependencies have not been modified unless suppressed by SKIP_MOD_VERIFY ..."
82
+ ifndef SKIP_MOD_VERIFY
86
83
  GO111MODULE=on go mod verify
84
+ endif
85
+ GO111MODULE=on go mod tidy
86
+ @echo "--> Download go modules to local cache"
87
+ go mod download
87
88
 
88
89
  ###############################################################################
89
90
  ### Protobuf ###
@@ -98,11 +99,11 @@ proto-lint: proto-tools
98
99
  proto-check-breaking: proto-tools
99
100
  ${BIN}/buf breaking --against $(PR_TARGET_REPO)#branch=$(PR_TARGET_BRANCH),subdir=golang/cosmos
100
101
 
101
- GOGO_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/gogo/protobuf)
102
- # GOOGLE_API_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/googleapis/googleapis)/google/api
103
- IBC_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/ibc-go/v6)/proto/ibc/core
104
- COSMOS_PROTO_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/cosmos-proto)/proto/cosmos_proto
105
- COSMOS_SDK_PROTO_URL := file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/cosmos-sdk)/proto/cosmos
102
+ GOGO_PROTO_URL = file://$(shell go list -m -f '{{ .Dir }}' github.com/gogo/protobuf)
103
+ # GOOGLE_API_URL = file://$(shell go list -m -f '{{ .Dir }}' github.com/googleapis/googleapis)/google/api
104
+ IBC_PROTO_URL = file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/ibc-go/v6)/proto/ibc/core
105
+ COSMOS_PROTO_PROTO_URL = file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/cosmos-proto)/proto/cosmos_proto
106
+ COSMOS_SDK_PROTO_URL = file://$(shell go list -m -f '{{ .Dir }}' github.com/cosmos/cosmos-sdk)/proto/cosmos
106
107
 
107
108
  COSMOS_PROTO_TYPES = third_party/proto/cosmos_proto
108
109
  GOGO_PROTO_TYPES = third_party/proto/gogoproto
@@ -116,34 +117,37 @@ SDK_UPGRADE_TYPES = third_party/proto/cosmos/upgrade/v1beta1
116
117
 
117
118
  proto-update-deps:
118
119
  mkdir -p $(COSMOS_PROTO_TYPES)
119
- curl -sSL $(COSMOS_PROTO_PROTO_URL)/cosmos.proto > $(COSMOS_PROTO_TYPES)/cosmos.proto
120
+ url="$(COSMOS_PROTO_PROTO_URL)"; \
121
+ curl -sSL $$url/cosmos.proto > $(COSMOS_PROTO_TYPES)/cosmos.proto
120
122
 
121
123
  mkdir -p $(GOGO_PROTO_TYPES)
122
- curl -sSL $(GOGO_PROTO_URL)/gogoproto/gogo.proto > $(GOGO_PROTO_TYPES)/gogo.proto
124
+ url="$(GOGO_PROTO_URL)"; \
125
+ curl -sSL $$url/gogoproto/gogo.proto > $(GOGO_PROTO_TYPES)/gogo.proto
123
126
 
124
127
  # Downloading from a not-a-go-module is problematic. These files are artifacts for now.
125
128
  # mkdir -p $(GOOGLE_API_TYPES)
126
- # curl -sSL $(GOOGLE_API_URL)/annotations.proto > $(GOOGLE_API_TYPES)/annotations.proto
127
- # curl -sSL $(GOOGLE_API_URL)/http.proto > $(GOOGLE_API_TYPES)/http.proto
128
- # curl -sSL $(GOOGLE_API_URL)/httpbody.proto > $(GOOGLE_API_TYPES)/httpbody.proto
129
+ # url="$(GOOGLE_API_URL)"; \
130
+ # curl -sSL $$url/annotations.proto > $(GOOGLE_API_TYPES)/annotations.proto && \
131
+ # curl -sSL $$url/http.proto > $(GOOGLE_API_TYPES)/http.proto && \
132
+ # curl -sSL $$url/httpbody.proto > $(GOOGLE_API_TYPES)/httpbody.proto &&
129
133
 
130
134
  mkdir -p $(GOOGLE_PROTO_TYPES)
131
- curl -sSL $(GOGO_PROTO_URL)/protobuf/google/protobuf/any.proto > $(GOOGLE_PROTO_TYPES)/any.proto
132
-
133
- mkdir -p $(IBC_CHANNEL_TYPES)
134
- curl -sSL $(IBC_PROTO_URL)/channel/v1/channel.proto > $(IBC_CHANNEL_TYPES)/channel.proto
135
-
136
- mkdir -p $(IBC_CLIENT_TYPES)
137
- curl -sSL $(IBC_PROTO_URL)/client/v1/client.proto > $(IBC_CLIENT_TYPES)/client.proto
138
-
139
- mkdir -p $(SDK_BASE_TYPES)
140
- curl -sSL $(COSMOS_SDK_PROTO_URL)/base/v1beta1/coin.proto > $(SDK_BASE_TYPES)/coin.proto
141
-
142
- mkdir -p $(SDK_QUERY_TYPES)
143
- curl -sSL $(COSMOS_SDK_PROTO_URL)/base/query/v1beta1/pagination.proto > $(SDK_QUERY_TYPES)/pagination.proto
144
-
145
- mkdir -p $(SDK_UPGRADE_TYPES)
146
- curl -sSL $(COSMOS_SDK_PROTO_URL)/upgrade/v1beta1/upgrade.proto > $(SDK_UPGRADE_TYPES)/upgrade.proto
135
+ url="$(GOGO_PROTO_URL)"; \
136
+ curl -sSL $$url/protobuf/google/protobuf/any.proto > $(GOOGLE_PROTO_TYPES)/any.proto
137
+
138
+ url="$(IBC_PROTO_URL)"; \
139
+ mkdir -p $(IBC_CHANNEL_TYPES) && \
140
+ curl -sSL $$url/channel/v1/channel.proto > $(IBC_CHANNEL_TYPES)/channel.proto && \
141
+ mkdir -p $(IBC_CLIENT_TYPES) && \
142
+ curl -sSL $$url/client/v1/client.proto > $(IBC_CLIENT_TYPES)/client.proto
143
+
144
+ url="$(COSMOS_SDK_PROTO_URL)"; \
145
+ mkdir -p $(SDK_BASE_TYPES) && \
146
+ curl -sSL $$url/base/v1beta1/coin.proto > $(SDK_BASE_TYPES)/coin.proto && \
147
+ mkdir -p $(SDK_QUERY_TYPES) && \
148
+ curl -sSL $$url/base/query/v1beta1/pagination.proto > $(SDK_QUERY_TYPES)/pagination.proto && \
149
+ mkdir -p $(SDK_UPGRADE_TYPES) && \
150
+ curl -sSL $$url/upgrade/v1beta1/upgrade.proto > $(SDK_UPGRADE_TYPES)/upgrade.proto
147
151
 
148
152
  UNAME_S ?= $(shell uname -s)
149
153
  UNAME_M ?= $(shell uname -m)
package/ante/ante.go CHANGED
@@ -45,15 +45,12 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) {
45
45
  anteDecorators := []sdk.AnteDecorator{
46
46
  ante.NewSetUpContextDecorator(),
47
47
  ante.NewExtensionOptionsDecorator(nil), // reject all extensions
48
- // former ante.NewMempoolFeeDecorator()
49
- // replaced as in https://github.com/provenance-io/provenance/pull/1016
50
- ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, nil),
51
48
  ante.NewValidateBasicDecorator(),
52
49
  ante.NewTxTimeoutHeightDecorator(),
53
50
  ante.NewValidateMemoDecorator(opts.AccountKeeper),
54
51
  ante.NewConsumeGasForTxSizeDecorator(opts.AccountKeeper),
55
52
  NewInboundDecorator(opts.SwingsetKeeper),
56
- NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, opts.FeeCollectorName),
53
+ ante.NewDeductFeeDecoratorWithName(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, nil, opts.FeeCollectorName),
57
54
  // SetPubKeyDecorator must be called before all signature verification decorators
58
55
  ante.NewSetPubKeyDecorator(opts.AccountKeeper),
59
56
  ante.NewValidateSigCountDecorator(opts.AccountKeeper),
@@ -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
  }