Skip to content

fix: stop bridging content to nodes outside their radius#1792

Merged
KolbyML merged 1 commit into
ethereum:masterfrom
KolbyML:fix-gossipping-to-nodes-that-won't-accept-content
Apr 29, 2025
Merged

fix: stop bridging content to nodes outside their radius#1792
KolbyML merged 1 commit into
ethereum:masterfrom
KolbyML:fix-gossipping-to-nodes-that-won't-accept-content

Conversation

@KolbyML
Copy link
Copy Markdown
Member

@KolbyML KolbyML commented Apr 29, 2025

What was wrong?

After I implemented AcceptCodes I found we had a bug in our Bridge. We should never offer content to Nodes if we know it outside of their radius, as this is just wasted resources, which for a bridge resources are limited. #1773

I was just testing the bridge and I noticed it again.

2025-04-29T05:35:17.146519Z  INFO portal_bridge::bridge::offer_report: Successfully offered to 0/8 peers. Content key: 0x00b60bfc414b961eb745736cd6ee0f8284b0c0c0549bb4ba9c7e68b6bda346f29b. Decline reasons: AlreadyStored:[Trin] | Declined:[Ultralight,Ultralight] | NotWithinRadius:[Unknown(None),Trin,Trin,Unknown(None),Unknown(None)]. Failed: 0.

How was it fixed?

By adding a filter to only include nodes with a weight over 0. choose_multiple_weighted() will include peers with 0 weight, if there are less then amount of nodes with a weight of over 0. We don't want to gossip to though peers though as we already know they won't accept the content. We can instead offer other content to other nodes which will accept the content.

@KolbyML KolbyML added the portal-bridge Portal bridge label Apr 29, 2025
@KolbyML KolbyML requested a review from morph-dev April 29, 2025 06:05
@KolbyML KolbyML self-assigned this Apr 29, 2025
Copy link
Copy Markdown
Collaborator

@morph-dev morph-dev left a comment

Choose a reason for hiding this comment

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

Good find! 🚢

@KolbyML KolbyML merged commit a551b80 into ethereum:master Apr 29, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

portal-bridge Portal bridge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants