Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add more logs on manifest and initial power table #714

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions f3.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@
}
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)

Check warning on line 194 in f3.go

View check run for this annotation

Codecov / codecov/patch

f3.go#L194

Added line #L194 was not covered by tests
}

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 @@
"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 @@
} 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 {
Stebalien marked this conversation as resolved.
Show resolved Hide resolved
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)
}

Check warning on line 53 in store.go

View check run for this annotation

Codecov / codecov/patch

store.go#L52-L53

Added lines #L52 - L53 were not covered by tests
}
return pt, nil
}
if !m.InitialPowerTable.Defined() {
Expand Down
Loading