From 9ab46d601bbcbd02d4515edcd9450b7f6fef5d84 Mon Sep 17 00:00:00 2001 From: "Masih H. Derkani" Date: Fri, 8 Nov 2024 11:46:01 +0700 Subject: [PATCH] =?UTF-8?q?Rename=20OhShitStore=E2=84=A2=20to=20`powerstor?= =?UTF-8?q?e`=20(#740)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cosmetic renaming of the powerstore. --- f3.go | 6 +++--- internal/powerstore/powerstore.go | 10 +++++----- internal/powerstore/powerstore_test.go | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/f3.go b/f3.go index db6cec8c..6854af4d 100644 --- a/f3.go +++ b/f3.go @@ -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)) @@ -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) @@ -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) diff --git a/internal/powerstore/powerstore.go b/internal/powerstore/powerstore.go index 22e7c325..a9bc244d 100644 --- a/internal/powerstore/powerstore.go +++ b/internal/powerstore/powerstore.go @@ -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) @@ -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), @@ -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 @@ -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 diff --git a/internal/powerstore/powerstore_test.go b/internal/powerstore/powerstore_test.go index 0212786d..323825d9 100644 --- a/internal/powerstore/powerstore_test.go +++ b/internal/powerstore/powerstore_test.go @@ -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()