rm CommitteeChain.signerThreshold

This commit is contained in:
alan 2024-09-21 16:14:38 +08:00
parent 9326a118c7
commit 2c519a2ed1

View file

@ -77,7 +77,6 @@ type CommitteeChain struct {
sigVerifier committeeSigVerifier // BLS sig verifier (dummy verifier in tests) sigVerifier committeeSigVerifier // BLS sig verifier (dummy verifier in tests)
config *types.ChainConfig config *types.ChainConfig
signerThreshold int
minimumUpdateScore types.UpdateScore minimumUpdateScore types.UpdateScore
enforceTime bool // enforceTime specifies whether the age of a signed header should be checked enforceTime bool // enforceTime specifies whether the age of a signed header should be checked
} }
@ -96,14 +95,13 @@ func NewTestCommitteeChain(db ethdb.KeyValueStore, config *types.ChainConfig, si
// clock source and signature verification for testing purposes. // clock source and signature verification for testing purposes.
func newCommitteeChain(db ethdb.KeyValueStore, config *types.ChainConfig, signerThreshold int, enforceTime bool, sigVerifier committeeSigVerifier, clock mclock.Clock, unixNano func() int64) *CommitteeChain { func newCommitteeChain(db ethdb.KeyValueStore, config *types.ChainConfig, signerThreshold int, enforceTime bool, sigVerifier committeeSigVerifier, clock mclock.Clock, unixNano func() int64) *CommitteeChain {
s := &CommitteeChain{ s := &CommitteeChain{
committeeCache: lru.NewCache[uint64, syncCommittee](10), committeeCache: lru.NewCache[uint64, syncCommittee](10),
db: db, db: db,
sigVerifier: sigVerifier, sigVerifier: sigVerifier,
clock: clock, clock: clock,
unixNano: unixNano, unixNano: unixNano,
config: config, config: config,
signerThreshold: signerThreshold, enforceTime: enforceTime,
enforceTime: enforceTime,
minimumUpdateScore: types.UpdateScore{ minimumUpdateScore: types.UpdateScore{
SignerCount: uint32(signerThreshold), SignerCount: uint32(signerThreshold),
SubPeriodIndex: params.SyncPeriodLength / 16, SubPeriodIndex: params.SyncPeriodLength / 16,