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

Investigate message seen cache handled by gowaku's libp2p #126

Open
hopeyen opened this issue Mar 10, 2023 · 1 comment
Open

Investigate message seen cache handled by gowaku's libp2p #126

hopeyen opened this issue Mar 10, 2023 · 1 comment
Assignees
Labels
meta:triaged This issue has been triaged (has a good description, as well as labels for priority, size and type) p3 Low priority size:small Small type:refactor Changes not visible to users

Comments

@hopeyen
Copy link
Collaborator

hopeyen commented Mar 10, 2023

Describe the bug

If a radio is connected to multiple peers and the peers are gossiping some of the same messages, the radio experiences multiple instances of those messages. Currently we handle duplicated messages by filtering based on the message id upon receiving Waku signal, but Waku node should have done this already, as explained by the team that

In libp2p there's a message seen cache that should avoid duplication for up to 2 minutes (the default value for seen_ttl

The team will expose this config, we can investigate further and hopefully remove the radio's filtering step.

Expected behavior
Waku config allows the radio to toggle message seen cache to prevent duplicated messages, and radio be alleviated from tracking seen messages.

Screenshots

  2023-03-09T14:18:41.336127Z  INFO graphcast_sdk::graphcast_agent::waku_handling: Message received! Message id: 0xd5fe3d17f3cbfdc631cd40d0597df1160f74d5b129ba5583040979d4fbf43efb
  2023-03-09T14:18:41.336193Z DEBUG graphcast_sdk::graphcast_agent::waku_handling: Message: GraphcastMessage { identifier: "QmTKXLEdMD6Vq7Nwxo8XAfnHpG6H1TzL1AGwiqLpoae3Pb", payload: Some(QueryAnalyticsMessage { identifier: "QmTKXLEdMD6Vq7Nwxo8XAfnHpG6H1TzL1AGwiqLpoae3Pb", ok_query_volume: 0, failed_query_volume: 0, query_duration: 0 }), nonce: 1678371520, network: "mainnet", block_number: 16791175, block_hash: "132e39f3adbd7a58b8fa5fee76a5cfe67b1cb823dc5e447a880e11e2fd9bffaf", signature: "4ef95ed3e69052898ca4df1e85cd80ca204ca92de7d120bf40be2fd18c46297332f7a66a2e4fd4b802dbc192f14b3db2b3bde60be91da019a8f4652b29afa3bf1b" }
... [Second instance of the message received within 1 second, when they shouldn't for the default of 2 minutes] ...
  2023-03-09T14:18:41.337359Z  INFO graphcast_sdk::graphcast_agent::waku_handling: Message received! Message id: 0xd5fe3d17f3cbfdc631cd40d0597df1160f74d5b129ba5583040979d4fbf43efb
  2023-03-09T14:18:41.337412Z DEBUG graphcast_sdk::graphcast_agent::waku_handling: Message: GraphcastMessage { [same msg content...], signature: "4ef95ed3e69052898ca4df1e85cd80ca204ca92de7d120bf40be2fd18c46297332f7a66a2e4fd4b802dbc192f14b3db2b3bde60be91da019a8f4652b29afa3bf1b" }
@hopeyen
Copy link
Collaborator Author

hopeyen commented Sep 18, 2023

Add pruning to old_message_ids kept by GraphcastAgent

@hopeyen hopeyen added type:refactor Changes not visible to users size:small Small p3 Low priority and removed meta:awaiting-triage labels Sep 18, 2023
@neriumrevolta neriumrevolta added the meta:triaged This issue has been triaged (has a good description, as well as labels for priority, size and type) label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta:triaged This issue has been triaged (has a good description, as well as labels for priority, size and type) p3 Low priority size:small Small type:refactor Changes not visible to users
Projects
None yet
Development

No branches or pull requests

2 participants