Skip to content

Larger votes preparation#4350

Merged
pwojcikdev merged 3 commits intonanocurrency:developfrom
pwojcikdev:larger-votes
Dec 12, 2023
Merged

Larger votes preparation#4350
pwojcikdev merged 3 commits intonanocurrency:developfrom
pwojcikdev:larger-votes

Conversation

@pwojcikdev
Copy link
Copy Markdown
Contributor

@pwojcikdev pwojcikdev commented Dec 12, 2023

This allows nodes to handle confirm_req and confirm_ack messages with payload of more than 16 hashes, up to 255. During testing it was shown that fewer, larger messages provide considerable improvement in performance, especially on CPU limited hardware. This PR is one of the steps to better align our message formats with this philosophy.

What's important to note is that, even with ability to handle large votes, nodes will continue to generate vote requests & responses with legacy rules (<= 12 hashes per message) to keep compatibility with previous versions. Once majority of the network upgrades, switching to larger votes should be as simple as modifying two constants in code.

Header before:
+-------+-----------+--------+
|  1-4  |    5-8    |  9-16  |
+-------+-----------+--------+
| count | block type | unused |
+-------+-----------+--------+

Header after:
+---------------+-----------+---------------+--------+---------+
|      1-4      |    5-8    |     9-12      | 13-15  |   16    |
+---------------+-----------+---------------+--------+---------+
| count (upper) | block type | count (lower) | unused | v2 flag |
+---------------+-----------+---------------+--------+---------+

@qwahzi qwahzi added this to the V26.0 milestone Dec 12, 2023
@qwahzi qwahzi added the performance Performance/resource utilization improvement label Dec 12, 2023
@gr0vity-dev
Copy link
Copy Markdown
Contributor

I tested backwards and forwards compatibility on a local test network. It's looking good, and there's a noticeable increase in confirmation speed with higher vote count per message.

Screenshot 2023-12-12 at 18 02 07

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance/resource utilization improvement

Projects

Status: Merged / V26.0

Development

Successfully merging this pull request may close these issues.

4 participants