[bisq-network/bisq] Bundle messages at broadcast (#4436)

chimp1984 notifications at github.com
Wed Aug 26 05:20:50 UTC 2020


We use BundleOfEnvelopes at the connection level to collect messages which are sent out with a short time interval. unfortunatelty that approach did not had much effect as it is per connection and per connection we rarely get jammed too much. This PR is applying the idea to the Broadcast class where we aggregate all messages for broadcast and send them as bundle every second to our connections. 
If only 1 message arrived in that interval we do not wrap it into a BundleOfEnvelopes but send it directly.
We also improved the handling of a listener used for notifying about the stored in mailbox event. Previously we added a 3 sec. delay after we received the first successful broadcast. Now we trigger the event once we had at least 3 successful broadcasts.
As we have now mixed messages we had to change the handling of own messages. We treat the bundle with priority if at least one message was originated by ourself.
The notification of listeners handled is by message. To achieve that we use the BroadcastRequest value object.
There was a bug with the timeout delay where a value in seconds have been not converted to ms. 
We also refactored the convoluted error handling.

For deploying that PR I recommend to start with 1 seed node and observe the statistics if it have led to lower number of sent messages compared to the current version. 
The https://github.com/bisq-network/bisq/pull/4435 PR has added better logging for network statistics and is merged into that PR.
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/4436

-- Commit Summary --

  * Refactoring
  * Refactoring
  * Bundle broadcast requests
  * Add todo and curly brackets
  * Add more detailed network statistics
  * Change log level
  * Fix display strings
  * Merge branch 'improve-network-statistics' into bundle-msg-at-broadcast
  * Change BROADCAST_INTERVAL_MS to 2 sec.
  * Don't wrap into BundleOfEnvelopes is only 1 message is used
  * Convert totalSentMessagesPerSec to a string before reset to make it
  * Merge branch 'improve-network-statistics' into bundle-msg-at-broadcast
  * LAST_ACTIVITY_AGE_MS should be millisec not sec
  * Increase INTERVAL_SEC to 30-60 sec from 5-35 sec.
  * Add logs

-- File Changes --

    M core/src/main/java/bisq/core/dao/monitoring/network/StateNetworkService.java (2)
    M core/src/main/java/bisq/core/dao/node/full/network/FullNodeNetworkService.java (2)
    M core/src/main/java/bisq/core/dao/node/lite/network/LiteNodeNetworkService.java (2)
    M core/src/main/resources/i18n/displayStrings.properties (6)
    M desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.fxml (7)
    M desktop/src/main/java/bisq/desktop/main/settings/network/NetworkSettingsView.java (29)
    M p2p/src/main/java/bisq/network/p2p/BundleOfEnvelopes.java (8)
    M p2p/src/main/java/bisq/network/p2p/P2PService.java (56)
    M p2p/src/main/java/bisq/network/p2p/network/Connection.java (9)
    M p2p/src/main/java/bisq/network/p2p/network/Statistic.java (149)
    M p2p/src/main/java/bisq/network/p2p/peers/BroadcastHandler.java (342)
    M p2p/src/main/java/bisq/network/p2p/peers/Broadcaster.java (76)
    M p2p/src/main/java/bisq/network/p2p/peers/keepalive/KeepAliveManager.java (4)
    M p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java (8)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/4436.patch
https://github.com/bisq-network/bisq/pull/4436.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4436
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200825/a3cbc246/attachment.html>


More information about the bisq-github mailing list