Skip to content

Commit

Permalink
rename db method
Browse files Browse the repository at this point in the history
  • Loading branch information
dB2510 committed Dec 18, 2024
1 parent ab79878 commit 20aafa7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion beacon-chain/db/iface/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type NoHeadAccessDatabase interface {
SaveLightClientBootstrap(ctx context.Context, blockRoot []byte, bootstrap interfaces.LightClientBootstrap) error

CleanUpDirtyStates(ctx context.Context, slotsPerArchivedPoint primitives.Slot) error
DeleteBeforeSlot(ctx context.Context, slot primitives.Slot) error
DeleteBlocksAndStatesBeforeSlot(ctx context.Context, slot primitives.Slot) error
}

// HeadAccessDatabase defines a struct with access to reading chain head data.
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/db/kv/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func (s *Store) DeleteBlock(ctx context.Context, root [32]byte) error {
}

// DeleteBeforeSlot performs deletes all blocks and states before the given slot.
func (s *Store) DeleteBeforeSlot(ctx context.Context, cutoffSlot primitives.Slot) error {
func (s *Store) DeleteBlocksAndStatesBeforeSlot(ctx context.Context, cutoffSlot primitives.Slot) error {
ctx, span := trace.StartSpan(ctx, "BeaconDB.DeleteBeforeEpoch")
defer span.End()

Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/db/kv/blocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func TestStore_DeleteBeforeSlot(t *testing.T) {
require.NoError(t, db.SaveStateSummaries(ctx, ss))

// Delete blocks of first epoch.
require.NoError(t, db.DeleteBeforeSlot(ctx, primitives.Slot(slotsPerEpoch)))
require.NoError(t, db.DeleteBlocksAndStatesBeforeSlot(ctx, primitives.Slot(slotsPerEpoch)))

// Check if we deleted the blocks successfully.
for i := 0; i < int(slotsPerEpoch); i++ {
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/db/pruner/pruner.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (p *Service) prune(slot primitives.Slot) error {
"pruneSlot": pruneSlot,
}).Info("Pruning chain data before")

if err := p.db.DeleteBeforeSlot(p.ctx, pruneSlot); err != nil {
if err := p.db.DeleteBlocksAndStatesBeforeSlot(p.ctx, pruneSlot); err != nil {
return errors.Wrap(err, "could not delete before slot")
}
// Update pruning checkpoint.
Expand Down

0 comments on commit 20aafa7

Please sign in to comment.