Skip to content

Commit

Permalink
resolve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hanabi1224 committed Oct 24, 2024
1 parent 1c2fe6e commit a8e7022
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
20 changes: 6 additions & 14 deletions f3.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (
"github.com/filecoin-project/go-f3/internal/writeaheadlog"
"github.com/filecoin-project/go-f3/manifest"

"github.com/ipfs/go-cid"
"github.com/ipfs/go-datastore"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p/core/host"
Expand Down Expand Up @@ -186,20 +185,13 @@ func (m *F3) Start(startCtx context.Context) (_err error) {
}
hasPendingManifest = false
}
{
var maybeNetworkName gpbft.NetworkName
var bootstrapEpoch int64
var finality int64
var initialPowerTable *cid.Cid
if m := m.manifest.Load(); m != nil {
maybeNetworkName = m.NetworkName
bootstrapEpoch = m.BootstrapEpoch
finality = m.EC.Finality
initialPowerTable = &m.InitialPowerTable
}

if m := m.manifest.Load(); m != nil {
log.Infow("F3 is starting", "initialDelay", initialDelay, "hasPendingManifest", hasPendingManifest,
"NetworkName", maybeNetworkName, "bootstrapEpoch", bootstrapEpoch, "finality", finality,
"initialPowerTable", initialPowerTable)
"NetworkName", m.NetworkName, "bootstrapEpoch", m.BootstrapEpoch, "finality", m.EC.Finality,
"initialPowerTable", m.InitialPowerTable, "committeeLookback", m.CommitteeLookback)
} else {
log.Infow("F3 is starting", "initialDelay", initialDelay, "hasPendingManifest", hasPendingManifest)
}

m.errgrp.Go(func() (_err error) {
Expand Down
3 changes: 3 additions & 0 deletions store.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ func loadInitialPowerTable(ctx context.Context, ec ec.Backend, m *manifest.Manif
} else {
if ptCid, err := certs.MakePowerTableCID(pt); err == nil {
log.Infof("loaded initial power table at epoch %d: %s", epoch, ptCid)
if m.InitialPowerTable.Defined() && m.InitialPowerTable != ptCid {
log.Warnf("initial power table mismatch, loaded from EC: %s, from manifest: %s", ptCid, m.InitialPowerTable)
}
}
return pt, nil
}
Expand Down

0 comments on commit a8e7022

Please sign in to comment.