This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmodel.go
114 lines (97 loc) · 2.73 KB
/
model.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
package config
import (
"time"
"github.com/Worldcoin/hubble-commander/models"
"github.com/ethereum/go-ethereum/common"
"github.com/sirupsen/logrus"
)
const (
LogFormatText = "text"
LogFormatJSON = "json"
)
type Config struct {
Log *LogConfig
Metrics *MetricsConfig
Tracing *TracingConfig
Bootstrap *CommanderBootstrapConfig
Rollup *RollupConfig
API *APIConfig
Badger *BadgerConfig
Ethereum *EthereumConfig
// Hubble is not yet stable but a lot of services rely on the commander being available
// at all times. When SafeMode=true Hubble only serves API requests, it does not attempt
// to create batches or sync against the chain.
// export HUBBLE_SAFE_MODE=true
SafeMode bool
}
type LogConfig struct {
Level logrus.Level
// "json" or "text" (default)
Format string
}
type MetricsConfig struct {
Port string
Endpoint string
}
type TracingConfig struct {
Endpoint string
ServiceName string
Version string
Env string
Enabled bool
}
type DeployerConfig struct {
Bootstrap *DeployerBootstrapConfig
Ethereum *EthereumConfig
}
type DeployerBootstrapConfig struct {
GenesisAccounts []models.GenesisAccount `json:"-"`
BlocksToFinalise uint32
Chooser *common.Address
}
type CommanderBootstrapConfig struct {
Prune bool
Migrate bool
BootstrapNodeURL *string
ChainSpecPath *string
}
type RollupConfig struct {
SyncSize uint32
FeeReceiverPubKeyID uint32
MinTxsPerCommitment uint32
MaxTxsPerCommitment uint32
MinCommitmentsPerBatch uint32
MaxCommitmentsPerBatch uint32
TransferBatchSubmissionGasLimit uint64
C2TBatchSubmissionGasLimit uint64
MMBatchSubmissionGasLimit uint64
DepositBatchSubmissionGasLimit uint64
TransitionDisputeGasLimit uint64
SignatureDisputeGasLimit uint64
BatchAccountRegistrationGasLimit uint64
StakeWithdrawalGasLimit uint64
BatchLoopInterval time.Duration
DisableSignatures bool
// the current prod deployment has printed some bad batches and this flag triggers
// a hack to treat them as valid
HackSkipKnownBadSignatures bool
// if MinTxsPerCommitment or MinCommitmentsPerBatch cause a pending transaction to
// wait to be included for longer than this delay then they will be ignored and a
// new batch will be submitted
MaxTxnDelay time.Duration
}
type APIConfig struct {
Version string
Port string
EnableProofMethods bool
AuthenticationKey string `json:"-"`
}
type BadgerConfig struct {
Path string
}
type EthereumConfig struct {
RPCURL string `json:"-"`
ChainID uint64
PrivateKey string `json:"-"`
MineTimeout time.Duration
}