mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 23:48:06 -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
|
lastOptimisticUpdate interfaces.LightClientOptimisticUpdate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func NewLightClientStore() *Store {
|
||||||
|
return &Store{}
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Store) SetLastFinalityUpdate(update interfaces.LightClientFinalityUpdate) {
|
func (s *Store) SetLastFinalityUpdate(update interfaces.LightClientFinalityUpdate) {
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
defer s.mu.Unlock()
|
defer s.mu.Unlock()
|
||||||
|
|||||||
@@ -167,7 +167,6 @@ func New(cliCtx *cli.Context, cancel context.CancelFunc, opts ...Option) (*Beaco
|
|||||||
syncChecker: &initialsync.SyncChecker{},
|
syncChecker: &initialsync.SyncChecker{},
|
||||||
custodyInfo: &peerdas.CustodyInfo{},
|
custodyInfo: &peerdas.CustodyInfo{},
|
||||||
slasherEnabled: cliCtx.Bool(flags.SlasherFlag.Name),
|
slasherEnabled: cliCtx.Bool(flags.SlasherFlag.Name),
|
||||||
lcStore: &lightclient.Store{},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
@@ -235,6 +234,10 @@ func New(cliCtx *cli.Context, cancel context.CancelFunc, opts ...Option) (*Beaco
|
|||||||
// their initialization.
|
// their initialization.
|
||||||
beacon.finalizedStateAtStartUp = nil
|
beacon.finalizedStateAtStartUp = nil
|
||||||
|
|
||||||
|
if features.Get().EnableLightClient {
|
||||||
|
beacon.lcStore = lightclient.NewLightClientStore()
|
||||||
|
}
|
||||||
|
|
||||||
return beacon, nil
|
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