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

feat: message: chain nodes relay indexer pubsub messages. #8067

Closed
wants to merge 1 commit into from
Closed

feat: message: chain nodes relay indexer pubsub messages. #8067

wants to merge 1 commit into from

Conversation

gammazero
Copy link
Contributor

This PR makes lotus chain nodes relay indexer pubsub messages. Indexer pubsub messages are authenticated against the blockchain and are subject to rate-limiting.

Related

https://github.com/filecoin-project/lotus/tree/feat/cid-to-piece-idx

Proposed Changes

  • Ignore indexer messages that appear to come from the chain node
  • Authenticate message by checking that the sending peer appears in the miner info.
  • Rate limit overall messages
  • Rate limit repeated announcements
  • Ignore replayed messages
  • Record messages metrics and topic scoring.

@codecov
Copy link

codecov bot commented Feb 10, 2022

Codecov Report

Merging #8067 (a9954f9) into master (949a046) will decrease coverage by 0.55%.
The diff coverage is 42.50%.

❗ Current head a9954f9 differs from pull request most recent head 0da49b9. Consider uploading reports for the commit 0da49b9 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #8067      +/-   ##
==========================================
- Coverage   40.13%   39.58%   -0.56%     
==========================================
  Files         666      643      -23     
  Lines       72761    68595    -4166     
==========================================
- Hits        29203    27150    -2053     
+ Misses      38448    36786    -1662     
+ Partials     5110     4659     -451     
Impacted Files Coverage Δ
chain/sub/idxmsg/message.go 0.00% <0.00%> (ø)
metrics/metrics.go 100.00% <ø> (ø)
node/builder.go 75.75% <ø> (-0.72%) ⬇️
node/builder_chain.go 100.00% <ø> (ø)
chain/sub/incoming.go 44.03% <7.77%> (-13.77%) ⬇️
chain/sub/ratelimit/queue.go 63.88% <63.88%> (ø)
node/modules/services.go 59.12% <66.66%> (+1.14%) ⬆️
chain/sub/ratelimit/window.go 96.29% <96.29%> (ø)
build/params_shared_funcs.go 80.95% <100.00%> (+5.95%) ⬆️
node/modules/lp2p/pubsub.go 62.67% <100.00%> (+3.28%) ⬆️
... and 223 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 949a046...0da49b9. Read the comment docs.

chain/sub/incoming.go Outdated Show resolved Hide resolved
@jennijuju
Copy link
Member

Hi - are we certain this pr is targeted at v1.13.2? feel like should be a dev branch thing. (master?)

Also - please update the pr title according to instructions described in the pr template if aim to ship in master! thanks

@gammazero gammazero changed the title Chain nodes relay indexer pubsub messages. feat: chain nodes relay indexer pubsub messages. Feb 24, 2022
@gammazero gammazero changed the title feat: chain nodes relay indexer pubsub messages. feat: message: chain nodes relay indexer pubsub messages. Feb 24, 2022
This includes message validation and rate-limiting.
@travisperson
Copy link
Contributor

This was an temporary integration required till the feature landed in lotus during the v1.15.x releases

The same change set landed here: #7313

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.

4 participants