diff --git a/waku/waku_archive/archive.nim b/waku/waku_archive/archive.nim index b6104f4e4..7b3d05fb2 100644 --- a/waku/waku_archive/archive.nim +++ b/waku/waku_archive/archive.nim @@ -88,6 +88,11 @@ proc handleMessage*( let msgHash = computeMessageHash(pubsubTopic, msg) msgHashHex = msgHash.to0xHex() + msgTimestamp = + if msg.timestamp > 0: + msg.timestamp + else: + getNanosecondTime(getTime().toUnixFloat()) self.validator(msg).isOkOr: error "failed validator message", @@ -96,7 +101,6 @@ proc handleMessage*( contentTopic = msg.contentTopic, msgTimestamp = msg.timestamp, usedTimestamp = msgTimestamp, - digest = msgDigestHex, error = $error waku_archive_errors.inc(labelValues = [error]) return @@ -118,8 +122,7 @@ proc handleMessage*( pubsubTopic = pubsubTopic, contentTopic = msg.contentTopic, msgTimestamp = msg.timestamp, - usedTimestamp = msgTimestamp, - digest = msgDigestHex + usedTimestamp = msgTimestamp let insertDuration = getTime().toUnixFloat() - insertStartTime waku_archive_insert_duration_seconds.observe(insertDuration) diff --git a/waku/waku_archive_legacy/archive.nim b/waku/waku_archive_legacy/archive.nim index e95f7b904..f052aaf00 100644 --- a/waku/waku_archive_legacy/archive.nim +++ b/waku/waku_archive_legacy/archive.nim @@ -82,6 +82,13 @@ proc handleMessage*( let msgHash = computeMessageHash(pubsubTopic, msg) msgHashHex = msgHash.to0xHex() + msgTimestamp = + if msg.timestamp > 0: + msg.timestamp + else: + getNanosecondTime(getTime().toUnixFloat()) + msgDigest = computeDigest(msg) + msgDigestHex = msgDigest.data.to0xHex() self.validator(msg).isOkOr: error "failed validator message", @@ -95,15 +102,6 @@ proc handleMessage*( waku_legacy_archive_errors.inc(labelValues = [error]) return - let - msgDigest = computeDigest(msg) - msgDigestHex = msgDigest.data.to0xHex() - msgTimestamp = - if msg.timestamp > 0: - msg.timestamp - else: - getNanosecondTime(getTime().toUnixFloat()) - trace "handling message", msg_hash = msgHashHex, pubsubTopic = pubsubTopic,