The seenMessage cache prevents us from processing and re-broadcasting a pubsub message that we have already seen within the seenMsgTTL (default 2 minutes). Accessing an existing message, however, does not update the timestamp associated with the entry in the cache.
This means that if a single pubsub message is being received frequently and consistently, we'll re-broadcast it every seenMsgTTL, rather than never re-broadcasting it as is the desired behavior. If every time we received a duplicate pubsub message we pushed back the expiration time in the cache, that would give us the desired behavior of never re-broadcasting a message that we have already seen within the last seenMsgTTL seconds.
The seenMessage cache prevents us from processing and re-broadcasting a pubsub message that we have already seen within the
seenMsgTTL(default 2 minutes). Accessing an existing message, however, does not update the timestamp associated with the entry in the cache.This means that if a single pubsub message is being received frequently and consistently, we'll re-broadcast it every
seenMsgTTL, rather than never re-broadcasting it as is the desired behavior. If every time we received a duplicate pubsub message we pushed back the expiration time in the cache, that would give us the desired behavior of never re-broadcasting a message that we have already seen within the lastseenMsgTTLseconds.