mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 21:08:10 -05:00
Put the initialization of LC Store behind the enable-light-client flag (#15464)
* put lc store behind flag * lint * remove extra line
This commit is contained in:
@@ -13,6 +13,10 @@ type Store struct {
|
||||
lastOptimisticUpdate interfaces.LightClientOptimisticUpdate
|
||||
}
|
||||
|
||||
func NewLightClientStore() *Store {
|
||||
return &Store{}
|
||||
}
|
||||
|
||||
func (s *Store) SetLastFinalityUpdate(update interfaces.LightClientFinalityUpdate) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
|
||||
@@ -167,7 +167,6 @@ func New(cliCtx *cli.Context, cancel context.CancelFunc, opts ...Option) (*Beaco
|
||||
syncChecker: &initialsync.SyncChecker{},
|
||||
custodyInfo: &peerdas.CustodyInfo{},
|
||||
slasherEnabled: cliCtx.Bool(flags.SlasherFlag.Name),
|
||||
lcStore: &lightclient.Store{},
|
||||
}
|
||||
|
||||
for _, opt := range opts {
|
||||
@@ -235,6 +234,10 @@ func New(cliCtx *cli.Context, cancel context.CancelFunc, opts ...Option) (*Beaco
|
||||
// their initialization.
|
||||
beacon.finalizedStateAtStartUp = nil
|
||||
|
||||
if features.Get().EnableLightClient {
|
||||
beacon.lcStore = lightclient.NewLightClientStore()
|
||||
}
|
||||
|
||||
return beacon, nil
|
||||
}
|
||||
|
||||
|
||||
3
changelog/bastin_put-lc-store-behind-flag.md
Normal file
3
changelog/bastin_put-lc-store-behind-flag.md
Normal file
@@ -0,0 +1,3 @@
|
||||
### Changed
|
||||
|
||||
- Put the initiation of LC Store behind the `enable-light-client` flag.
|
||||
Reference in New Issue
Block a user