@@ -6,7 +6,6 @@ package chains
6
6
import (
7
7
"context"
8
8
"crypto"
9
- "crypto/tls"
10
9
"errors"
11
10
"fmt"
12
11
"os"
@@ -173,7 +172,8 @@ type ChainConfig struct {
173
172
174
173
type ManagerConfig struct {
175
174
SybilProtectionEnabled bool
176
- StakingTLSCert tls.Certificate // needed to sign snowman++ blocks
175
+ StakingTLSSigner crypto.Signer
176
+ StakingTLSCert * staking.Certificate
177
177
StakingBLSKey * bls.SecretKey
178
178
TracingEnabled bool
179
179
// Must not be used unless [TracingEnabled] is true as this may be nil.
@@ -239,9 +239,6 @@ type manager struct {
239
239
ids.Aliaser
240
240
ManagerConfig
241
241
242
- stakingSigner crypto.Signer
243
- stakingCert * staking.Certificate
244
-
245
242
// Those notified when a chain is created
246
243
registrants []Registrant
247
244
@@ -268,8 +265,6 @@ func New(config *ManagerConfig) Manager {
268
265
return & manager {
269
266
Aliaser : ids .NewAliaser (),
270
267
ManagerConfig : * config ,
271
- stakingSigner : config .StakingTLSCert .PrivateKey .(crypto.Signer ),
272
- stakingCert : staking .CertificateFromX509 (config .StakingTLSCert .Leaf ),
273
268
chains : make (map [ids.ID ]handler.Handler ),
274
269
chainsQueue : buffer.NewUnboundedBlockingDeque [ChainParameters ](initialQueueSize ),
275
270
unblockChainCreatorCh : make (chan struct {}),
@@ -725,8 +720,8 @@ func (m *manager) createAvalancheChain(
725
720
MinimumPChainHeight : m .ApricotPhase4MinPChainHeight ,
726
721
MinBlkDelay : minBlockDelay ,
727
722
NumHistoricalBlocks : numHistoricalBlocks ,
728
- StakingLeafSigner : m .stakingSigner ,
729
- StakingCertLeaf : m .stakingCert ,
723
+ StakingLeafSigner : m .StakingTLSSigner ,
724
+ StakingCertLeaf : m .StakingTLSCert ,
730
725
},
731
726
)
732
727
@@ -1062,8 +1057,8 @@ func (m *manager) createSnowmanChain(
1062
1057
MinimumPChainHeight : m .ApricotPhase4MinPChainHeight ,
1063
1058
MinBlkDelay : minBlockDelay ,
1064
1059
NumHistoricalBlocks : numHistoricalBlocks ,
1065
- StakingLeafSigner : m .stakingSigner ,
1066
- StakingCertLeaf : m .stakingCert ,
1060
+ StakingLeafSigner : m .StakingTLSSigner ,
1061
+ StakingCertLeaf : m .StakingTLSCert ,
1067
1062
},
1068
1063
)
1069
1064
0 commit comments