-
Notifications
You must be signed in to change notification settings - Fork 272
Expand file tree
/
Copy pathdefaults.go
More file actions
230 lines (213 loc) · 5.92 KB
/
defaults.go
File metadata and controls
230 lines (213 loc) · 5.92 KB
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
// SPDX-License-Identifier: BUSL-1.1
//
// Copyright (C) 2025, Berachain Foundation. All rights reserved.
// Use of this software is governed by the Business Source License included
// in the LICENSE file of this repository and at www.mariadb.com/bsl11.
//
// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY
// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER
// VERSIONS OF THE LICENSED WORK.
//
// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF
// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF
// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE).
//
// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
// TITLE.
package config
import (
cometbft "github.com/berachain/beacon-kit/consensus/cometbft/service"
"github.com/berachain/beacon-kit/payload/builder"
)
// Consensus clients.
const (
NumValidators = 5
ClientValidator0 = "cl-validator-beaconkit-0"
ClientValidator1 = "cl-validator-beaconkit-1"
ClientValidator2 = "cl-validator-beaconkit-2"
ClientValidator3 = "cl-validator-beaconkit-3"
ClientValidator4 = "cl-validator-beaconkit-4"
)
// default network configuration.
//
//nolint:gochecknoglobals // it's a default value
var (
// defaultChainID is the default chain ID for the network.
defaultChainID = 80087
// defaultChainSpec is the default chain spec for the network.
defaultChainSpec = "devnet"
)
// DefaultE2ETestConfig provides a default configuration for end-to-end tests,
// pre-populating with a standard set of validators and no additional
// services.
func DefaultE2ETestConfig() *E2ETestConfig {
return &E2ETestConfig{
NetworkConfiguration: defaultNetworkConfiguration(),
NodeSettings: defaultNodeSettings(),
EthJSONRPCEndpoints: defaultEthJSONRPCEndpoints(),
AdditionalServices: defaultAdditionalServices(),
}
}
func defaultNetworkConfiguration() NetworkConfiguration {
return NetworkConfiguration{
ChainID: defaultChainID,
ChainSpec: defaultChainSpec,
Validators: defaultValidators(),
FullNodes: defaultFullNodes(),
SeedNodes: defaultSeedNodes(),
}
}
func defaultValidators() NodeSet {
return NodeSet{
Type: "validator",
Nodes: []Node{
{
ElType: "nethermind",
// TODO: restore once we solve https://github.com/berachain/beacon-kit/issues/2177
Replicas: 0, // nethermind cannot keep up with deposits checks
KZGImpl: "crate-crypto/go-kzg-4844",
},
{
ElType: "geth",
Replicas: 2, //nolint:mnd // we want two replicas here
KZGImpl: "crate-crypto/go-kzg-4844",
},
{
ElType: "reth",
Replicas: 2, //nolint:mnd // we want two replicas here
KZGImpl: "crate-crypto/go-kzg-4844",
},
{
ElType: "erigon",
Replicas: 1,
KZGImpl: "crate-crypto/go-kzg-4844",
},
{
ElType: "besu",
Replicas: 0, // Besu causing flakey tests.
KZGImpl: "crate-crypto/go-kzg-4844",
},
},
}
}
func defaultFullNodes() NodeSet {
return NodeSet{
Type: "full",
Nodes: []Node{
{
ElType: "nethermind",
Replicas: 1,
KZGImpl: "crate-crypto/go-kzg-4844",
},
{
ElType: "reth",
Replicas: 1,
KZGImpl: "crate-crypto/go-kzg-4844",
},
{
ElType: "geth",
Replicas: 1,
KZGImpl: "crate-crypto/go-kzg-4844",
},
{
ElType: "erigon",
Replicas: 1,
KZGImpl: "crate-crypto/go-kzg-4844",
},
{
ElType: "besu",
Replicas: 1,
KZGImpl: "crate-crypto/go-kzg-4844",
},
},
}
}
func defaultSeedNodes() NodeSet {
return NodeSet{
Type: "seed",
Nodes: []Node{
{
ElType: "geth",
Replicas: 1,
KZGImpl: "crate-crypto/go-kzg-4844",
},
},
}
}
func defaultNodeSettings() NodeSettings {
return NodeSettings{
ExecutionSettings: defaultExecutionSettings(),
ConsensusSettings: defaultConsensusSettings(),
}
}
func defaultExecutionSettings() ExecutionSettings {
return ExecutionSettings{
Specs: NodeSpecs{
MinCPU: 0,
MaxCPU: 0,
MinMemory: 0,
MaxMemory: 2048, //nolint:mnd // 2 GB
},
Images: map[string]string{
"besu": "hyperledger/besu:24.5.4",
"erigon": "erigontech/erigon:v2.60.9",
"ethereumjs": "ethpandaops/ethereumjs:stable",
"geth": "ethereum/client-go:stable",
"nethermind": "nethermind/nethermind:latest",
"reth": "ghcr.io/paradigmxyz/reth:latest",
},
}
}
func defaultConsensusSettings() ConsensusSettings {
var (
defaultCfg = cometbft.DefaultConfig()
consensus = defaultCfg.Consensus
p2p = defaultCfg.P2P
builderCfg = builder.DefaultConfig()
)
return ConsensusSettings{
Specs: NodeSpecs{
MinCPU: 0,
MaxCPU: 2000, //nolint:mnd // 2 vCPUs
MinMemory: 0,
MaxMemory: 2048, //nolint:mnd // 2 GB
},
Images: map[string]string{
"beaconkit": "beacond:kurtosis-local",
},
Config: ConsensusConfig{
TimeoutPropose: consensus.TimeoutPropose.String(),
TimeoutPrevote: consensus.TimeoutPrevote.String(),
TimeoutPrecommit: consensus.TimeoutPrecommit.String(),
TimeoutCommit: consensus.TimeoutCommit.String(),
MaxNumInboundPeers: p2p.MaxNumInboundPeers,
MaxNumOutboundPeers: p2p.MaxNumOutboundPeers,
},
AppConfig: AppConfig{
PayloadTimeout: builderCfg.PayloadTimeout.String(),
EnableOptimisticPayloadBuilds: builderCfg.Enabled,
},
}
}
func defaultEthJSONRPCEndpoints() []EthJSONRPCEndpoint {
return []EthJSONRPCEndpoint{
{
Type: "blutgang",
Clients: []string{
// "el-full-nethermind-0",
// "el-full-reth-0",
"el-full-geth-2",
// "el-full-erigon-3",
// "el-full-erigon-3",
// Besu causing flakey tests.
// "el-full-besu-4",
},
},
}
}
func defaultAdditionalServices() []AdditionalService {
return []AdditionalService{}
}