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

Extend manifest with chain exchange configuration #810

Draft
wants to merge 3 commits into
base: masih/pubsub-chainexchange-listener
Choose a base branch
from

Conversation

masih
Copy link
Member

@masih masih commented Dec 20, 2024

Add chain exchange configuration to the manifest along with validation.

Part of #792

Review #808 First.

Implement chain exchange protocol over pubsub as a mechanism to
propagate `ECChain` across the network with reasonable spam protection.

To protect against spam the mechanism employs two separate caches for
chains that are generally discovered across the network and the ones
explicitly looked up or broadcasted by the local node. Both caches are
capped LRU, where the LRU recent-ness is used as a way to prioritise
chains we cache while keeping the total memory footprint fixed. This
approach is not the most memory efficient but is simpler to implement
as the LRU encapsulates a lot of the complexity.

The code has a lot of TODOs as places to improve or question to the
reviewer. To action most of the TODOs further refactoring across the
code is needed which is intended to be actioned in separate commits.

The code path introduced here is not integrated into F3 host; future PRs
will iteratively integrate the mechanism across F3 host and other
places.

Part of #792
Expand chain exchange to accept a listener which is notified whenever a
new chain is discovered. This mechanism is intended to be integrated
into F3 host pubsub, whereupon receiving a partial message the host
looks up its chain. When known, the chain is returned immediately.
Otherwise, the host would buffer the partial message and await
notification of its discovering from chain exchange.

Part of #792
@masih masih requested a review from Kubuxu December 20, 2024 13:44
@masih masih force-pushed the masih/chainexchange-mfst branch from 42ea078 to ab2aca1 Compare December 20, 2024 13:46
@masih masih changed the base branch from main to masih/pubsub-chainexchange-listener December 20, 2024 13:51
@masih masih removed the request for review from Kubuxu December 20, 2024 13:51
@masih masih force-pushed the masih/chainexchange-mfst branch from ab2aca1 to 3e33616 Compare December 20, 2024 13:56
@masih masih marked this pull request as draft December 20, 2024 14:03
Add chain exchange configuration to the manifest along with validation.

Part of #792
@masih masih force-pushed the masih/chainexchange-mfst branch from 3e33616 to 0c8b3e4 Compare December 20, 2024 14:04
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

Attention: Patch coverage is 26.92308% with 19 lines in your changes missing coverage. Please review.

Project coverage is 68.68%. Comparing base (7f984d8) to head (0c8b3e4).

Files with missing lines Patch % Lines
manifest/manifest.go 26.92% 16 Missing and 3 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                           Coverage Diff                           @@
##           masih/pubsub-chainexchange-listener     #810      +/-   ##
=======================================================================
+ Coverage                                68.45%   68.68%   +0.23%     
=======================================================================
  Files                                       81       81              
  Lines                                     8260     8286      +26     
=======================================================================
+ Hits                                      5654     5691      +37     
+ Misses                                    2117     2108       -9     
+ Partials                                   489      487       -2     
Files with missing lines Coverage Δ
manifest/manifest.go 50.00% <26.92%> (-3.75%) ⬇️

... and 5 files with indirect coverage changes

@masih masih force-pushed the masih/pubsub-chainexchange-listener branch 3 times, most recently from b200822 to 7c4840e Compare December 20, 2024 16:43
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.

1 participant