Skip to content
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

Fix vote_spacing logic #4840

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

gr0vity-dev
Copy link
Contributor

The votable() method had incorrect logic that allowed voting on recently
voted blocks when it should have prevented them. Fix inverts the logic to:

  • Prevent repeated votes on the same root/hash pairs within spacing window
  • Allow immediate voting on different blocks with same root (competing forks)

Additional changes:

  • Remove vote spacing check from vote_generator reply()
  • Update vote_spacing to track latest fork votes per root
  • Fix tests to reflect correct spacing behavior

…ing immediate votes

for competing forks.

Key changes:
- Remove vote spacing check from reply() in vote_generator.cpp
- Update vote_spacing implementation to track most recent fork votes
- Fix tests to reflect new vote spacing behavior
@gr0vity-dev-bot
Copy link

gr0vity-dev-bot commented Feb 5, 2025

Test Results for Commit 0bc0a2c

Pull Request 4840: Results
Overall Status:

Test Case Results

  • 5n4pr_conf_10k_bintree: PASS (Duration: 112s)
  • 5n4pr_conf_10k_change: PASS (Duration: 143s)
  • 5n4pr_conf_change_dependant: PASS (Duration: 128s)
  • 5n4pr_conf_change_independant: PASS (Duration: 135s)
  • 5n4pr_conf_send_dependant: PASS (Duration: 122s)
  • 5n4pr_conf_send_independant: PASS (Duration: 121s)
  • 5n4pr_rocks_10k_bintree: PASS (Duration: 117s)
  • 5n4pr_rocks_10k_change: PASS (Duration: 148s)

Last updated: 2025-02-16 16:17:14 UTC

@qwahzi qwahzi added this to the V28 milestone Feb 6, 2025
@pwojcikdev
Copy link
Contributor

I modified the vote spacing class to track votes by qualified root, which simplified the code and it eliminated the need to handle ambiguity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress / V28.0
Development

Successfully merging this pull request may close these issues.

4 participants