@agoric/cosmos 0.34.2-dev-bd0b2a9.0 → 0.34.2-dev-2837beb.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/git-revision.txt +1 -1
- package/package.json +2 -2
- package/proto/agoric/swingset/swingset.proto +25 -0
- package/x/swingset/keeper/keeper.go +16 -7
- package/x/swingset/types/default-params.go +31 -5
- package/x/swingset/types/expected_keepers.go +2 -2
- package/x/swingset/types/msgs.go +30 -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/vstorage/testing/queue.go +4 -3
- package/x/vtransfer/types/genesis.pb.go +1 -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/git-revision.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
2837beb
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/cosmos",
|
|
3
|
-
"version": "0.34.2-dev-
|
|
3
|
+
"version": "0.34.2-dev-2837beb.0+2837beb",
|
|
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": "2837beb6d7350aa6976923f1dbbb35edfa8906d6"
|
|
43
43
|
}
|
|
@@ -82,6 +82,18 @@ message Params {
|
|
|
82
82
|
repeated QueueSize queue_max = 5 [
|
|
83
83
|
(gogoproto.nullable) = false
|
|
84
84
|
];
|
|
85
|
+
|
|
86
|
+
// Vat cleanup budget values.
|
|
87
|
+
// These values are used by SwingSet to control the pace of removing data
|
|
88
|
+
// associated with a terminated vat as described at
|
|
89
|
+
// https://github.com/Agoric/agoric-sdk/blob/master/packages/SwingSet/docs/run-policy.md#terminated-vat-cleanup
|
|
90
|
+
//
|
|
91
|
+
// There is no required order to this list of entries, but all the chain
|
|
92
|
+
// nodes must all serialize and deserialize the existing order without
|
|
93
|
+
// permuting it.
|
|
94
|
+
repeated UintMapEntry vat_cleanup_budget = 6 [
|
|
95
|
+
(gogoproto.nullable) = false
|
|
96
|
+
];
|
|
85
97
|
}
|
|
86
98
|
|
|
87
99
|
// The current state of the module.
|
|
@@ -119,6 +131,7 @@ message PowerFlagFee {
|
|
|
119
131
|
}
|
|
120
132
|
|
|
121
133
|
// Map element of a string key to a size.
|
|
134
|
+
// TODO: Replace with UintMapEntry?
|
|
122
135
|
message QueueSize {
|
|
123
136
|
option (gogoproto.equal) = true;
|
|
124
137
|
|
|
@@ -129,6 +142,18 @@ message QueueSize {
|
|
|
129
142
|
int32 size = 2;
|
|
130
143
|
}
|
|
131
144
|
|
|
145
|
+
// Map element of a string key to an unsigned integer.
|
|
146
|
+
// The value uses cosmos-sdk Uint rather than a native Go type to ensure that
|
|
147
|
+
// zeroes survive "omitempty" JSON serialization.
|
|
148
|
+
message UintMapEntry {
|
|
149
|
+
option (gogoproto.equal) = true;
|
|
150
|
+
string key = 1;
|
|
151
|
+
string value = 2 [
|
|
152
|
+
(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Uint",
|
|
153
|
+
(gogoproto.nullable) = false
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
|
|
132
157
|
// Egress is the format for a swingset egress.
|
|
133
158
|
message Egress {
|
|
134
159
|
option (gogoproto.equal) = false;
|
|
@@ -246,7 +246,10 @@ func (k Keeper) BlockingSend(ctx sdk.Context, action vm.Action) (string, error)
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) {
|
|
249
|
-
|
|
249
|
+
// Note the use of "IfExists"...
|
|
250
|
+
// migration fills in missing data with defaults,
|
|
251
|
+
// so it is the only consumer that should ever see a nil pair.
|
|
252
|
+
k.paramSpace.GetParamSetIfExists(ctx, ¶ms)
|
|
250
253
|
return params
|
|
251
254
|
}
|
|
252
255
|
|
|
@@ -304,9 +307,12 @@ func (k Keeper) SetBeansOwing(ctx sdk.Context, addr sdk.AccAddress, beans sdkmat
|
|
|
304
307
|
// ChargeBeans charges the given address the given number of beans. It divides
|
|
305
308
|
// the beans into the number to debit immediately vs. the number to store in the
|
|
306
309
|
// beansOwing.
|
|
307
|
-
func (k Keeper) ChargeBeans(
|
|
308
|
-
|
|
309
|
-
|
|
310
|
+
func (k Keeper) ChargeBeans(
|
|
311
|
+
ctx sdk.Context,
|
|
312
|
+
beansPerUnit map[string]sdkmath.Uint,
|
|
313
|
+
addr sdk.AccAddress,
|
|
314
|
+
beans sdkmath.Uint,
|
|
315
|
+
) error {
|
|
310
316
|
wasOwing := k.GetBeansOwing(ctx, addr)
|
|
311
317
|
nowOwing := wasOwing.Add(beans)
|
|
312
318
|
|
|
@@ -339,10 +345,13 @@ func (k Keeper) ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdkmath.
|
|
|
339
345
|
}
|
|
340
346
|
|
|
341
347
|
// ChargeForSmartWallet charges the fee for provisioning a smart wallet.
|
|
342
|
-
func (k Keeper) ChargeForSmartWallet(
|
|
343
|
-
|
|
348
|
+
func (k Keeper) ChargeForSmartWallet(
|
|
349
|
+
ctx sdk.Context,
|
|
350
|
+
beansPerUnit map[string]sdkmath.Uint,
|
|
351
|
+
addr sdk.AccAddress,
|
|
352
|
+
) error {
|
|
344
353
|
beans := beansPerUnit[types.BeansPerSmartWalletProvision]
|
|
345
|
-
err := k.ChargeBeans(ctx, addr, beans)
|
|
354
|
+
err := k.ChargeBeans(ctx, beansPerUnit, addr, beans)
|
|
346
355
|
if err != nil {
|
|
347
356
|
return err
|
|
348
357
|
}
|
|
@@ -22,13 +22,23 @@ const (
|
|
|
22
22
|
BeansPerXsnapComputron = "xsnapComputron"
|
|
23
23
|
BeansPerSmartWalletProvision = "smartWalletProvision"
|
|
24
24
|
|
|
25
|
+
// PowerFlags.
|
|
26
|
+
PowerFlagSmartWallet = "SMART_WALLET"
|
|
27
|
+
|
|
25
28
|
// QueueSize keys.
|
|
26
|
-
// Keep up-to-date with updateQueueAllowed() in
|
|
29
|
+
// Keep up-to-date with updateQueueAllowed() in packages/cosmic-swingset/src/launch-chain.js
|
|
27
30
|
QueueInbound = "inbound"
|
|
28
31
|
QueueInboundMempool = "inbound_mempool"
|
|
29
32
|
|
|
30
|
-
//
|
|
31
|
-
|
|
33
|
+
// Vat cleanup budget keys.
|
|
34
|
+
// Keep up-to-date with CleanupBudget in packages/cosmic-swingset/src/launch-chain.js
|
|
35
|
+
VatCleanupDefault = "default"
|
|
36
|
+
VatCleanupExports = "exports"
|
|
37
|
+
VatCleanupImports = "imports"
|
|
38
|
+
VatCleanupPromises = "promises"
|
|
39
|
+
VatCleanupKv = "kv"
|
|
40
|
+
VatCleanupSnapshots = "snapshots"
|
|
41
|
+
VatCleanupTranscripts = "transcripts"
|
|
32
42
|
)
|
|
33
43
|
|
|
34
44
|
var (
|
|
@@ -62,10 +72,26 @@ var (
|
|
|
62
72
|
}
|
|
63
73
|
|
|
64
74
|
DefaultInboundQueueMax = int32(1_000)
|
|
65
|
-
|
|
66
|
-
DefaultQueueMax = []QueueSize{
|
|
75
|
+
DefaultQueueMax = []QueueSize{
|
|
67
76
|
NewQueueSize(QueueInbound, DefaultInboundQueueMax),
|
|
68
77
|
}
|
|
78
|
+
|
|
79
|
+
DefaultVatCleanupDefault = sdk.NewUint(5)
|
|
80
|
+
// DefaultVatCleanupExports = DefaultVatCleanupDefault
|
|
81
|
+
// DefaultVatCleanupImports = DefaultVatCleanupDefault
|
|
82
|
+
// DefaultVatCleanupPromises = DefaultVatCleanupDefault
|
|
83
|
+
DefaultVatCleanupKv = sdk.NewUint(50)
|
|
84
|
+
// DefaultVatCleanupSnapshots = DefaultVatCleanupDefault
|
|
85
|
+
// DefaultVatCleanupTranscripts = DefaultVatCleanupDefault
|
|
86
|
+
DefaultVatCleanupBudget = []UintMapEntry{
|
|
87
|
+
UintMapEntry{VatCleanupDefault, DefaultVatCleanupDefault},
|
|
88
|
+
// UintMapEntry{VatCleanupExports, DefaultVatCleanupExports},
|
|
89
|
+
// UintMapEntry{VatCleanupImports, DefaultVatCleanupImports},
|
|
90
|
+
// UintMapEntry{VatCleanupPromises, DefaultVatCleanupPromises},
|
|
91
|
+
UintMapEntry{VatCleanupKv, DefaultVatCleanupKv},
|
|
92
|
+
// UintMapEntry{VatCleanupSnapshots, DefaultVatCleanupSnapshots},
|
|
93
|
+
// UintMapEntry{VatCleanupTranscripts, DefaultVatCleanupTranscripts},
|
|
94
|
+
}
|
|
69
95
|
)
|
|
70
96
|
|
|
71
97
|
// move DefaultBeansPerUnit to a function to allow for boot overriding of the Default params
|
|
@@ -23,8 +23,8 @@ type AccountKeeper interface {
|
|
|
23
23
|
|
|
24
24
|
type SwingSetKeeper interface {
|
|
25
25
|
GetBeansPerUnit(ctx sdk.Context) map[string]sdkmath.Uint
|
|
26
|
-
ChargeBeans(ctx sdk.Context, addr sdk.AccAddress, beans sdkmath.Uint) error
|
|
26
|
+
ChargeBeans(ctx sdk.Context, beansPerUnit map[string]sdkmath.Uint, addr sdk.AccAddress, beans sdkmath.Uint) error
|
|
27
27
|
IsHighPriorityAddress(ctx sdk.Context, addr sdk.AccAddress) (bool, error)
|
|
28
28
|
GetSmartWalletState(ctx sdk.Context, addr sdk.AccAddress) SmartWalletState
|
|
29
|
-
ChargeForSmartWallet(ctx sdk.Context, addr sdk.AccAddress) error
|
|
29
|
+
ChargeForSmartWallet(ctx sdk.Context, beansPerUnit map[string]sdkmath.Uint, addr sdk.AccAddress) error
|
|
30
30
|
}
|
package/x/swingset/types/msgs.go
CHANGED
|
@@ -8,9 +8,12 @@ import (
|
|
|
8
8
|
"strings"
|
|
9
9
|
|
|
10
10
|
sdkioerrors "cosmossdk.io/errors"
|
|
11
|
-
"
|
|
11
|
+
sdkmath "cosmossdk.io/math"
|
|
12
|
+
|
|
12
13
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
13
14
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
|
15
|
+
|
|
16
|
+
"github.com/Agoric/agoric-sdk/golang/cosmos/vm"
|
|
14
17
|
)
|
|
15
18
|
|
|
16
19
|
const RouterKey = ModuleName // this was defined in your key.go file
|
|
@@ -56,8 +59,14 @@ const (
|
|
|
56
59
|
|
|
57
60
|
// Charge an account address for the beans associated with given messages and storage.
|
|
58
61
|
// See list of bean charges in default-params.go
|
|
59
|
-
func chargeAdmission(
|
|
60
|
-
|
|
62
|
+
func chargeAdmission(
|
|
63
|
+
ctx sdk.Context,
|
|
64
|
+
keeper SwingSetKeeper,
|
|
65
|
+
beansPerUnit map[string]sdkmath.Uint,
|
|
66
|
+
addr sdk.AccAddress,
|
|
67
|
+
msgs []string,
|
|
68
|
+
storageLen uint64,
|
|
69
|
+
) error {
|
|
61
70
|
beans := beansPerUnit[BeansPerInboundTx]
|
|
62
71
|
beans = beans.Add(beansPerUnit[BeansPerMessage].MulUint64((uint64(len(msgs)))))
|
|
63
72
|
for _, msg := range msgs {
|
|
@@ -65,7 +74,7 @@ func chargeAdmission(ctx sdk.Context, keeper SwingSetKeeper, addr sdk.AccAddress
|
|
|
65
74
|
}
|
|
66
75
|
beans = beans.Add(beansPerUnit[BeansPerStorageByte].MulUint64(storageLen))
|
|
67
76
|
|
|
68
|
-
return keeper.ChargeBeans(ctx, addr, beans)
|
|
77
|
+
return keeper.ChargeBeans(ctx, beansPerUnit, addr, beans)
|
|
69
78
|
}
|
|
70
79
|
|
|
71
80
|
// checkSmartWalletProvisioned verifies if a smart wallet message (MsgWalletAction
|
|
@@ -74,7 +83,12 @@ func chargeAdmission(ctx sdk.Context, keeper SwingSetKeeper, addr sdk.AccAddress
|
|
|
74
83
|
// provisioning fee is charged successfully.
|
|
75
84
|
// All messages for non-provisioned smart wallets allowed here will result in
|
|
76
85
|
// an auto-provision action generated by the msg server.
|
|
77
|
-
func checkSmartWalletProvisioned(
|
|
86
|
+
func checkSmartWalletProvisioned(
|
|
87
|
+
ctx sdk.Context,
|
|
88
|
+
keeper SwingSetKeeper,
|
|
89
|
+
beansPerUnit map[string]sdkmath.Uint,
|
|
90
|
+
addr sdk.AccAddress,
|
|
91
|
+
) error {
|
|
78
92
|
walletState := keeper.GetSmartWalletState(ctx, addr)
|
|
79
93
|
|
|
80
94
|
switch walletState {
|
|
@@ -91,7 +105,7 @@ func checkSmartWalletProvisioned(ctx sdk.Context, keeper SwingSetKeeper, addr sd
|
|
|
91
105
|
// This is a separate charge from the smart wallet action which triggered the check
|
|
92
106
|
// TODO: Currently this call does not mark the smart wallet provisioning as
|
|
93
107
|
// pending, resulting in multiple provisioning charges for the owner.
|
|
94
|
-
return keeper.ChargeForSmartWallet(ctx, addr)
|
|
108
|
+
return keeper.ChargeForSmartWallet(ctx, beansPerUnit, addr)
|
|
95
109
|
}
|
|
96
110
|
}
|
|
97
111
|
|
|
@@ -118,7 +132,8 @@ func (msg MsgDeliverInbound) CheckAdmissibility(ctx sdk.Context, data interface{
|
|
|
118
132
|
}
|
|
119
133
|
*/
|
|
120
134
|
|
|
121
|
-
|
|
135
|
+
beansPerUnit := keeper.GetBeansPerUnit(ctx)
|
|
136
|
+
return chargeAdmission(ctx, keeper, beansPerUnit, msg.Submitter, msg.Messages, 0)
|
|
122
137
|
}
|
|
123
138
|
|
|
124
139
|
// GetInboundMsgCount implements InboundMsgCarrier.
|
|
@@ -184,12 +199,13 @@ func (msg MsgWalletAction) CheckAdmissibility(ctx sdk.Context, data interface{})
|
|
|
184
199
|
return sdkioerrors.Wrapf(sdkerrors.ErrInvalidRequest, "data must be a SwingSetKeeper, not a %T", data)
|
|
185
200
|
}
|
|
186
201
|
|
|
187
|
-
|
|
202
|
+
beansPerUnit := keeper.GetBeansPerUnit(ctx)
|
|
203
|
+
err := checkSmartWalletProvisioned(ctx, keeper, beansPerUnit, msg.Owner)
|
|
188
204
|
if err != nil {
|
|
189
205
|
return err
|
|
190
206
|
}
|
|
191
207
|
|
|
192
|
-
return chargeAdmission(ctx, keeper, msg.Owner, []string{msg.Action}, 0)
|
|
208
|
+
return chargeAdmission(ctx, keeper, beansPerUnit, msg.Owner, []string{msg.Action}, 0)
|
|
193
209
|
}
|
|
194
210
|
|
|
195
211
|
// GetInboundMsgCount implements InboundMsgCarrier.
|
|
@@ -256,12 +272,13 @@ func (msg MsgWalletSpendAction) CheckAdmissibility(ctx sdk.Context, data interfa
|
|
|
256
272
|
return sdkioerrors.Wrapf(sdkerrors.ErrInvalidRequest, "data must be a SwingSetKeeper, not a %T", data)
|
|
257
273
|
}
|
|
258
274
|
|
|
259
|
-
|
|
275
|
+
beansPerUnit := keeper.GetBeansPerUnit(ctx)
|
|
276
|
+
err := checkSmartWalletProvisioned(ctx, keeper, beansPerUnit, msg.Owner)
|
|
260
277
|
if err != nil {
|
|
261
278
|
return err
|
|
262
279
|
}
|
|
263
280
|
|
|
264
|
-
return chargeAdmission(ctx, keeper, msg.Owner, []string{msg.SpendAction}, 0)
|
|
281
|
+
return chargeAdmission(ctx, keeper, beansPerUnit, msg.Owner, []string{msg.SpendAction}, 0)
|
|
265
282
|
}
|
|
266
283
|
|
|
267
284
|
// GetInboundMsgCount implements InboundMsgCarrier.
|
|
@@ -373,7 +390,8 @@ func (msg MsgInstallBundle) CheckAdmissibility(ctx sdk.Context, data interface{}
|
|
|
373
390
|
if !ok {
|
|
374
391
|
return sdkioerrors.Wrapf(sdkerrors.ErrInvalidRequest, "data must be a SwingSetKeeper, not a %T", data)
|
|
375
392
|
}
|
|
376
|
-
|
|
393
|
+
beansPerUnit := keeper.GetBeansPerUnit(ctx)
|
|
394
|
+
return chargeAdmission(ctx, keeper, beansPerUnit, msg.Submitter, []string{msg.Bundle}, msg.ExpectedUncompressedSize())
|
|
377
395
|
}
|
|
378
396
|
|
|
379
397
|
// GetInboundMsgCount implements InboundMsgCarrier.
|
|
@@ -17,6 +17,7 @@ var (
|
|
|
17
17
|
ParamStoreKeyFeeUnitPrice = []byte("fee_unit_price")
|
|
18
18
|
ParamStoreKeyPowerFlagFees = []byte("power_flag_fees")
|
|
19
19
|
ParamStoreKeyQueueMax = []byte("queue_max")
|
|
20
|
+
ParamStoreKeyVatCleanupBudget = []byte("vat_cleanup_budget")
|
|
20
21
|
)
|
|
21
22
|
|
|
22
23
|
func NewStringBeans(key string, beans sdkmath.Uint) StringBeans {
|
|
@@ -53,6 +54,7 @@ func DefaultParams() Params {
|
|
|
53
54
|
FeeUnitPrice: DefaultFeeUnitPrice,
|
|
54
55
|
PowerFlagFees: DefaultPowerFlagFees,
|
|
55
56
|
QueueMax: DefaultQueueMax,
|
|
57
|
+
VatCleanupBudget: DefaultVatCleanupBudget,
|
|
56
58
|
}
|
|
57
59
|
}
|
|
58
60
|
|
|
@@ -69,6 +71,7 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs {
|
|
|
69
71
|
paramtypes.NewParamSetPair(ParamStoreKeyBootstrapVatConfig, &p.BootstrapVatConfig, validateBootstrapVatConfig),
|
|
70
72
|
paramtypes.NewParamSetPair(ParamStoreKeyPowerFlagFees, &p.PowerFlagFees, validatePowerFlagFees),
|
|
71
73
|
paramtypes.NewParamSetPair(ParamStoreKeyQueueMax, &p.QueueMax, validateQueueMax),
|
|
74
|
+
paramtypes.NewParamSetPair(ParamStoreKeyVatCleanupBudget, &p.VatCleanupBudget, validateVatCleanupBudget),
|
|
72
75
|
}
|
|
73
76
|
}
|
|
74
77
|
|
|
@@ -89,6 +92,9 @@ func (p Params) ValidateBasic() error {
|
|
|
89
92
|
if err := validateQueueMax(p.QueueMax); err != nil {
|
|
90
93
|
return err
|
|
91
94
|
}
|
|
95
|
+
if err := validateVatCleanupBudget(p.VatCleanupBudget); err != nil {
|
|
96
|
+
return err
|
|
97
|
+
}
|
|
92
98
|
|
|
93
99
|
return nil
|
|
94
100
|
}
|
|
@@ -165,20 +171,42 @@ func validateQueueMax(i interface{}) error {
|
|
|
165
171
|
return nil
|
|
166
172
|
}
|
|
167
173
|
|
|
174
|
+
func validateVatCleanupBudget(i interface{}) error {
|
|
175
|
+
entries, ok := i.([]UintMapEntry)
|
|
176
|
+
if !ok {
|
|
177
|
+
return fmt.Errorf("invalid parameter type: %T", i)
|
|
178
|
+
}
|
|
179
|
+
hasDefault := false
|
|
180
|
+
for _, entry := range entries {
|
|
181
|
+
if entry.Key == VatCleanupDefault {
|
|
182
|
+
hasDefault = true
|
|
183
|
+
break
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if len(entries) > 0 && !hasDefault {
|
|
187
|
+
return fmt.Errorf("`default` must be present in a non-empty vat cleanup budget")
|
|
188
|
+
}
|
|
189
|
+
return nil
|
|
190
|
+
}
|
|
191
|
+
|
|
168
192
|
// UpdateParams appends any missing params, configuring them to their defaults,
|
|
169
193
|
// then returning the updated params or an error. Existing params are not
|
|
170
194
|
// modified, regardless of their value, and they are not removed if they no
|
|
171
195
|
// longer appear in the defaults.
|
|
172
196
|
func UpdateParams(params Params) (Params, error) {
|
|
173
|
-
newBpu, err :=
|
|
197
|
+
newBpu, err := appendMissingDefaults(params.BeansPerUnit, DefaultBeansPerUnit())
|
|
174
198
|
if err != nil {
|
|
175
199
|
return params, err
|
|
176
200
|
}
|
|
177
|
-
newPff, err :=
|
|
201
|
+
newPff, err := appendMissingDefaults(params.PowerFlagFees, DefaultPowerFlagFees)
|
|
178
202
|
if err != nil {
|
|
179
203
|
return params, err
|
|
180
204
|
}
|
|
181
|
-
newQm, err :=
|
|
205
|
+
newQm, err := appendMissingDefaults(params.QueueMax, DefaultQueueMax)
|
|
206
|
+
if err != nil {
|
|
207
|
+
return params, err
|
|
208
|
+
}
|
|
209
|
+
newVcb, err := appendMissingDefaults(params.VatCleanupBudget, DefaultVatCleanupBudget)
|
|
182
210
|
if err != nil {
|
|
183
211
|
return params, err
|
|
184
212
|
}
|
|
@@ -186,55 +214,37 @@ func UpdateParams(params Params) (Params, error) {
|
|
|
186
214
|
params.BeansPerUnit = newBpu
|
|
187
215
|
params.PowerFlagFees = newPff
|
|
188
216
|
params.QueueMax = newQm
|
|
217
|
+
params.VatCleanupBudget = newVcb
|
|
189
218
|
return params, nil
|
|
190
219
|
}
|
|
191
220
|
|
|
192
|
-
//
|
|
193
|
-
//
|
|
194
|
-
|
|
195
|
-
func
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
221
|
+
// appendMissingDefaults appends to an input list any missing entries with their
|
|
222
|
+
// respective default values and returns the result.
|
|
223
|
+
func appendMissingDefaults[Entry StringBeans | PowerFlagFee | QueueSize | UintMapEntry](entries []Entry, defaults []Entry) ([]Entry, error) {
|
|
224
|
+
getKey := func(entry any) string {
|
|
225
|
+
switch e := entry.(type) {
|
|
226
|
+
case StringBeans:
|
|
227
|
+
return e.Key
|
|
228
|
+
case PowerFlagFee:
|
|
229
|
+
return e.PowerFlag
|
|
230
|
+
case QueueSize:
|
|
231
|
+
return e.Key
|
|
232
|
+
case UintMapEntry:
|
|
233
|
+
return e.Key
|
|
204
234
|
}
|
|
235
|
+
panic("unreachable")
|
|
205
236
|
}
|
|
206
|
-
return bpu, nil
|
|
207
|
-
}
|
|
208
237
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
func appendMissingDefaultPowerFlagFees(pff []PowerFlagFee, defaultPff []PowerFlagFee) ([]PowerFlagFee, error) {
|
|
213
|
-
existingPff := make(map[string]struct{}, len(pff))
|
|
214
|
-
for _, of := range pff {
|
|
215
|
-
existingPff[of.PowerFlag] = struct{}{}
|
|
238
|
+
existingKeys := make(map[string]bool, len(entries))
|
|
239
|
+
for _, entry := range entries {
|
|
240
|
+
existingKeys[getKey(entry)] = true
|
|
216
241
|
}
|
|
217
242
|
|
|
218
|
-
for _,
|
|
219
|
-
if
|
|
220
|
-
|
|
243
|
+
for _, defaultEntry := range defaults {
|
|
244
|
+
if exists := existingKeys[getKey(defaultEntry)]; !exists {
|
|
245
|
+
entries = append(entries, defaultEntry)
|
|
221
246
|
}
|
|
222
247
|
}
|
|
223
|
-
return pff, nil
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
// appendMissingDefaultQueueSize appends the default queue size entries not in
|
|
227
|
-
// the list of sizes already, returning the possibly-updated list, or an error.
|
|
228
|
-
func appendMissingDefaultQueueSize(qs []QueueSize, defaultQs []QueueSize) ([]QueueSize, error) {
|
|
229
|
-
existingQs := make(map[string]struct{}, len(qs))
|
|
230
|
-
for _, os := range qs {
|
|
231
|
-
existingQs[os.Key] = struct{}{}
|
|
232
|
-
}
|
|
233
248
|
|
|
234
|
-
|
|
235
|
-
if _, exists := existingQs[s.Key]; !exists {
|
|
236
|
-
qs = append(qs, s)
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return qs, nil
|
|
249
|
+
return entries, nil
|
|
240
250
|
}
|
|
@@ -80,7 +80,7 @@ func TestAddStorageBeanCost(t *testing.T) {
|
|
|
80
80
|
},
|
|
81
81
|
} {
|
|
82
82
|
t.Run(tt.name, func(t *testing.T) {
|
|
83
|
-
got, err :=
|
|
83
|
+
got, err := appendMissingDefaults(tt.in, []StringBeans{defaultStorageCost})
|
|
84
84
|
if err != nil {
|
|
85
85
|
t.Errorf("got error %v", err)
|
|
86
86
|
} else if !reflect.DeepEqual(got, tt.want) {
|
|
@@ -90,27 +90,93 @@ func TestAddStorageBeanCost(t *testing.T) {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
func
|
|
94
|
-
|
|
93
|
+
func TestUpdateParamsFromEmpty(t *testing.T) {
|
|
95
94
|
in := Params{
|
|
96
|
-
BeansPerUnit:
|
|
97
|
-
BootstrapVatConfig: "
|
|
95
|
+
BeansPerUnit: nil,
|
|
96
|
+
BootstrapVatConfig: "",
|
|
98
97
|
FeeUnitPrice: sdk.NewCoins(sdk.NewInt64Coin("denom", 789)),
|
|
99
|
-
PowerFlagFees:
|
|
100
|
-
QueueMax:
|
|
98
|
+
PowerFlagFees: nil,
|
|
99
|
+
QueueMax: nil,
|
|
100
|
+
VatCleanupBudget: nil,
|
|
101
101
|
}
|
|
102
102
|
want := Params{
|
|
103
103
|
BeansPerUnit: DefaultBeansPerUnit(),
|
|
104
|
-
BootstrapVatConfig: "
|
|
104
|
+
BootstrapVatConfig: "",
|
|
105
105
|
FeeUnitPrice: sdk.NewCoins(sdk.NewInt64Coin("denom", 789)),
|
|
106
106
|
PowerFlagFees: DefaultPowerFlagFees,
|
|
107
107
|
QueueMax: DefaultQueueMax,
|
|
108
|
+
VatCleanupBudget: DefaultVatCleanupBudget,
|
|
109
|
+
}
|
|
110
|
+
got, err := UpdateParams(in)
|
|
111
|
+
if err != nil {
|
|
112
|
+
t.Fatalf("UpdateParam error %v", err)
|
|
113
|
+
}
|
|
114
|
+
if !reflect.DeepEqual(got, want) {
|
|
115
|
+
t.Errorf("GOT\n%v\nWANTED\n%v", got, want)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
func TestUpdateParamsFromExisting(t *testing.T) {
|
|
120
|
+
defaultBeansPerUnit := DefaultBeansPerUnit()
|
|
121
|
+
customBeansPerUnit := NewStringBeans("foo", sdk.NewUint(1))
|
|
122
|
+
customPowerFlagFee := NewPowerFlagFee("bar", sdk.NewCoins(sdk.NewInt64Coin("baz", 2)))
|
|
123
|
+
customQueueSize := NewQueueSize("qux", int32(3))
|
|
124
|
+
customVatCleanup := UintMapEntry{"corge", sdk.NewUint(4)}
|
|
125
|
+
in := Params{
|
|
126
|
+
BeansPerUnit: append([]StringBeans{customBeansPerUnit}, defaultBeansPerUnit[2:4]...),
|
|
127
|
+
BootstrapVatConfig: "",
|
|
128
|
+
FeeUnitPrice: sdk.NewCoins(sdk.NewInt64Coin("denom", 789)),
|
|
129
|
+
PowerFlagFees: []PowerFlagFee{customPowerFlagFee},
|
|
130
|
+
QueueMax: []QueueSize{NewQueueSize(QueueInbound, int32(10)), customQueueSize},
|
|
131
|
+
VatCleanupBudget: []UintMapEntry{customVatCleanup, UintMapEntry{VatCleanupDefault, sdk.NewUint(10)}},
|
|
132
|
+
}
|
|
133
|
+
want := Params{
|
|
134
|
+
BeansPerUnit: append(append(in.BeansPerUnit, defaultBeansPerUnit[0:2]...), defaultBeansPerUnit[4:]...),
|
|
135
|
+
BootstrapVatConfig: in.BootstrapVatConfig,
|
|
136
|
+
FeeUnitPrice: in.FeeUnitPrice,
|
|
137
|
+
PowerFlagFees: append(in.PowerFlagFees, DefaultPowerFlagFees...),
|
|
138
|
+
QueueMax: in.QueueMax,
|
|
139
|
+
VatCleanupBudget: append(in.VatCleanupBudget, DefaultVatCleanupBudget[1:]...),
|
|
108
140
|
}
|
|
109
141
|
got, err := UpdateParams(in)
|
|
110
142
|
if err != nil {
|
|
111
143
|
t.Fatalf("UpdateParam error %v", err)
|
|
112
144
|
}
|
|
113
145
|
if !reflect.DeepEqual(got, want) {
|
|
114
|
-
t.Errorf("
|
|
146
|
+
t.Errorf("GOT\n%v\nWANTED\n%v", got, want)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
func TestValidateParams(t *testing.T) {
|
|
151
|
+
params := Params{
|
|
152
|
+
BeansPerUnit: DefaultBeansPerUnit(),
|
|
153
|
+
BootstrapVatConfig: "foo",
|
|
154
|
+
FeeUnitPrice: sdk.NewCoins(sdk.NewInt64Coin("denom", 789)),
|
|
155
|
+
PowerFlagFees: DefaultPowerFlagFees,
|
|
156
|
+
QueueMax: DefaultQueueMax,
|
|
157
|
+
VatCleanupBudget: DefaultVatCleanupBudget,
|
|
158
|
+
}
|
|
159
|
+
err := params.ValidateBasic()
|
|
160
|
+
if err != nil {
|
|
161
|
+
t.Errorf("unexpected ValidateBasic() error with default params: %v", err)
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
customVatCleanup := UintMapEntry{"corge", sdk.NewUint(4)}
|
|
165
|
+
params.VatCleanupBudget = append(params.VatCleanupBudget, customVatCleanup)
|
|
166
|
+
err = params.ValidateBasic()
|
|
167
|
+
if err != nil {
|
|
168
|
+
t.Errorf("unexpected ValidateBasic() error with extended params: %v", err)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
params.VatCleanupBudget = params.VatCleanupBudget[1:]
|
|
172
|
+
err = params.ValidateBasic()
|
|
173
|
+
if err == nil {
|
|
174
|
+
t.Errorf("ValidateBasic() failed to reject VatCleanupBudget with missing `default` %v", params.VatCleanupBudget)
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
params.VatCleanupBudget = []UintMapEntry{}
|
|
178
|
+
err = params.ValidateBasic()
|
|
179
|
+
if err != nil {
|
|
180
|
+
t.Errorf("unexpected ValidateBasic() error with empty VatCleanupBudget: %v", params.VatCleanupBudget)
|
|
115
181
|
}
|
|
116
182
|
}
|
|
@@ -161,6 +161,15 @@ type Params struct {
|
|
|
161
161
|
// nodes must all serialize and deserialize the existing order without
|
|
162
162
|
// permuting it.
|
|
163
163
|
QueueMax []QueueSize `protobuf:"bytes,5,rep,name=queue_max,json=queueMax,proto3" json:"queue_max"`
|
|
164
|
+
// Vat cleanup budget values.
|
|
165
|
+
// These values are used by SwingSet to control the pace of removing data
|
|
166
|
+
// associated with a terminated vat as described at
|
|
167
|
+
// https://github.com/Agoric/agoric-sdk/blob/master/packages/SwingSet/docs/run-policy.md#terminated-vat-cleanup
|
|
168
|
+
//
|
|
169
|
+
// There is no required order to this list of entries, but all the chain
|
|
170
|
+
// nodes must all serialize and deserialize the existing order without
|
|
171
|
+
// permuting it.
|
|
172
|
+
VatCleanupBudget []UintMapEntry `protobuf:"bytes,6,rep,name=vat_cleanup_budget,json=vatCleanupBudget,proto3" json:"vat_cleanup_budget"`
|
|
164
173
|
}
|
|
165
174
|
|
|
166
175
|
func (m *Params) Reset() { *m = Params{} }
|
|
@@ -230,6 +239,13 @@ func (m *Params) GetQueueMax() []QueueSize {
|
|
|
230
239
|
return nil
|
|
231
240
|
}
|
|
232
241
|
|
|
242
|
+
func (m *Params) GetVatCleanupBudget() []UintMapEntry {
|
|
243
|
+
if m != nil {
|
|
244
|
+
return m.VatCleanupBudget
|
|
245
|
+
}
|
|
246
|
+
return nil
|
|
247
|
+
}
|
|
248
|
+
|
|
233
249
|
// The current state of the module.
|
|
234
250
|
type State struct {
|
|
235
251
|
// The allowed number of items to add to queues, as determined by SwingSet.
|
|
@@ -379,6 +395,7 @@ func (m *PowerFlagFee) GetFee() github_com_cosmos_cosmos_sdk_types.Coins {
|
|
|
379
395
|
}
|
|
380
396
|
|
|
381
397
|
// Map element of a string key to a size.
|
|
398
|
+
// TODO: Replace with UintMapEntry?
|
|
382
399
|
type QueueSize struct {
|
|
383
400
|
// What the size is for.
|
|
384
401
|
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
|
@@ -433,6 +450,54 @@ func (m *QueueSize) GetSize_() int32 {
|
|
|
433
450
|
return 0
|
|
434
451
|
}
|
|
435
452
|
|
|
453
|
+
// Map element of a string key to an unsigned integer.
|
|
454
|
+
// The value uses cosmos-sdk Uint rather than a native Go type to ensure that
|
|
455
|
+
// zeroes survive "omitempty" JSON serialization.
|
|
456
|
+
type UintMapEntry struct {
|
|
457
|
+
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
|
|
458
|
+
Value github_com_cosmos_cosmos_sdk_types.Uint `protobuf:"bytes,2,opt,name=value,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Uint" json:"value"`
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
func (m *UintMapEntry) Reset() { *m = UintMapEntry{} }
|
|
462
|
+
func (m *UintMapEntry) String() string { return proto.CompactTextString(m) }
|
|
463
|
+
func (*UintMapEntry) ProtoMessage() {}
|
|
464
|
+
func (*UintMapEntry) Descriptor() ([]byte, []int) {
|
|
465
|
+
return fileDescriptor_ff9c341e0de15f8b, []int{7}
|
|
466
|
+
}
|
|
467
|
+
func (m *UintMapEntry) XXX_Unmarshal(b []byte) error {
|
|
468
|
+
return m.Unmarshal(b)
|
|
469
|
+
}
|
|
470
|
+
func (m *UintMapEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
471
|
+
if deterministic {
|
|
472
|
+
return xxx_messageInfo_UintMapEntry.Marshal(b, m, deterministic)
|
|
473
|
+
} else {
|
|
474
|
+
b = b[:cap(b)]
|
|
475
|
+
n, err := m.MarshalToSizedBuffer(b)
|
|
476
|
+
if err != nil {
|
|
477
|
+
return nil, err
|
|
478
|
+
}
|
|
479
|
+
return b[:n], nil
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
func (m *UintMapEntry) XXX_Merge(src proto.Message) {
|
|
483
|
+
xxx_messageInfo_UintMapEntry.Merge(m, src)
|
|
484
|
+
}
|
|
485
|
+
func (m *UintMapEntry) XXX_Size() int {
|
|
486
|
+
return m.Size()
|
|
487
|
+
}
|
|
488
|
+
func (m *UintMapEntry) XXX_DiscardUnknown() {
|
|
489
|
+
xxx_messageInfo_UintMapEntry.DiscardUnknown(m)
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
var xxx_messageInfo_UintMapEntry proto.InternalMessageInfo
|
|
493
|
+
|
|
494
|
+
func (m *UintMapEntry) GetKey() string {
|
|
495
|
+
if m != nil {
|
|
496
|
+
return m.Key
|
|
497
|
+
}
|
|
498
|
+
return ""
|
|
499
|
+
}
|
|
500
|
+
|
|
436
501
|
// Egress is the format for a swingset egress.
|
|
437
502
|
type Egress struct {
|
|
438
503
|
Nickname string `protobuf:"bytes,1,opt,name=nickname,proto3" json:"nickname" yaml:"nickname"`
|
|
@@ -445,7 +510,7 @@ func (m *Egress) Reset() { *m = Egress{} }
|
|
|
445
510
|
func (m *Egress) String() string { return proto.CompactTextString(m) }
|
|
446
511
|
func (*Egress) ProtoMessage() {}
|
|
447
512
|
func (*Egress) Descriptor() ([]byte, []int) {
|
|
448
|
-
return fileDescriptor_ff9c341e0de15f8b, []int{
|
|
513
|
+
return fileDescriptor_ff9c341e0de15f8b, []int{8}
|
|
449
514
|
}
|
|
450
515
|
func (m *Egress) XXX_Unmarshal(b []byte) error {
|
|
451
516
|
return m.Unmarshal(b)
|
|
@@ -508,7 +573,7 @@ func (m *SwingStoreArtifact) Reset() { *m = SwingStoreArtifact{} }
|
|
|
508
573
|
func (m *SwingStoreArtifact) String() string { return proto.CompactTextString(m) }
|
|
509
574
|
func (*SwingStoreArtifact) ProtoMessage() {}
|
|
510
575
|
func (*SwingStoreArtifact) Descriptor() ([]byte, []int) {
|
|
511
|
-
return fileDescriptor_ff9c341e0de15f8b, []int{
|
|
576
|
+
return fileDescriptor_ff9c341e0de15f8b, []int{9}
|
|
512
577
|
}
|
|
513
578
|
func (m *SwingStoreArtifact) XXX_Unmarshal(b []byte) error {
|
|
514
579
|
return m.Unmarshal(b)
|
|
@@ -559,6 +624,7 @@ func init() {
|
|
|
559
624
|
proto.RegisterType((*StringBeans)(nil), "agoric.swingset.StringBeans")
|
|
560
625
|
proto.RegisterType((*PowerFlagFee)(nil), "agoric.swingset.PowerFlagFee")
|
|
561
626
|
proto.RegisterType((*QueueSize)(nil), "agoric.swingset.QueueSize")
|
|
627
|
+
proto.RegisterType((*UintMapEntry)(nil), "agoric.swingset.UintMapEntry")
|
|
562
628
|
proto.RegisterType((*Egress)(nil), "agoric.swingset.Egress")
|
|
563
629
|
proto.RegisterType((*SwingStoreArtifact)(nil), "agoric.swingset.SwingStoreArtifact")
|
|
564
630
|
}
|
|
@@ -566,60 +632,64 @@ func init() {
|
|
|
566
632
|
func init() { proto.RegisterFile("agoric/swingset/swingset.proto", fileDescriptor_ff9c341e0de15f8b) }
|
|
567
633
|
|
|
568
634
|
var fileDescriptor_ff9c341e0de15f8b = []byte{
|
|
569
|
-
//
|
|
570
|
-
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55,
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
635
|
+
// 897 bytes of a gzipped FileDescriptorProto
|
|
636
|
+
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4d, 0x6f, 0xe3, 0x44,
|
|
637
|
+
0x18, 0x8e, 0xc9, 0x07, 0xcd, 0x9b, 0x6c, 0x5b, 0x86, 0x4a, 0x1b, 0x2a, 0x36, 0xae, 0x7c, 0xa1,
|
|
638
|
+
0xd2, 0x6a, 0x93, 0x2d, 0x08, 0x21, 0x65, 0xc5, 0x21, 0x8e, 0xb2, 0x5a, 0x09, 0x2d, 0xca, 0x3a,
|
|
639
|
+
0x2a, 0x07, 0x04, 0xb2, 0x26, 0xce, 0xc4, 0x4c, 0xeb, 0x78, 0xbc, 0x9e, 0x49, 0xda, 0xee, 0x1f,
|
|
640
|
+
0x80, 0x23, 0xe2, 0xc4, 0xb1, 0x67, 0x7e, 0xc9, 0x1e, 0xf7, 0x88, 0x38, 0x98, 0x55, 0x7b, 0x41,
|
|
641
|
+
0x3d, 0xe6, 0x88, 0x84, 0x84, 0xe6, 0x23, 0xae, 0x45, 0x17, 0x51, 0x21, 0xed, 0xc9, 0xf3, 0x7e,
|
|
642
|
+
0x3f, 0xef, 0xf3, 0x8c, 0x6d, 0x68, 0xe3, 0x90, 0xa5, 0x34, 0xe8, 0xf2, 0x13, 0x1a, 0x87, 0x9c,
|
|
643
|
+
0x88, 0xfc, 0xd0, 0x49, 0x52, 0x26, 0x18, 0xda, 0xd2, 0xf1, 0xce, 0xda, 0xbd, 0xbb, 0x13, 0xb2,
|
|
644
|
+
0x90, 0xa9, 0x58, 0x57, 0x9e, 0x74, 0xda, 0x6e, 0x3b, 0x60, 0x7c, 0xce, 0x78, 0x77, 0x82, 0x39,
|
|
645
|
+
0xe9, 0x2e, 0x0f, 0x26, 0x44, 0xe0, 0x83, 0x6e, 0xc0, 0x68, 0xac, 0xe3, 0xce, 0xf7, 0x16, 0x6c,
|
|
646
|
+
0x0f, 0x58, 0x4a, 0x86, 0x4b, 0x1c, 0x8d, 0x52, 0x96, 0x30, 0x8e, 0x23, 0xb4, 0x03, 0x55, 0x41,
|
|
647
|
+
0x45, 0x44, 0x5a, 0xd6, 0x9e, 0xb5, 0x5f, 0xf7, 0xb4, 0x81, 0xf6, 0xa0, 0x31, 0x25, 0x3c, 0x48,
|
|
648
|
+
0x69, 0x22, 0x28, 0x8b, 0x5b, 0xef, 0xa8, 0x58, 0xd1, 0x85, 0x3e, 0x85, 0x2a, 0x59, 0xe2, 0x88,
|
|
649
|
+
0xb7, 0xca, 0x7b, 0xe5, 0xfd, 0xc6, 0xc7, 0x1f, 0x74, 0xfe, 0x81, 0xb1, 0xb3, 0x9e, 0xe4, 0x56,
|
|
650
|
+
0x5e, 0x66, 0x76, 0xc9, 0xd3, 0xd9, 0xbd, 0xca, 0x0f, 0xe7, 0x76, 0xc9, 0xe1, 0xb0, 0xb1, 0x0e,
|
|
651
|
+
0xa3, 0x1e, 0x34, 0x8f, 0x38, 0x8b, 0xfd, 0x84, 0xa4, 0x73, 0x2a, 0xb8, 0xc6, 0xe1, 0xde, 0x5d,
|
|
652
|
+
0x65, 0xf6, 0xfb, 0x67, 0x78, 0x1e, 0xf5, 0x9c, 0x62, 0xd4, 0xf1, 0x1a, 0xd2, 0x1c, 0x69, 0x0b,
|
|
653
|
+
0xdd, 0x87, 0x77, 0x8f, 0xb8, 0x1f, 0xb0, 0x29, 0xd1, 0x10, 0x5d, 0xb4, 0xca, 0xec, 0xcd, 0x75,
|
|
654
|
+
0x99, 0x0a, 0x38, 0x5e, 0xed, 0x88, 0x0f, 0xe4, 0xe1, 0x75, 0x19, 0x6a, 0x23, 0x9c, 0xe2, 0x39,
|
|
655
|
+
0x47, 0x4f, 0x60, 0x73, 0x42, 0x70, 0xcc, 0x65, 0x5b, 0x7f, 0x11, 0x53, 0xd1, 0xb2, 0xd4, 0x16,
|
|
656
|
+
0x1f, 0xde, 0xd8, 0x62, 0x2c, 0x52, 0x1a, 0x87, 0xae, 0x4c, 0x36, 0x8b, 0x34, 0x55, 0xe5, 0x88,
|
|
657
|
+
0xa4, 0x87, 0x31, 0x15, 0xe8, 0x39, 0x6c, 0xce, 0x08, 0x51, 0x3d, 0xfc, 0x24, 0xa5, 0x81, 0x04,
|
|
658
|
+
0xa2, 0xf9, 0xd0, 0x62, 0x74, 0xa4, 0x18, 0x1d, 0x23, 0x46, 0x67, 0xc0, 0x68, 0xec, 0x3e, 0x94,
|
|
659
|
+
0x6d, 0x7e, 0xf9, 0xdd, 0xde, 0x0f, 0xa9, 0xf8, 0x6e, 0x31, 0xe9, 0x04, 0x6c, 0xde, 0x35, 0xca,
|
|
660
|
+
0xe9, 0xc7, 0x03, 0x3e, 0x3d, 0xee, 0x8a, 0xb3, 0x84, 0x70, 0x55, 0xc0, 0xbd, 0xe6, 0x8c, 0x10,
|
|
661
|
+
0x39, 0x6d, 0x24, 0x07, 0xa0, 0x87, 0xb0, 0x33, 0x61, 0x4c, 0x70, 0x91, 0xe2, 0xc4, 0x5f, 0x62,
|
|
662
|
+
0xe1, 0x07, 0x2c, 0x9e, 0xd1, 0xb0, 0x55, 0x56, 0x22, 0xa1, 0x3c, 0xf6, 0x15, 0x16, 0x03, 0x15,
|
|
663
|
+
0x41, 0x5f, 0xc0, 0x56, 0xc2, 0x4e, 0x48, 0xea, 0xcf, 0x22, 0x1c, 0xfa, 0x33, 0x42, 0x78, 0xab,
|
|
664
|
+
0xa2, 0x50, 0xde, 0xbb, 0xb1, 0xef, 0x48, 0xe6, 0x3d, 0x8e, 0x70, 0xf8, 0x98, 0x10, 0xb3, 0xf0,
|
|
665
|
+
0x9d, 0xa4, 0xe0, 0xe3, 0xe8, 0x73, 0xa8, 0x3f, 0x5f, 0x90, 0x05, 0xf1, 0xe7, 0xf8, 0xb4, 0x55,
|
|
666
|
+
0x55, 0x6d, 0x76, 0x6f, 0xb4, 0x79, 0x26, 0x33, 0xc6, 0xf4, 0xc5, 0xba, 0xc7, 0x86, 0x2a, 0x79,
|
|
667
|
+
0x8a, 0x4f, 0xd1, 0x33, 0x40, 0x0a, 0x73, 0x44, 0x70, 0xbc, 0x48, 0xfc, 0xc9, 0x62, 0x1a, 0x12,
|
|
668
|
+
0xd1, 0xaa, 0xfd, 0x0b, 0x9c, 0x43, 0x1a, 0x8b, 0xa7, 0x38, 0x19, 0xc6, 0x22, 0x3d, 0x33, 0xad,
|
|
669
|
+
0xb6, 0x97, 0x58, 0x0c, 0x74, 0xb5, 0xab, 0x8a, 0x7b, 0x1b, 0x3f, 0x9f, 0xdb, 0xa5, 0x3f, 0xce,
|
|
670
|
+
0x6d, 0xcb, 0xf9, 0x12, 0xaa, 0x63, 0x81, 0x05, 0x41, 0x43, 0xb8, 0xa3, 0x41, 0xe2, 0x28, 0x62,
|
|
671
|
+
0x27, 0x64, 0x6a, 0xf4, 0xfd, 0x6f, 0xa0, 0x4d, 0x55, 0xd6, 0xd7, 0x55, 0x4e, 0x04, 0x8d, 0xc2,
|
|
672
|
+
0x05, 0x40, 0xdb, 0x50, 0x3e, 0x26, 0x67, 0xe6, 0x4d, 0x91, 0x47, 0x34, 0x84, 0xaa, 0xba, 0x0e,
|
|
673
|
+
0xe6, 0xfa, 0x75, 0x65, 0x8f, 0xdf, 0x32, 0xfb, 0xa3, 0x5b, 0x48, 0x2b, 0x57, 0xf3, 0x74, 0x75,
|
|
674
|
+
0xaf, 0xa2, 0xd0, 0xff, 0x64, 0x41, 0xb3, 0xc8, 0x3f, 0xba, 0x07, 0x70, 0xad, 0x9b, 0x19, 0x5b,
|
|
675
|
+
0xcf, 0xd5, 0x40, 0xdf, 0x42, 0x79, 0x46, 0xde, 0xca, 0x85, 0x93, 0x7d, 0x0d, 0xa8, 0xcf, 0xa0,
|
|
676
|
+
0x9e, 0x73, 0xf4, 0x06, 0x02, 0x10, 0x54, 0x38, 0x7d, 0xa1, 0x5f, 0xbf, 0xaa, 0xa7, 0xce, 0xa6,
|
|
677
|
+
0x70, 0x0e, 0xcd, 0xa2, 0x7a, 0x6f, 0x26, 0x6f, 0x89, 0xa3, 0x05, 0xf9, 0xdf, 0xe4, 0xa9, 0x6a,
|
|
678
|
+
0x33, 0xee, 0x2f, 0x0b, 0x6a, 0xc3, 0x30, 0x25, 0x9c, 0xa3, 0x47, 0xb0, 0x11, 0xd3, 0xe0, 0x38,
|
|
679
|
+
0xc6, 0x73, 0xf3, 0x55, 0x73, 0xed, 0xab, 0xcc, 0xce, 0x7d, 0xab, 0xcc, 0xde, 0xd2, 0x9f, 0x88,
|
|
680
|
+
0xb5, 0xc7, 0xf1, 0xf2, 0x20, 0xfa, 0x06, 0x2a, 0x09, 0x21, 0xa9, 0xc2, 0xd4, 0x74, 0x9f, 0x5c,
|
|
681
|
+
0x65, 0xb6, 0xb2, 0x57, 0x99, 0xdd, 0xd0, 0x45, 0xd2, 0x72, 0xfe, 0xcc, 0xec, 0x07, 0xb7, 0x80,
|
|
682
|
+
0xd9, 0x0f, 0x82, 0xfe, 0x74, 0x2a, 0x41, 0x79, 0xaa, 0x0b, 0xf2, 0xa0, 0x71, 0xad, 0xa8, 0xfe,
|
|
683
|
+
0x76, 0xd6, 0xdd, 0x83, 0x8b, 0xcc, 0x86, 0x5c, 0x78, 0x7e, 0x95, 0xd9, 0x90, 0x8b, 0xcc, 0x57,
|
|
684
|
+
0x99, 0xfd, 0x9e, 0x19, 0x9c, 0xfb, 0x1c, 0xaf, 0x90, 0xa0, 0xf6, 0x2f, 0x39, 0x02, 0xd0, 0x58,
|
|
685
|
+
0x5e, 0xea, 0xb1, 0x60, 0x29, 0xe9, 0xa7, 0x82, 0xce, 0x70, 0x20, 0xd0, 0x7d, 0xa8, 0x14, 0x68,
|
|
686
|
+
0xb8, 0x2b, 0xb7, 0x31, 0x14, 0x98, 0x6d, 0xf4, 0xfa, 0xca, 0x29, 0x93, 0xa7, 0x58, 0x60, 0xb3,
|
|
687
|
+
0xba, 0x4a, 0x96, 0xf6, 0x75, 0xb2, 0xb4, 0x1c, 0x4f, 0x39, 0xf5, 0x54, 0xf7, 0xf0, 0xe5, 0x45,
|
|
688
|
+
0xdb, 0x7a, 0x75, 0xd1, 0xb6, 0x5e, 0x5f, 0xb4, 0xad, 0x1f, 0x2f, 0xdb, 0xa5, 0x57, 0x97, 0xed,
|
|
689
|
+
0xd2, 0xaf, 0x97, 0xed, 0xd2, 0xd7, 0x8f, 0x0a, 0xf4, 0xf4, 0xf5, 0xef, 0x4d, 0xbf, 0x7b, 0x8a,
|
|
690
|
+
0x9e, 0x90, 0x45, 0x38, 0x0e, 0xd7, 0xbc, 0x9d, 0x5e, 0xff, 0xf9, 0x14, 0x6f, 0x93, 0x9a, 0xfa,
|
|
691
|
+
0x61, 0x7d, 0xf2, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xec, 0x66, 0x1a, 0x0f, 0x19, 0x07, 0x00,
|
|
692
|
+
0x00,
|
|
623
693
|
}
|
|
624
694
|
|
|
625
695
|
func (this *Params) Equal(that interface{}) bool {
|
|
@@ -676,6 +746,14 @@ func (this *Params) Equal(that interface{}) bool {
|
|
|
676
746
|
return false
|
|
677
747
|
}
|
|
678
748
|
}
|
|
749
|
+
if len(this.VatCleanupBudget) != len(that1.VatCleanupBudget) {
|
|
750
|
+
return false
|
|
751
|
+
}
|
|
752
|
+
for i := range this.VatCleanupBudget {
|
|
753
|
+
if !this.VatCleanupBudget[i].Equal(&that1.VatCleanupBudget[i]) {
|
|
754
|
+
return false
|
|
755
|
+
}
|
|
756
|
+
}
|
|
679
757
|
return true
|
|
680
758
|
}
|
|
681
759
|
func (this *StringBeans) Equal(that interface{}) bool {
|
|
@@ -764,6 +842,33 @@ func (this *QueueSize) Equal(that interface{}) bool {
|
|
|
764
842
|
}
|
|
765
843
|
return true
|
|
766
844
|
}
|
|
845
|
+
func (this *UintMapEntry) Equal(that interface{}) bool {
|
|
846
|
+
if that == nil {
|
|
847
|
+
return this == nil
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
that1, ok := that.(*UintMapEntry)
|
|
851
|
+
if !ok {
|
|
852
|
+
that2, ok := that.(UintMapEntry)
|
|
853
|
+
if ok {
|
|
854
|
+
that1 = &that2
|
|
855
|
+
} else {
|
|
856
|
+
return false
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
if that1 == nil {
|
|
860
|
+
return this == nil
|
|
861
|
+
} else if this == nil {
|
|
862
|
+
return false
|
|
863
|
+
}
|
|
864
|
+
if this.Key != that1.Key {
|
|
865
|
+
return false
|
|
866
|
+
}
|
|
867
|
+
if !this.Value.Equal(that1.Value) {
|
|
868
|
+
return false
|
|
869
|
+
}
|
|
870
|
+
return true
|
|
871
|
+
}
|
|
767
872
|
func (m *CoreEvalProposal) Marshal() (dAtA []byte, err error) {
|
|
768
873
|
size := m.Size()
|
|
769
874
|
dAtA = make([]byte, size)
|
|
@@ -872,6 +977,20 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
|
872
977
|
_ = i
|
|
873
978
|
var l int
|
|
874
979
|
_ = l
|
|
980
|
+
if len(m.VatCleanupBudget) > 0 {
|
|
981
|
+
for iNdEx := len(m.VatCleanupBudget) - 1; iNdEx >= 0; iNdEx-- {
|
|
982
|
+
{
|
|
983
|
+
size, err := m.VatCleanupBudget[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
|
984
|
+
if err != nil {
|
|
985
|
+
return 0, err
|
|
986
|
+
}
|
|
987
|
+
i -= size
|
|
988
|
+
i = encodeVarintSwingset(dAtA, i, uint64(size))
|
|
989
|
+
}
|
|
990
|
+
i--
|
|
991
|
+
dAtA[i] = 0x32
|
|
992
|
+
}
|
|
993
|
+
}
|
|
875
994
|
if len(m.QueueMax) > 0 {
|
|
876
995
|
for iNdEx := len(m.QueueMax) - 1; iNdEx >= 0; iNdEx-- {
|
|
877
996
|
{
|
|
@@ -1094,6 +1213,46 @@ func (m *QueueSize) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
|
1094
1213
|
return len(dAtA) - i, nil
|
|
1095
1214
|
}
|
|
1096
1215
|
|
|
1216
|
+
func (m *UintMapEntry) Marshal() (dAtA []byte, err error) {
|
|
1217
|
+
size := m.Size()
|
|
1218
|
+
dAtA = make([]byte, size)
|
|
1219
|
+
n, err := m.MarshalToSizedBuffer(dAtA[:size])
|
|
1220
|
+
if err != nil {
|
|
1221
|
+
return nil, err
|
|
1222
|
+
}
|
|
1223
|
+
return dAtA[:n], nil
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
func (m *UintMapEntry) MarshalTo(dAtA []byte) (int, error) {
|
|
1227
|
+
size := m.Size()
|
|
1228
|
+
return m.MarshalToSizedBuffer(dAtA[:size])
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
func (m *UintMapEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
|
1232
|
+
i := len(dAtA)
|
|
1233
|
+
_ = i
|
|
1234
|
+
var l int
|
|
1235
|
+
_ = l
|
|
1236
|
+
{
|
|
1237
|
+
size := m.Value.Size()
|
|
1238
|
+
i -= size
|
|
1239
|
+
if _, err := m.Value.MarshalTo(dAtA[i:]); err != nil {
|
|
1240
|
+
return 0, err
|
|
1241
|
+
}
|
|
1242
|
+
i = encodeVarintSwingset(dAtA, i, uint64(size))
|
|
1243
|
+
}
|
|
1244
|
+
i--
|
|
1245
|
+
dAtA[i] = 0x12
|
|
1246
|
+
if len(m.Key) > 0 {
|
|
1247
|
+
i -= len(m.Key)
|
|
1248
|
+
copy(dAtA[i:], m.Key)
|
|
1249
|
+
i = encodeVarintSwingset(dAtA, i, uint64(len(m.Key)))
|
|
1250
|
+
i--
|
|
1251
|
+
dAtA[i] = 0xa
|
|
1252
|
+
}
|
|
1253
|
+
return len(dAtA) - i, nil
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1097
1256
|
func (m *Egress) Marshal() (dAtA []byte, err error) {
|
|
1098
1257
|
size := m.Size()
|
|
1099
1258
|
dAtA = make([]byte, size)
|
|
@@ -1262,6 +1421,12 @@ func (m *Params) Size() (n int) {
|
|
|
1262
1421
|
n += 1 + l + sovSwingset(uint64(l))
|
|
1263
1422
|
}
|
|
1264
1423
|
}
|
|
1424
|
+
if len(m.VatCleanupBudget) > 0 {
|
|
1425
|
+
for _, e := range m.VatCleanupBudget {
|
|
1426
|
+
l = e.Size()
|
|
1427
|
+
n += 1 + l + sovSwingset(uint64(l))
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1265
1430
|
return n
|
|
1266
1431
|
}
|
|
1267
1432
|
|
|
@@ -1330,6 +1495,21 @@ func (m *QueueSize) Size() (n int) {
|
|
|
1330
1495
|
return n
|
|
1331
1496
|
}
|
|
1332
1497
|
|
|
1498
|
+
func (m *UintMapEntry) Size() (n int) {
|
|
1499
|
+
if m == nil {
|
|
1500
|
+
return 0
|
|
1501
|
+
}
|
|
1502
|
+
var l int
|
|
1503
|
+
_ = l
|
|
1504
|
+
l = len(m.Key)
|
|
1505
|
+
if l > 0 {
|
|
1506
|
+
n += 1 + l + sovSwingset(uint64(l))
|
|
1507
|
+
}
|
|
1508
|
+
l = m.Value.Size()
|
|
1509
|
+
n += 1 + l + sovSwingset(uint64(l))
|
|
1510
|
+
return n
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1333
1513
|
func (m *Egress) Size() (n int) {
|
|
1334
1514
|
if m == nil {
|
|
1335
1515
|
return 0
|
|
@@ -1835,6 +2015,40 @@ func (m *Params) Unmarshal(dAtA []byte) error {
|
|
|
1835
2015
|
return err
|
|
1836
2016
|
}
|
|
1837
2017
|
iNdEx = postIndex
|
|
2018
|
+
case 6:
|
|
2019
|
+
if wireType != 2 {
|
|
2020
|
+
return fmt.Errorf("proto: wrong wireType = %d for field VatCleanupBudget", wireType)
|
|
2021
|
+
}
|
|
2022
|
+
var msglen int
|
|
2023
|
+
for shift := uint(0); ; shift += 7 {
|
|
2024
|
+
if shift >= 64 {
|
|
2025
|
+
return ErrIntOverflowSwingset
|
|
2026
|
+
}
|
|
2027
|
+
if iNdEx >= l {
|
|
2028
|
+
return io.ErrUnexpectedEOF
|
|
2029
|
+
}
|
|
2030
|
+
b := dAtA[iNdEx]
|
|
2031
|
+
iNdEx++
|
|
2032
|
+
msglen |= int(b&0x7F) << shift
|
|
2033
|
+
if b < 0x80 {
|
|
2034
|
+
break
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
if msglen < 0 {
|
|
2038
|
+
return ErrInvalidLengthSwingset
|
|
2039
|
+
}
|
|
2040
|
+
postIndex := iNdEx + msglen
|
|
2041
|
+
if postIndex < 0 {
|
|
2042
|
+
return ErrInvalidLengthSwingset
|
|
2043
|
+
}
|
|
2044
|
+
if postIndex > l {
|
|
2045
|
+
return io.ErrUnexpectedEOF
|
|
2046
|
+
}
|
|
2047
|
+
m.VatCleanupBudget = append(m.VatCleanupBudget, UintMapEntry{})
|
|
2048
|
+
if err := m.VatCleanupBudget[len(m.VatCleanupBudget)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
2049
|
+
return err
|
|
2050
|
+
}
|
|
2051
|
+
iNdEx = postIndex
|
|
1838
2052
|
default:
|
|
1839
2053
|
iNdEx = preIndex
|
|
1840
2054
|
skippy, err := skipSwingset(dAtA[iNdEx:])
|
|
@@ -2273,6 +2487,122 @@ func (m *QueueSize) Unmarshal(dAtA []byte) error {
|
|
|
2273
2487
|
}
|
|
2274
2488
|
return nil
|
|
2275
2489
|
}
|
|
2490
|
+
func (m *UintMapEntry) Unmarshal(dAtA []byte) error {
|
|
2491
|
+
l := len(dAtA)
|
|
2492
|
+
iNdEx := 0
|
|
2493
|
+
for iNdEx < l {
|
|
2494
|
+
preIndex := iNdEx
|
|
2495
|
+
var wire uint64
|
|
2496
|
+
for shift := uint(0); ; shift += 7 {
|
|
2497
|
+
if shift >= 64 {
|
|
2498
|
+
return ErrIntOverflowSwingset
|
|
2499
|
+
}
|
|
2500
|
+
if iNdEx >= l {
|
|
2501
|
+
return io.ErrUnexpectedEOF
|
|
2502
|
+
}
|
|
2503
|
+
b := dAtA[iNdEx]
|
|
2504
|
+
iNdEx++
|
|
2505
|
+
wire |= uint64(b&0x7F) << shift
|
|
2506
|
+
if b < 0x80 {
|
|
2507
|
+
break
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
fieldNum := int32(wire >> 3)
|
|
2511
|
+
wireType := int(wire & 0x7)
|
|
2512
|
+
if wireType == 4 {
|
|
2513
|
+
return fmt.Errorf("proto: UintMapEntry: wiretype end group for non-group")
|
|
2514
|
+
}
|
|
2515
|
+
if fieldNum <= 0 {
|
|
2516
|
+
return fmt.Errorf("proto: UintMapEntry: illegal tag %d (wire type %d)", fieldNum, wire)
|
|
2517
|
+
}
|
|
2518
|
+
switch fieldNum {
|
|
2519
|
+
case 1:
|
|
2520
|
+
if wireType != 2 {
|
|
2521
|
+
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
|
|
2522
|
+
}
|
|
2523
|
+
var stringLen uint64
|
|
2524
|
+
for shift := uint(0); ; shift += 7 {
|
|
2525
|
+
if shift >= 64 {
|
|
2526
|
+
return ErrIntOverflowSwingset
|
|
2527
|
+
}
|
|
2528
|
+
if iNdEx >= l {
|
|
2529
|
+
return io.ErrUnexpectedEOF
|
|
2530
|
+
}
|
|
2531
|
+
b := dAtA[iNdEx]
|
|
2532
|
+
iNdEx++
|
|
2533
|
+
stringLen |= uint64(b&0x7F) << shift
|
|
2534
|
+
if b < 0x80 {
|
|
2535
|
+
break
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
intStringLen := int(stringLen)
|
|
2539
|
+
if intStringLen < 0 {
|
|
2540
|
+
return ErrInvalidLengthSwingset
|
|
2541
|
+
}
|
|
2542
|
+
postIndex := iNdEx + intStringLen
|
|
2543
|
+
if postIndex < 0 {
|
|
2544
|
+
return ErrInvalidLengthSwingset
|
|
2545
|
+
}
|
|
2546
|
+
if postIndex > l {
|
|
2547
|
+
return io.ErrUnexpectedEOF
|
|
2548
|
+
}
|
|
2549
|
+
m.Key = string(dAtA[iNdEx:postIndex])
|
|
2550
|
+
iNdEx = postIndex
|
|
2551
|
+
case 2:
|
|
2552
|
+
if wireType != 2 {
|
|
2553
|
+
return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType)
|
|
2554
|
+
}
|
|
2555
|
+
var stringLen uint64
|
|
2556
|
+
for shift := uint(0); ; shift += 7 {
|
|
2557
|
+
if shift >= 64 {
|
|
2558
|
+
return ErrIntOverflowSwingset
|
|
2559
|
+
}
|
|
2560
|
+
if iNdEx >= l {
|
|
2561
|
+
return io.ErrUnexpectedEOF
|
|
2562
|
+
}
|
|
2563
|
+
b := dAtA[iNdEx]
|
|
2564
|
+
iNdEx++
|
|
2565
|
+
stringLen |= uint64(b&0x7F) << shift
|
|
2566
|
+
if b < 0x80 {
|
|
2567
|
+
break
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
intStringLen := int(stringLen)
|
|
2571
|
+
if intStringLen < 0 {
|
|
2572
|
+
return ErrInvalidLengthSwingset
|
|
2573
|
+
}
|
|
2574
|
+
postIndex := iNdEx + intStringLen
|
|
2575
|
+
if postIndex < 0 {
|
|
2576
|
+
return ErrInvalidLengthSwingset
|
|
2577
|
+
}
|
|
2578
|
+
if postIndex > l {
|
|
2579
|
+
return io.ErrUnexpectedEOF
|
|
2580
|
+
}
|
|
2581
|
+
if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
|
2582
|
+
return err
|
|
2583
|
+
}
|
|
2584
|
+
iNdEx = postIndex
|
|
2585
|
+
default:
|
|
2586
|
+
iNdEx = preIndex
|
|
2587
|
+
skippy, err := skipSwingset(dAtA[iNdEx:])
|
|
2588
|
+
if err != nil {
|
|
2589
|
+
return err
|
|
2590
|
+
}
|
|
2591
|
+
if (skippy < 0) || (iNdEx+skippy) < 0 {
|
|
2592
|
+
return ErrInvalidLengthSwingset
|
|
2593
|
+
}
|
|
2594
|
+
if (iNdEx + skippy) > l {
|
|
2595
|
+
return io.ErrUnexpectedEOF
|
|
2596
|
+
}
|
|
2597
|
+
iNdEx += skippy
|
|
2598
|
+
}
|
|
2599
|
+
}
|
|
2600
|
+
|
|
2601
|
+
if iNdEx > l {
|
|
2602
|
+
return io.ErrUnexpectedEOF
|
|
2603
|
+
}
|
|
2604
|
+
return nil
|
|
2605
|
+
}
|
|
2276
2606
|
func (m *Egress) Unmarshal(dAtA []byte) error {
|
|
2277
2607
|
l := len(dAtA)
|
|
2278
2608
|
iNdEx := 0
|
|
@@ -8,11 +8,12 @@ import (
|
|
|
8
8
|
)
|
|
9
9
|
|
|
10
10
|
func GetQueueItems(ctx sdk.Context, vstorageKeeper keeper.Keeper, queuePath string) ([]string, error) {
|
|
11
|
-
|
|
11
|
+
unlimitedCtx := ctx.WithGasMeter(sdk.NewInfiniteGasMeter())
|
|
12
|
+
head, err := vstorageKeeper.GetIntValue(unlimitedCtx, queuePath+".head")
|
|
12
13
|
if err != nil {
|
|
13
14
|
return nil, err
|
|
14
15
|
}
|
|
15
|
-
tail, err := vstorageKeeper.GetIntValue(
|
|
16
|
+
tail, err := vstorageKeeper.GetIntValue(unlimitedCtx, queuePath+".tail")
|
|
16
17
|
if err != nil {
|
|
17
18
|
return nil, err
|
|
18
19
|
}
|
|
@@ -21,7 +22,7 @@ func GetQueueItems(ctx sdk.Context, vstorageKeeper keeper.Keeper, queuePath stri
|
|
|
21
22
|
var i int64
|
|
22
23
|
for i = 0; i < length; i++ {
|
|
23
24
|
path := fmt.Sprintf("%s.%s", queuePath, head.Add(sdk.NewInt(i)).String())
|
|
24
|
-
values[i] = vstorageKeeper.GetEntry(
|
|
25
|
+
values[i] = vstorageKeeper.GetEntry(unlimitedCtx, path).StringValue()
|
|
25
26
|
}
|
|
26
27
|
return values, nil
|
|
27
28
|
}
|
|
@@ -26,6 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
26
26
|
|
|
27
27
|
// The initial and exported module state.
|
|
28
28
|
type GenesisState struct {
|
|
29
|
+
// The list of account addresses that are being watched by the VM.
|
|
29
30
|
WatchedAddresses []github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,rep,name=watched_addresses,json=watchedAddresses,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"watched_addresses" yaml:"watched_addresses"`
|
|
30
31
|
}
|
|
31
32
|
|