Skip to content

Commit

Permalink
chore: add more logs on manifest and initial power table (#714)
Browse files Browse the repository at this point in the history
* chore: add more logs on manifest and initial power table

* resolve comments
  • Loading branch information
hanabi1224 authored Oct 24, 2024
1 parent 25c3ade commit 5fc96af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
14 changes: 7 additions & 7 deletions f3.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ func (m *F3) Start(startCtx context.Context) (_err error) {
}
hasPendingManifest = false
}
{
var maybeNetworkName gpbft.NetworkName
if m := m.manifest.Load(); m != nil {
maybeNetworkName = m.NetworkName
}
log.Infow("F3 is starting", "initialDelay", initialDelay,
"hasPendingManifest", hasPendingManifest, "NetworkName", maybeNetworkName)

if m := m.manifest.Load(); m != nil {
log.Infow("F3 is starting", "initialDelay", initialDelay, "hasPendingManifest", hasPendingManifest,
"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
7 changes: 7 additions & 0 deletions store.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"

"github.com/filecoin-project/go-f3/certexchange"
"github.com/filecoin-project/go-f3/certs"
"github.com/filecoin-project/go-f3/certstore"
"github.com/filecoin-project/go-f3/ec"
"github.com/filecoin-project/go-f3/gpbft"
Expand Down Expand Up @@ -45,6 +46,12 @@ func loadInitialPowerTable(ctx context.Context, ec ec.Backend, m *manifest.Manif
} else if pt, err := ec.GetPowerTable(ctx, ts.Key()); err != nil {
log.Debugw("failed to load the bootstrap power table for F3 from state", "error", err)
} 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
}
if !m.InitialPowerTable.Defined() {
Expand Down

0 comments on commit 5fc96af

Please sign in to comment.