-
Notifications
You must be signed in to change notification settings - Fork 1
/
dynamic_config_okchain.go
138 lines (114 loc) · 3.39 KB
/
dynamic_config_okchain.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package config
import "time"
type IDynamicConfig interface {
GetMempoolRecheck() bool
GetMempoolForceRecheckGap() int64
GetMempoolSize() int
GetMempoolCacheSize() int
GetMaxTxNumPerBlock() int64
GetEnableDeleteMinGPTx() bool
GetMaxGasUsedPerBlock() int64
GetEnablePGU() bool
GetPGUAdjustment() float64
GetMempoolFlush() bool
GetNodeKeyWhitelist() []string
GetMempoolCheckTxCost() bool
GetSentryAddrs() []string
GetCsTimeoutPropose() time.Duration
GetCsTimeoutProposeDelta() time.Duration
GetCsTimeoutPrevote() time.Duration
GetCsTimeoutPrevoteDelta() time.Duration
GetCsTimeoutPrecommit() time.Duration
GetCsTimeoutPrecommitDelta() time.Duration
GetCsTimeoutCommit() time.Duration
GetEnableWtx() bool
GetDeliverTxsExecuteMode() int
GetEnableHasBlockPartMsg() bool
GetCommitGapOffset() int64
GetIavlAcNoBatch() bool
}
var DynamicConfig IDynamicConfig = MockDynamicConfig{}
func SetDynamicConfig(c IDynamicConfig) {
DynamicConfig = c
}
type MockDynamicConfig struct {
enableDeleteMinGPTx bool
}
func (d MockDynamicConfig) GetMempoolRecheck() bool {
return DefaultMempoolConfig().Recheck
}
func (d MockDynamicConfig) GetMempoolForceRecheckGap() int64 {
return DefaultMempoolConfig().ForceRecheckGap
}
func (d MockDynamicConfig) GetMempoolSize() int {
return DefaultMempoolConfig().Size
}
func (d MockDynamicConfig) GetMempoolCacheSize() int {
return DefaultMempoolConfig().CacheSize
}
func (d MockDynamicConfig) GetMaxTxNumPerBlock() int64 {
return DefaultMempoolConfig().MaxTxNumPerBlock
}
func (d MockDynamicConfig) GetMaxGasUsedPerBlock() int64 {
return DefaultMempoolConfig().MaxGasUsedPerBlock
}
func (d MockDynamicConfig) GetEnablePGU() bool {
return false
}
func (d MockDynamicConfig) GetPGUAdjustment() float64 {
return 1
}
func (d MockDynamicConfig) GetMempoolFlush() bool {
return false
}
func (d MockDynamicConfig) GetNodeKeyWhitelist() []string {
return []string{}
}
func (d MockDynamicConfig) GetMempoolCheckTxCost() bool {
return false
}
func (d MockDynamicConfig) GetSentryAddrs() []string {
return []string{}
}
func (d MockDynamicConfig) GetCsTimeoutPropose() time.Duration {
return DefaultConsensusConfig().TimeoutPropose
}
func (d MockDynamicConfig) GetCsTimeoutProposeDelta() time.Duration {
return DefaultConsensusConfig().TimeoutProposeDelta
}
func (d MockDynamicConfig) GetCsTimeoutPrevote() time.Duration {
return DefaultConsensusConfig().TimeoutPrevote
}
func (d MockDynamicConfig) GetCsTimeoutPrevoteDelta() time.Duration {
return DefaultConsensusConfig().TimeoutPrecommitDelta
}
func (d MockDynamicConfig) GetCsTimeoutPrecommit() time.Duration {
return DefaultConsensusConfig().TimeoutPrecommit
}
func (d MockDynamicConfig) GetCsTimeoutPrecommitDelta() time.Duration {
return DefaultConsensusConfig().TimeoutPrecommitDelta
}
func (d MockDynamicConfig) GetCsTimeoutCommit() time.Duration {
return DefaultConsensusConfig().TimeoutCommit
}
func (d MockDynamicConfig) GetEnableWtx() bool {
return false
}
func (d MockDynamicConfig) GetDeliverTxsExecuteMode() int {
return 0
}
func (d MockDynamicConfig) GetEnableHasBlockPartMsg() bool {
return false
}
func (d MockDynamicConfig) GetEnableDeleteMinGPTx() bool {
return d.enableDeleteMinGPTx
}
func (d *MockDynamicConfig) SetEnableDeleteMinGPTx(enable bool) {
d.enableDeleteMinGPTx = enable
}
func (d MockDynamicConfig) GetCommitGapOffset() int64 {
return 0
}
func (d MockDynamicConfig) GetIavlAcNoBatch() bool {
return false
}