Skip to content

Commit

Permalink
Rename OhShitStore™ to powerstore (#740)
Browse files Browse the repository at this point in the history
Cosmetic renaming of the powerstore.
  • Loading branch information
masih authored Nov 8, 2024
1 parent 8497653 commit 9ab46d6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions f3.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (m *F3) Stop(stopCtx context.Context) (_err error) {
func (s *f3State) stop(ctx context.Context) (err error) {
log.Info("stopping F3 internals")
if serr := s.ps.Stop(ctx); serr != nil {
err = multierr.Append(err, fmt.Errorf("failed to stop ohshitstore: %w", serr))
err = multierr.Append(err, fmt.Errorf("failed to stop powerstore: %w", serr))
}
if serr := s.runner.Stop(ctx); serr != nil {
err = multierr.Append(err, fmt.Errorf("failed to stop gpbft: %w", serr))
Expand All @@ -275,7 +275,7 @@ func (s *f3State) stop(ctx context.Context) (err error) {

func (s *f3State) start(ctx context.Context) error {
if err := s.ps.Start(ctx); err != nil {
return fmt.Errorf("failed to start the ohshitstore: %w", err)
return fmt.Errorf("failed to start the powerstore: %w", err)
}
if err := s.certsub.Start(ctx); err != nil {
return fmt.Errorf("failed to start the certificate subscriber: %w", err)
Expand Down Expand Up @@ -329,7 +329,7 @@ func (m *F3) startInternal(ctx context.Context) error {
return fmt.Errorf("failed to open certstore: %w", err)
}

pds := measurements.NewMeteredDatastore(meter, "f3_ohshitstore_datastore_", m.ds)
pds := measurements.NewMeteredDatastore(meter, "f3_powerstore_datastore_", m.ds)
state.ps, err = powerstore.New(ctx, mPowerEc, pds, state.cs, state.manifest)
if err != nil {
return fmt.Errorf("failed to construct the oshitstore: %w", err)
Expand Down
10 changes: 5 additions & 5 deletions internal/powerstore/powerstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"golang.org/x/sync/errgroup"
)

var log = logging.Logger("f3/ohshitstore")
var log = logging.Logger("f3/powerstore")

var _ ec.Backend = (*Store)(nil)

Expand Down Expand Up @@ -50,7 +50,7 @@ func New(ctx context.Context, ec ec.Backend, ds datastore.Datastore, cs *certsto
return &Store{
Backend: ec,

ds: namespace.Wrap(ds, datastore.NewKey("/ohshitstore")),
ds: namespace.Wrap(ds, datastore.NewKey("/powerstore")),
cs: cs,
manifest: manifest,
clock: clock.GetClock(ctx),
Expand Down Expand Up @@ -236,7 +236,7 @@ func (ps *Store) run(ctx context.Context) error {

if !initialized && f3Base > ecHead-stopThreshold {
initialized = true
log.Debugw("Clearing the OhShitStore on initialization because we're caught-up.")
log.Debugw("Clearing the powerstore on initialization because we're caught-up.")
ps.deleteAll(ctx)
ps.lastStoredEpoch = -1
ps.lastStoredPt = nil
Expand All @@ -249,14 +249,14 @@ func (ps *Store) run(ctx context.Context) error {
log.Debugw("skipping catch-up because we're within the start threshold")
continue
}
log.Warnf("Uh-oh, F3 has fallen behind EC by more than %d epochs! Engaging the OhShitStore™.", startThreshold)
log.Warnf("Uh-oh, F3 has fallen behind EC by more than %d epochs! Engaging the powerstore™.", startThreshold)
ps.lastStoredEpoch, ps.lastStoredPt, err = ps.mostRecentPowerTable(ctx)
if err != nil {
log.Errorw("failed to lookup most recent power table", "error", err)
continue
}
} else if f3Base > ecHead-stopThreshold {
log.Infow("Stopping the OhShitStore™ because we're caught-up")
log.Infow("Stopping the powerstore because we're caught-up")
ps.deleteAll(ctx)
ps.lastStoredEpoch = -1
ps.lastStoredPt = nil
Expand Down
2 changes: 1 addition & 1 deletion internal/powerstore/powerstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestPowerStore(t *testing.T) {
// Ok, now we're going to try falling behind and catching up a few times.

isDsEmpty := func() bool {
res, err := ds.Query(ctx, query.Query{Prefix: "/ohshitstore"})
res, err := ds.Query(ctx, query.Query{Prefix: "/powerstore"})
require.NoError(t, err)
defer res.Close()
_, ok := res.NextSync()
Expand Down

0 comments on commit 9ab46d6

Please sign in to comment.