mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 15:37:56 -05:00
**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>
36 lines
1.0 KiB
Go
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
|
|
}
|