/
default-params.go
79 lines (66 loc) · 3.2 KB
/
default-params.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
// This should roughly match the values in
// `agoric-sdk/packages/cosmic-swingset/src/sim-params.js`.
//
// Nothing bad happens if they diverge, but it makes for a truer simulation
// experience if they don't.
const (
BeansPerFeeUnit = "feeUnit"
BeansPerInboundTx = "inboundTx"
BeansPerBlockComputeLimit = "blockComputeLimit"
BeansPerMessage = "message"
BeansPerMessageByte = "messageByte"
BeansPerMinFeeDebit = "minFeeDebit"
BeansPerStorageByte = "storageByte"
BeansPerVatCreation = "vatCreation"
BeansPerXsnapComputron = "xsnapComputron"
// QueueSize keys.
// Keep up-to-date with updateQueueAllowed() in packanges/cosmic-swingset/src/launch-chain.js
QueueInbound = "inbound"
QueueInboundMempool = "inbound_mempool"
)
var (
DefaultBeansPerXsnapComputron = sdk.NewUint(100)
// DefaultBeansPerBlockComputeLimit is how many computron beans we allow
// before starting a new block. Some analysis (#3459) suggests this leads to
// about 2/3rds utilization, based on 5 sec voting time and up to 10 sec of
// computation.
DefaultBeansPerBlockComputeLimit = sdk.NewUint(8000000).Mul(DefaultBeansPerXsnapComputron)
// observed: 0.385 sec
DefaultBeansPerVatCreation = sdk.NewUint(300000).Mul(DefaultBeansPerXsnapComputron)
// Fees are denominated in this unit.
DefaultFeeUnitPrice = sdk.NewCoins(sdk.NewInt64Coin("uist", 1_000_000)) // $1
// TODO: create the cost model we want, and update these to be more principled.
// These defaults currently make deploying an ag-solo cost less than $1.00.
DefaultBeansPerFeeUnit = sdk.NewUint(1_000_000_000_000) // $1
DefaultBeansPerInboundTx = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(100)) // $0.01
DefaultBeansPerMessage = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(1_000)) // $0.001
DefaultBeansPerMessageByte = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(50_000)) // $0.00002
DefaultBeansPerMinFeeDebit = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(5)) // $0.2
DefaultBeansPerStorageByte = DefaultBeansPerFeeUnit.Quo(sdk.NewUint(500)) // $0.002
DefaultBootstrapVatConfig = "@agoric/vm-config/decentral-core-config.json"
DefaultPowerFlagFees = []PowerFlagFee{
NewPowerFlagFee("SMART_WALLET", sdk.NewCoins(sdk.NewInt64Coin("ubld", 10_000_000))),
}
DefaultInboundQueueMax = int32(1_000)
DefaultQueueMax = []QueueSize{
NewQueueSize(QueueInbound, DefaultInboundQueueMax),
}
)
// move DefaultBeansPerUnit to a function to allow for boot overriding of the Default params
func DefaultBeansPerUnit() []StringBeans {
return []StringBeans{
NewStringBeans(BeansPerBlockComputeLimit, DefaultBeansPerBlockComputeLimit),
NewStringBeans(BeansPerFeeUnit, DefaultBeansPerFeeUnit),
NewStringBeans(BeansPerInboundTx, DefaultBeansPerInboundTx),
NewStringBeans(BeansPerMessage, DefaultBeansPerMessage),
NewStringBeans(BeansPerMessageByte, DefaultBeansPerMessageByte),
NewStringBeans(BeansPerMinFeeDebit, DefaultBeansPerMinFeeDebit),
NewStringBeans(BeansPerStorageByte, DefaultBeansPerStorageByte),
NewStringBeans(BeansPerVatCreation, DefaultBeansPerVatCreation),
NewStringBeans(BeansPerXsnapComputron, DefaultBeansPerXsnapComputron),
}
}