-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persist and republish mailbox messages #5072
Persist and republish mailbox messages #5072
Conversation
Awesome. Yes please |
b63d632
to
b234073
Compare
4af829e
to
fe44cee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to have seednodes request all mailbox messages on startup and then republish the discrepancy between the response and their locally persisted messages?
That would reduce the amount of republishing for the price of only seednodes asking for all messages from the other seednodes on startup.
p2p/src/main/java/bisq/network/p2p/storage/RemovedPayloadsStorageService.java
Outdated
Show resolved
Hide resolved
…sageService instead
…geService instead
…sageService instead
Remove Objects::nonNull check Split handleMailboxItem into 2 methods for persisting and for processing my mailbox msg
…arrives Add republishMailBoxMessages method
We add the date when we add the hash so that we can remove expired data.
We have added the capability in 1.4.0 and have enforced 1.5.1 so no traders can use that old version anymore so the capability check is not needed anymore.
Adjust param
Remove outdated comment Add checkNotNull for senderNodeAddress
Extend TradeMailboxMessage where we had `extends TradeMessage implements MailboxMessage`
For all MailboxMessage we want to be sure they have an expire date. Add getTTL methods and TTL value. We use 7 days for ChatMessages and 30 days for PrivateNotificationMessages. All others use default 15 days. We prefer to keep them explicit and not use a default method in ExpirablePayload or MailboxMessage. The value in PrefixedSealedAndSignedMessage will not be used as the sender use the TTL of the payload and pass that to the MailboxStoragePayload where we store it in the extraMap. That way we can use different TTL even the payload message is encrypted and we would not be able to look it up.
onBundleOfEnvelopes method. In case we received a SendersNodeAddressMessage inside a BundleOfEnvelope we did not set the peers address.
Add size limit. Add log for number of persisted mailbox msg per day
Awesome |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems mostly good. I wonder about the size check to push out old messages though.
p2p/src/main/java/bisq/network/p2p/mailbox/MailboxMessageService.java
Outdated
Show resolved
Hide resolved
Pr is running on 75% of the seeds since a few days. I guess its safe now to merge into master... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
For better resiliance in case all seed nodes would go offline, we persist the mailbox messages and republish them at startup.
We had already a persistence for own mailbox messages and reuse that but add all mailbox messages.
We check for the TTL to not publish expired messages as well we check if we have received a remove message for that mailbox message.
To not overload too much the P2pService class I refactored the mailbox related code out to a new class. The first commits are refactoring commits. The code for the new feature starts at b91a1f7