waku-org/nwaku

chore: make negentropy to give better feedback when failures happen

Opened this issue · 1 comments

Description

While dogdoofing waku sync in status.staging @SionoiS noticed that there are many negentropy failures but we don't know the actual reason why that happened.

  • failed to insert message
  • erase failed

The goal of this is to enhance negentropy's feedback in case a wrong condition happens.

For example, we see the following logs but the detail given by negentropy is not verbose enough:

error "failed to insert message ", msg_hash = msgHash.to0xHex(), error = $error

if self.storage.insert(msg.timestamp, msgHash).isErr():

error "storage erase failed",

AFAIK Inserting twice the same element would return an error, it is expected. Same for trying to erase twice the same element.

The problem is we don't know which error it is. I feel like making insert and erase Idempotent would be best.