Skip to content

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

@hopeyen

Description

@hopeyen

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" }

Metadata

Metadata

Assignees

No one assigned

    Labels

    meta:triagedThis issue has been triaged (has a good description, as well as labels for priority, size and type)p3Low prioritysize:smallSmalltype:refactorChanges not visible to users

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions