deploy: 95d2e8bf71fde85fc5e8c77aa1b6bb2e88913641

This commit is contained in:
jm-clius 2022-01-17 19:02:48 +00:00
parent 5632454f4f
commit 0c411dec21
3 changed files with 10 additions and 6 deletions

View File

@ -17,6 +17,7 @@ which is a sequence of string.
- Increased maximum length for reading from a libp2p input stream to allow largest possible protocol messages, including `HistoryResponse` messages at max size.
- Significantly improved store node query performance
- Added GossipSub `MessageIdProvider` for `11/WAKU2-RELAY` messages.
- Store: timestamps of message reception, used for indexing, now have consistent millisecond resolution.
## 2021-11-05 v0.6

View File

@ -2,7 +2,7 @@
# libtool - Provide generalized library-building support services.
# Generated automatically by config.status (libbacktrace) version-unused
# Libtool was configured on host fv-az272-614:
# Libtool was configured on host fv-az199-574:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,

View File

@ -7,7 +7,7 @@
# Group by std, external then internal imports
import
# std imports
std/[tables, times, sequtils, algorithm, options],
std/[tables, times, sequtils, algorithm, options, math],
# external imports
bearssl,
chronicles,
@ -55,15 +55,18 @@ const
# TODO Move serialization function to separate file, too noisy
# TODO Move pagination to separate file, self-contained logic
proc computeIndex*(msg: WakuMessage): Index =
## Takes a WakuMessage and returns its Index
proc computeIndex*(msg: WakuMessage, receivedTime = getTime().toUnixFloat()): Index =
## Takes a WakuMessage with received timestamp and returns its Index.
## Received timestamp will default to system time if not provided.
var ctx: sha256
ctx.init()
ctx.update(msg.contentTopic.toBytes()) # converts the contentTopic to bytes
ctx.update(msg.payload)
let digest = ctx.finish() # computes the hash
ctx.clear()
var index = Index(digest:digest, receiverTime: epochTime(), senderTime: msg.timestamp)
let receiverTime = receivedTime.round(3) # Ensure timestamp has (only) millisecond resolution
var index = Index(digest:digest, receiverTime: receiverTime, senderTime: msg.timestamp)
return index
proc encode*(index: Index): ProtoBuffer =
@ -466,7 +469,7 @@ proc init*(ws: WakuStore, capacity = DefaultStoreCapacity) =
proc onData(receiverTime: float64, msg: WakuMessage, pubsubTopic: string) =
# TODO index should not be recalculated
ws.messages.add(IndexedWakuMessage(msg: msg, index: msg.computeIndex(), pubsubTopic: pubsubTopic))
ws.messages.add(IndexedWakuMessage(msg: msg, index: msg.computeIndex(receiverTime), pubsubTopic: pubsubTopic))
info "attempting to load messages from persistent storage"