@@ -32,7 +32,6 @@ import (
3232 tmnet "github.com/sei-protocol/sei-chain/sei-tendermint/libs/net"
3333 tmstrings "github.com/sei-protocol/sei-chain/sei-tendermint/libs/strings"
3434 "github.com/sei-protocol/sei-chain/sei-tendermint/libs/utils"
35- "github.com/sei-protocol/sei-chain/sei-tendermint/libs/utils/tcp"
3635 "github.com/sei-protocol/sei-chain/sei-tendermint/privval"
3736 tmgrpc "github.com/sei-protocol/sei-chain/sei-tendermint/privval/grpc"
3837 "github.com/sei-protocol/sei-chain/sei-tendermint/types"
@@ -198,62 +197,16 @@ func createEvidenceReactor(
198197 return evidenceReactor , evidencePool , evidenceDB .Close , nil
199198}
200199
201- // autobahnValidator represents a validator entry in the autobahn config file.
202- type autobahnValidator struct {
203- ValidatorKey atypes.PublicKey `json:"validator_key"` // autobahn validator public key
204- NodeKey p2p.NodePublicKey `json:"node_key"` // p2p node public key
205- Address tcp.HostPort `json:"address"` // network address (host:port)
206- }
207-
208- // autobahnFileConfig is the JSON structure of the autobahn config file.
209- type autobahnFileConfig struct {
210- Validators []autobahnValidator `json:"validators"`
211- MaxGasPerBlock uint64 `json:"max_gas_per_block"`
212- MaxTxsPerBlock uint64 `json:"max_txs_per_block"`
213- MaxTxsPerSecond utils.Option [uint64 ] `json:"max_txs_per_second"`
214- MempoolSize uint64 `json:"mempool_size"`
215- BlockInterval utils.Duration `json:"block_interval"`
216- AllowEmptyBlocks bool `json:"allow_empty_blocks"`
217- ViewTimeout utils.Duration `json:"view_timeout"`
218- PersistentStateDir utils.Option [string ] `json:"persistent_state_dir"`
219- DialInterval utils.Duration `json:"dial_interval"`
220- }
221-
222- func (fc * autobahnFileConfig ) validate () error {
223- if len (fc .Validators ) == 0 {
224- return errors .New ("validators must not be empty" )
225- }
226- if fc .MaxGasPerBlock == 0 {
227- return errors .New ("max_gas_per_block must be > 0" )
228- }
229- if fc .MaxTxsPerBlock == 0 {
230- return errors .New ("max_txs_per_block must be > 0" )
231- }
232- if fc .MempoolSize == 0 {
233- return errors .New ("mempool_size must be > 0" )
234- }
235- if fc .BlockInterval <= 0 {
236- return errors .New ("block_interval must be > 0" )
237- }
238- if fc .ViewTimeout <= 0 {
239- return errors .New ("view_timeout must be > 0" )
240- }
241- if fc .DialInterval <= 0 {
242- return errors .New ("dial_interval must be > 0" )
243- }
244- return nil
245- }
246-
247- func loadAutobahnFileConfig (path string ) (* autobahnFileConfig , error ) {
200+ func loadAutobahnFileConfig (path string ) (* config.AutobahnFileConfig , error ) {
248201 data , err := os .ReadFile (path ) //nolint:gosec // G304: path is from operator-controlled config
249202 if err != nil {
250203 return nil , err
251204 }
252- var fc autobahnFileConfig
205+ var fc config. AutobahnFileConfig
253206 if err := json .Unmarshal (data , & fc ); err != nil {
254207 return nil , err
255208 }
256- if err := fc .validate (); err != nil {
209+ if err := fc .Validate (); err != nil {
257210 return nil , err
258211 }
259212 return & fc , nil
@@ -415,6 +368,7 @@ func createRouter(
415368 }
416369 // Wire up Autobahn (GigaRouter) if enabled.
417370 if cfg .AutobahnConfigFile != "" {
371+ logger .Info ("Autobahn config enabled" , "config_file" , cfg .AutobahnConfigFile )
418372 // TODO: add support for autobahn non-validator (observer) nodes that don't need a signing key.
419373 valKey , ok := validatorKey .Get ()
420374 if ! ok {
@@ -424,6 +378,7 @@ func createRouter(
424378 if err != nil {
425379 return nil , closer , fmt .Errorf ("buildGigaConfig: %w" , err )
426380 }
381+ logger .Info ("Autobahn config loaded" , "validators" , len (gigaCfg .ValidatorAddrs ))
427382 options .Giga = utils .Some (gigaCfg )
428383 }
429384
0 commit comments