Bug #4838
closedPossible issues hashing the name URI, not the TLV
100%
Description
This is a low priority observation. When ProducerBase::updateSeqNo computes the new hash, it uses the name URI string.
https://github.com/named-data/PSync/blob/0cf4b600e91455ee07c38eb22876aa6b653bc14b/PSync/producer-base.cpp#L121
uint32_t newHash = murmurHash3(N_HASHCHECK, prefixWithSeq.toUri());
I don't think that the NDN packet spec guarantees that all implementations will create the same URI string for a Name. For example upper/lower case for hex digits, different ways of representing the name component type number, different choices of which values to percent escape, etc. Also, because of lots of conversion from binary to decimal/hexadecimal values and string concatenation, it can be less efficient to get the URI string than to encode the name TLV. (Of course, if consumers and producers have different implementations of toUri(), their hashes will not match.)
For these reasons, I humbly suggest that PSync should compute the hash from the Name TLV encoding, not from the URI string.
Updated by Junxiao Shi almost 3 years ago
Updated by Davide Pesavento almost 3 years ago
- Tracker changed from Task to Bug
- Status changed from New to Code review
- Target version set to v0.4.0
- Start date deleted (
02/06/2019)
Updated by Junxiao Shi almost 3 years ago
Please set assigned to me and close this issue.
Updated by Davide Pesavento almost 3 years ago
- Status changed from Code review to Closed
- Assignee set to Junxiao Shi
- % Done changed from 0 to 100