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

fix: market: Infer index provider topic from network name by default #8526

Merged
merged 1 commit into from
Apr 22, 2022

Conversation

masih
Copy link
Member

@masih masih commented Apr 21, 2022

Related Issues

Fixes #8510

Proposed Changes

Instead of a fixed default, the changes here infer the allowed indexer
topic name from network name automatically if the topic configuration is
left empty.

Additional Info

Index provider integration uses a gossipsub topic to announce changes to
the advertised content. The topic name was fixed to the default topic
which is /indexer/ingest/mainnet.

In the case of lotus, the gossipsub validators enforce a list of topics
the instance is permitted to join by setting subscription filter option
when PubSub instance is constructed via DI.

Having the fixed topic name meant that any SP starting up a node on a
network other than mainnet would have to override the default config
to avoid the node crashing when index provider is enabled.

Checklist

Before you mark the PR ready for review, please make sure that:

  • All commits have a clear commit message.
  • The PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, INTERFACE BREAKING CHANGE, CONSENSUS BREAKING, build, chore, ci, docs,perf, refactor, revert, style, test
    • area: api, chain, state, vm, data transfer, market, mempool, message, block production, multisig, networking, paychan, proving, sealing, wallet, deps
  • This PR has tests for new functionality or change in behaviour
  • If new user-facing features are introduced, clear usage guidelines and / or documentation updates should be included in https://lotus.filecoin.io or Discussion Tutorials.
  • CI is green

@masih masih changed the title Infer index provider topic from network name by default fix: market: Infer index provider topic from network name by default Apr 21, 2022
@codecov
Copy link

codecov bot commented Apr 21, 2022

Codecov Report

Merging #8526 (f273a44) into master (48ffb15) will decrease coverage by 0.10%.
The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8526      +/-   ##
==========================================
- Coverage   40.86%   40.75%   -0.11%     
==========================================
  Files         686      686              
  Lines       75582    75587       +5     
==========================================
- Hits        30883    30804      -79     
- Misses      39374    39451      +77     
- Partials     5325     5332       +7     
Impacted Files Coverage Δ
node/modules/storageminer_idxprov.go 82.35% <91.66%> (+6.26%) ⬆️
node/config/def.go 97.75% <100.00%> (ø)
itests/kit/blockminer.go 69.56% <0.00%> (-20.11%) ⬇️
chain/events/message_cache.go 87.50% <0.00%> (-12.50%) ⬇️
miner/miner.go 51.47% <0.00%> (-7.55%) ⬇️
extern/sector-storage/worker_tracked.go 79.82% <0.00%> (-7.02%) ⬇️
chain/events/observer.go 73.79% <0.00%> (-6.21%) ⬇️
storage/wdpost_sched.go 75.49% <0.00%> (-5.89%) ⬇️
chain/exchange/peer_tracker.go 66.66% <0.00%> (-4.31%) ⬇️
node/impl/full/mpool.go 46.95% <0.00%> (-1.74%) ⬇️
... and 18 more

@masih masih force-pushed the idxprov-topic-by-netname branch 3 times, most recently from 34eb836 to fbb57e8 Compare April 21, 2022 12:57
Index provider integration uses a gossipsub topic to announce changes to
the advertised content. The topic name was fixed to the default topic
which is `/indexer/ingest/mainnet`.

In the case of lotus, the gossipsub validators enforce a list of topics
the instance is permitted to join by setting subscription filter option
when `PubSub` instance is constructed via DI.

Having the fixed topic name meant that any SP starting up a node on a
network other than `mainnet` would have to override the default config
to avoid the node crashing when index provider is enabled.

Instead of a fixed default, the changes here infer the allowed indexer
topic name from network name automatically if the topic configuration is
left empty.

Fixes filecoin-project#8510
@masih masih marked this pull request as ready for review April 21, 2022 13:16
@masih masih requested a review from a team as a code owner April 21, 2022 13:16
@masih
Copy link
Member Author

masih commented Apr 21, 2022

@jennijuju there seems to be some flaky tests that I don't believe are failing because of the changes in this PR. I can't re-trigger the tests due to permissions.
Otherwise, this PR is ready for review 🙇

@jennijuju
Copy link
Member

jennijuju commented Apr 21, 2022

tested in devnet and works

Copy link
Contributor

@ZenGround0 ZenGround0 left a comment

Choose a reason for hiding this comment

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

I don't know this code well so maybe wait on another review to be sure, but LGTM

@jennijuju jennijuju mentioned this pull request Apr 22, 2022
5 tasks
@jennijuju jennijuju merged commit 2be9452 into filecoin-project:master Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pick the default indexer ingest topic based on network name
3 participants