Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Larger votes preparation #4350

Merged
merged 3 commits into from
Dec 12, 2023
Merged

Conversation

pwojcikdev
Copy link
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
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

@pwojcikdev pwojcikdev merged commit 220ac3d into nanocurrency:develop Dec 12, 2023
16 of 17 checks passed
# for free to join this conversation on GitHub. Already have an account? # 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