waku-org / research

Waku Protocol Research
MIT License
3 stars 0 forks source link

How long are nodes supposed to store non-ephemeral messages? #26

Closed s-tikhomirov closed 7 months ago

s-tikhomirov commented 9 months ago

Thinking about Store incentivization, I'm trying to understand first what is the ideal behavior we want to encourage. Am I correct that full nodes are supposed to store messages marked as non-ephemeral... forever? Or is there a deadline after which they can prune old messages and not be in violation of the protocol?

Regardless of whether messages are stored forever or not, it looks to me that storing nodes are supposed to take on risk without being sure that they will get reimbursed in the future. I mean, a full node must store non-ephemeral messages as they arrive, in the hope that someone, sometime in the future will be interested in them. This is akin to PoW mining where miners expend energy first hoping to get rewarded later, so that's not to say this cannot work, but it's something I'd keep in mind.

Also, when a client asks a server for historic messages, but the server hasn't stored them for some reason, is it too late? Or is there a way for the server to query other nodes that may have saved the message in question? If there is no such capability, should it exist?

alrevuelta commented 9 months ago

Am I correct that full nodes are supposed to store messages marked as non-ephemeral

Correct.

... forever? Or is there a deadline after which they can prune old messages and not be in violation of the protocol?

This is unanswered and depends on how fast the state size increases. If it grew 1 MB a year (nonsense) ofc we want to store it forever, but it is not the case. A number that we had in mind is 1 month, as the size should be quite reasonable for a single shard. But note that this doesn't mean that all nodes will store just 1 month. Some nodes running in cloud with more resources might store everything.

Regardless of whether messages are stored forever or not, it looks to me that storing nodes are supposed to take on risk without being sure that they will get reimbursed in the future

Correct. That is indeed the drawback of https://github.com/waku-org/nwaku/issues/1961, but note that its not the final solution but just an idea. Btw, mind stating this fact in that issue?, its very valid and I'm sure we can use it to further iterate on the idea.

Also, when a client asks a server for historic messages, but the server hasn't stored them for some reason, is it too late? Or is there a way for the server to query other nodes that may have saved the message in question? If there is no such capability, should it exist?

s-tikhomirov commented 7 months ago

Closing in favor of #39.