Files
prysm/cmd/beacon-chain/das/options.go
kasey 61de11e2c4 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>
2025-12-02 15:19:32 +00:00

36 lines
1.0 KiB
Go

package options
import (
"github.com/OffchainLabs/prysm/v7/beacon-chain/das"
"github.com/OffchainLabs/prysm/v7/beacon-chain/node"
"github.com/OffchainLabs/prysm/v7/cmd/beacon-chain/das/flags"
"github.com/OffchainLabs/prysm/v7/consensus-types/primitives"
"github.com/pkg/errors"
"github.com/urfave/cli/v2"
)
func BeaconNodeOptions(c *cli.Context) ([]node.Option, error) {
var oldestBackfillSlot *primitives.Slot
if c.IsSet(flags.BackfillOldestSlot.Name) {
uv := c.Uint64(flags.BackfillOldestSlot.Name)
sv := primitives.Slot(uv)
oldestBackfillSlot = &sv
}
blobRetentionEpochs := primitives.Epoch(c.Uint64(flags.BlobRetentionEpochFlag.Name))
opt := func(n *node.BeaconNode) error {
n.SyncNeedsWaiter = func() (das.SyncNeeds, error) {
clock, err := n.ClockWaiter.WaitForClock(c.Context)
if err != nil {
return das.SyncNeeds{}, errors.Wrap(err, "sync needs WaitForClock")
}
return das.NewSyncNeeds(
clock.CurrentSlot,
oldestBackfillSlot,
blobRetentionEpochs,
)
}
return nil
}
return []node.Option{opt}, nil
}