mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Backfill data columns (#15580)
**What type of PR is this?** Feature **What does this PR do? Why is it needed?** Adds data column support to backfill. **Acknowledgements** - [x] I have read [CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md). - [x] I have included a uniquely named [changelog fragment file](https://github.com/prysmaticlabs/prysm/blob/develop/CONTRIBUTING.md#maintaining-changelogmd). - [x] I have added a description to this PR with sufficient context for reviewers to understand this PR. --------- Co-authored-by: Kasey <kasey@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Preston Van Loon <preston@pvl.dev>
This commit is contained in:
@@ -53,6 +53,7 @@ type Config struct {
|
||||
StateNotifier statefeed.Notifier
|
||||
BlockNotifier blockfeed.Notifier
|
||||
ClockWaiter startup.ClockWaiter
|
||||
SyncNeedsWaiter func() (das.SyncNeeds, error)
|
||||
InitialSyncComplete chan struct{}
|
||||
BlobStorage *filesystem.BlobStorage
|
||||
DataColumnStorage *filesystem.DataColumnStorage
|
||||
@@ -73,6 +74,7 @@ type Service struct {
|
||||
newDataColumnsVerifier verification.NewDataColumnsVerifier
|
||||
ctxMap sync.ContextByteVersions
|
||||
genesisTime time.Time
|
||||
blobRetentionChecker das.RetentionChecker
|
||||
}
|
||||
|
||||
// Option is a functional option for the initial-sync Service.
|
||||
@@ -138,6 +140,20 @@ func (s *Service) Start() {
|
||||
return
|
||||
}
|
||||
s.clock = clock
|
||||
|
||||
if s.blobRetentionChecker == nil {
|
||||
if s.cfg.SyncNeedsWaiter == nil {
|
||||
log.Error("Initial-sync service missing sync needs waiter; cannot start")
|
||||
return
|
||||
}
|
||||
syncNeeds, err := s.cfg.SyncNeedsWaiter()
|
||||
if err != nil {
|
||||
log.WithError(err).Error("Initial-sync failed to receive sync needs")
|
||||
return
|
||||
}
|
||||
s.blobRetentionChecker = syncNeeds.BlobRetentionChecker()
|
||||
}
|
||||
|
||||
log.Info("Received state initialized event")
|
||||
ctxMap, err := sync.ContextByteVersionsForValRoot(clock.GenesisValidatorsRoot())
|
||||
if err != nil {
|
||||
@@ -382,7 +398,7 @@ func (s *Service) fetchOriginBlobSidecars(pids []peer.ID, rob blocks.ROBlock) er
|
||||
continue
|
||||
}
|
||||
bv := verification.NewBlobBatchVerifier(s.newBlobVerifier, verification.InitsyncBlobSidecarRequirements)
|
||||
avs := das.NewLazilyPersistentStore(s.cfg.BlobStorage, bv)
|
||||
avs := das.NewLazilyPersistentStore(s.cfg.BlobStorage, bv, s.blobRetentionChecker)
|
||||
current := s.clock.CurrentSlot()
|
||||
if err := avs.Persist(current, blobSidecars...); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user