mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
do not store it (#13637)
This commit is contained in:
parent
e6a6365bdd
commit
f795e09ecf
@ -199,6 +199,7 @@ func NewService(ctx context.Context, opts ...Option) (*Service, error) {
|
|||||||
// Start a blockchain service's main event loop.
|
// Start a blockchain service's main event loop.
|
||||||
func (s *Service) Start() {
|
func (s *Service) Start() {
|
||||||
saved := s.cfg.FinalizedStateAtStartUp
|
saved := s.cfg.FinalizedStateAtStartUp
|
||||||
|
defer s.removeStartupState()
|
||||||
|
|
||||||
if saved != nil && !saved.IsNil() {
|
if saved != nil && !saved.IsNil() {
|
||||||
if err := s.StartFromSavedState(saved); err != nil {
|
if err := s.StartFromSavedState(saved); err != nil {
|
||||||
@ -550,6 +551,10 @@ func (s *Service) hasBlock(ctx context.Context, root [32]byte) bool {
|
|||||||
return s.cfg.BeaconDB.HasBlock(ctx, root)
|
return s.cfg.BeaconDB.HasBlock(ctx, root)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Service) removeStartupState() {
|
||||||
|
s.cfg.FinalizedStateAtStartUp = nil
|
||||||
|
}
|
||||||
|
|
||||||
func spawnCountdownIfPreGenesis(ctx context.Context, genesisTime time.Time, db db.HeadAccessDatabase) {
|
func spawnCountdownIfPreGenesis(ctx context.Context, genesisTime time.Time, db db.HeadAccessDatabase) {
|
||||||
currentTime := prysmTime.Now()
|
currentTime := prysmTime.Now()
|
||||||
if currentTime.After(genesisTime) {
|
if currentTime.After(genesisTime) {
|
||||||
|
@ -583,6 +583,9 @@ func (s *Service) run(done <-chan struct{}) {
|
|||||||
s.runError = nil
|
s.runError = nil
|
||||||
|
|
||||||
s.initPOWService()
|
s.initPOWService()
|
||||||
|
// Do not keep storing the finalized state as it is
|
||||||
|
// no longer of use.
|
||||||
|
s.removeStartupState()
|
||||||
|
|
||||||
chainstartTicker := time.NewTicker(logPeriod)
|
chainstartTicker := time.NewTicker(logPeriod)
|
||||||
defer chainstartTicker.Stop()
|
defer chainstartTicker.Stop()
|
||||||
@ -910,3 +913,7 @@ func (s *Service) migrateOldDepositTree(eth1DataInDB *ethpb.ETH1ChainData) error
|
|||||||
s.depositTrie = newDepositTrie
|
s.depositTrie = newDepositTrie
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Service) removeStartupState() {
|
||||||
|
s.cfg.finalizedStateAtStartup = nil
|
||||||
|
}
|
||||||
|
@ -326,6 +326,10 @@ func New(cliCtx *cli.Context, cancel context.CancelFunc, opts ...Option) (*Beaco
|
|||||||
}
|
}
|
||||||
beacon.collector = c
|
beacon.collector = c
|
||||||
|
|
||||||
|
// Do not store the finalized state as it has been provided to the respective services during
|
||||||
|
// their initialization.
|
||||||
|
beacon.finalizedStateAtStartUp = nil
|
||||||
|
|
||||||
return beacon, nil
|
return beacon, nil
|
||||||
}
|
}
|
||||||
func initSyncWaiter(ctx context.Context, complete chan struct{}) func() error {
|
func initSyncWaiter(ctx context.Context, complete chan struct{}) func() error {
|
||||||
|
Loading…
Reference in New Issue
Block a user