Skip to content

Commit

Permalink
Upgrade to the latest go-f3 and allow F3 chain exchange topics
Browse files Browse the repository at this point in the history
Upgrade to the latest `go-f3` and add the F3 chain exchange topics to
the allowed topic list for both static and dynamic manifests.

Fixes filecoin-project/go-f3#809
  • Loading branch information
masih committed Jan 22, 2025
1 parent 313cd2b commit 0d76bd3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ require (
github.com/filecoin-project/go-cbor-util v0.0.1
github.com/filecoin-project/go-commp-utils/v2 v2.1.0
github.com/filecoin-project/go-crypto v0.1.0
github.com/filecoin-project/go-f3 v0.7.3
github.com/filecoin-project/go-f3 v0.7.4-0.20250120154023-9c11ba345092
github.com/filecoin-project/go-fil-commcid v0.2.0
github.com/filecoin-project/go-hamt-ipld/v3 v3.4.0
github.com/filecoin-project/go-jsonrpc v0.7.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,8 @@ github.com/filecoin-project/go-commp-utils/v2 v2.1.0/go.mod h1:NbxJYlhxtWaNhlVCj
github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03/go.mod h1:+viYnvGtUTgJRdy6oaeF4MTFKAfatX071MPDPBL11EQ=
github.com/filecoin-project/go-crypto v0.1.0 h1:Pob2MphoipMbe/ksxZOMcQvmBHAd3sI/WEqcbpIsGI0=
github.com/filecoin-project/go-crypto v0.1.0/go.mod h1:K9UFXvvoyAVvB+0Le7oGlKiT9mgA5FHOJdYQXEE8IhI=
github.com/filecoin-project/go-f3 v0.7.3 h1:nwRYRKaJs7AV3di/OQyj6tABeixBeL06DkJeoQrr5+0=
github.com/filecoin-project/go-f3 v0.7.3/go.mod h1:wDo5mPi4KXVuA7kvwLpmfVVv2Aw2ZwZk3iqMWr5BOT0=
github.com/filecoin-project/go-f3 v0.7.4-0.20250120154023-9c11ba345092 h1:Yco5dqpG2cgjRGeL0i1T2sL3a3dyqM9ARLRd3zbi9x4=
github.com/filecoin-project/go-f3 v0.7.4-0.20250120154023-9c11ba345092/go.mod h1:zNFGuBM+fYuGXk2fpzl6wW4g2Gyrxgg6z2IVSoGt+60=
github.com/filecoin-project/go-fil-commcid v0.2.0 h1:B+5UX8XGgdg/XsdUpST4pEBviKkFOw+Fvl2bLhSKGpI=
github.com/filecoin-project/go-fil-commcid v0.2.0/go.mod h1:8yigf3JDIil+/WpqR5zoKyP0jBPCOGtEqq/K1CcMy9Q=
github.com/filecoin-project/go-fil-commp-hashhash v0.2.0 h1:HYIUugzjq78YvV3vC6rL95+SfC/aSTVSnZSZiDV5pCk=
Expand Down
14 changes: 9 additions & 5 deletions node/modules/lp2p/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,14 +369,18 @@ func GossipSub(in GossipIn) (service *pubsub.PubSub, err error) {

if in.F3Config != nil {
if in.F3Config.StaticManifest != nil {
f3TopicName := manifest.PubSubTopicFromNetworkName(in.F3Config.StaticManifest.NetworkName)
allowTopics = append(allowTopics, f3TopicName)
gpbftTopic := manifest.PubSubTopicFromNetworkName(in.F3Config.StaticManifest.NetworkName)
chainexTopic := manifest.ChainExchangeTopicFromNetworkName(in.F3Config.StaticManifest.NetworkName)
allowTopics = append(allowTopics, gpbftTopic, chainexTopic)
}
if in.F3Config.DynamicManifestProvider != "" {
f3BaseTopicName := manifest.PubSubTopicFromNetworkName(in.F3Config.BaseNetworkName)
gpbftTopicPrefix := manifest.PubSubTopicFromNetworkName(in.F3Config.BaseNetworkName)
chainexTopicPrefix := manifest.ChainExchangeTopicFromNetworkName(in.F3Config.BaseNetworkName)
allowTopics = append(allowTopics, manifest.ManifestPubSubTopicName)
for i := 0; i < lf3.MaxDynamicManifestChangesAllowed; i++ {
allowTopics = append(allowTopics, fmt.Sprintf("%s/%d", f3BaseTopicName, i))
for i := range lf3.MaxDynamicManifestChangesAllowed {
gpbftTopic := fmt.Sprintf("%s/%d", gpbftTopicPrefix, i)
chainexTopic := fmt.Sprintf("%s/%d", chainexTopicPrefix, i)
allowTopics = append(allowTopics, gpbftTopic, chainexTopic)
}
}
}
Expand Down

0 comments on commit 0d76bd3

Please sign in to comment.