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: f3: Upgrade to latest go-f3 v0.0.4 #12237

Merged
merged 1 commit into from
Jul 15, 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- https://github.com/filecoin-project/lotus/pull/12203: Fix slice modification bug in ETH Tx Events Bloom Filter
- https://github.com/filecoin-project/lotus/pull/12221: Fix a nil reference panic in the ETH Trace API
- https://github.com/filecoin-project/lotus/pull/12112: Moved consts from build/ to build/buildconstants/ for ligher curio deps.
- https://github.com/filecoin-project/lotus/pull/12237: Upgrade to go-f3 `v0.0.4`.

## ☢️ Upgrade Warnings ☢️

Expand Down
6 changes: 6 additions & 0 deletions chain/lf3/ec.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,18 @@ type ecWrapper struct {
StateManager *stmgr.StateManager
}

var _ ec.TipSet = (*f3TipSet)(nil)

type f3TipSet types.TipSet

func (ts *f3TipSet) cast() *types.TipSet {
return (*types.TipSet)(ts)
}

func (ts *f3TipSet) String() string {
return ts.cast().String()
}

func (ts *f3TipSet) Key() gpbft.TipSetKey {
return ts.cast().Key().Bytes()
}
Expand Down
13 changes: 3 additions & 10 deletions chain/lf3/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,23 @@ import (

"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/build/buildconstants"
"github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/store"
"github.com/filecoin-project/lotus/node/modules/dtypes"
)

func NewManifestProvider(nn dtypes.NetworkName, cs *store.ChainStore, sm *stmgr.StateManager, ps *pubsub.PubSub) manifest.ManifestProvider {
func NewManifestProvider(nn dtypes.NetworkName, ps *pubsub.PubSub) manifest.ManifestProvider {
m := manifest.LocalDevnetManifest()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@masih both MinimumPollInterval and MaximumPollInterval are based on DefaultEcConfig.ECPeriod in go-f3 but we don't reset them here. Should we? I believe they come out the same here as long as BlockDelaySecs is 30. How much do these matter to align to epoch length?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe they come out the same here as long as BlockDelaySecs is 30

I think regardless of what BlockDelaySecs is set to cert exchange min max would be 30s and 2m respectively, because their value is instantiated via DefaultCxConfig var using DefaultEcConfig.ECPeriod.

For example, this passes for me.

import (
	"testing"
	"time"

	"github.com/filecoin-project/go-f3/manifest"
)

func TestMinMaxPollIntervalIsNotOverridden(t *testing.T) {
	m := manifest.LocalDevnetManifest()
	m.ECPeriod = 1
	if m.CxConfig.MinimumPollInterval != 30*time.Second {
		t.Fatalf("min ain't it")
	}
	if m.CxConfig.MaximumPollInterval != 4*30*time.Second {
		t.Fatalf("max ain't it")
	}
}

How much do these matter to align to epoch length?

Cert exchange internally optimises for the right poll time. As long as min and max are a wide enough interval of time, and min is not less than an epoch we should be good.

@Stebalien does that sound right?

m.NetworkName = gpbft.NetworkName(nn)
m.ECDelayMultiplier = 2.
m.ECPeriod = time.Duration(build.BlockDelaySecs) * time.Second
m.BootstrapEpoch = int64(buildconstants.F3BootstrapEpoch)
m.ECFinality = int64(build.Finality)
m.CommiteeLookback = 5

ec := &ecWrapper{
ChainStore: cs,
StateManager: sm,
}
m.CommitteeLookback = 5

switch manifestServerID, err := peer.Decode(buildconstants.ManifestServerID); {
case err != nil:
log.Warnw("Cannot decode F3 manifest sever identity; falling back on static manifest provider", "err", err)
return manifest.NewStaticManifestProvider(m)
default:
return manifest.NewDynamicManifestProvider(m, ps, ec, manifestServerID)
return manifest.NewDynamicManifestProvider(m, ps, manifestServerID)
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ require (
github.com/filecoin-project/go-commp-utils v0.1.3
github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082a837
github.com/filecoin-project/go-crypto v0.0.1
github.com/filecoin-project/go-f3 v0.0.3
github.com/filecoin-project/go-f3 v0.0.4
github.com/filecoin-project/go-fil-commcid v0.1.0
github.com/filecoin-project/go-hamt-ipld/v3 v3.1.0
github.com/filecoin-project/go-jsonrpc v0.3.2
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ github.com/filecoin-project/go-commp-utils/nonffi v0.0.0-20220905160352-62059082
github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ=
github.com/filecoin-project/go-crypto v0.0.1 h1:AcvpSGGCgjaY8y1az6AMfKQWreF/pWO2JJGLl6gCq6o=
github.com/filecoin-project/go-crypto v0.0.1/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ=
github.com/filecoin-project/go-f3 v0.0.3 h1:12jodQO47QNL0xnb2O1kbKIq0R+/MYWPK05Lb6MrHmU=
github.com/filecoin-project/go-f3 v0.0.3/go.mod h1:QgyFNiqCoQQFMo+w5o9tC/HqS9UwGZV4B1ssfAdGqtY=
github.com/filecoin-project/go-f3 v0.0.4 h1:ZzScl5S4b/JxD/g4z5pyyly7jZdz8HTlvR1j+iuYPAg=
github.com/filecoin-project/go-f3 v0.0.4/go.mod h1:pkt1YT85Gyzjdyma9M+JkTtneWncxEhuw68ABVn95S4=
github.com/filecoin-project/go-fil-commcid v0.0.0-20201016201715-d41df56b4f6a/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ=
github.com/filecoin-project/go-fil-commcid v0.1.0 h1:3R4ds1A9r6cr8mvZBfMYxTS88OqLYEo6roi+GiIeOh8=
github.com/filecoin-project/go-fil-commcid v0.1.0/go.mod h1:Eaox7Hvus1JgPrL5+M3+h7aSPHc0cVqpSxA+TxIEpZQ=
Expand Down