Skip to content

refactor(consensus, forkchoice) Add forkchoice.heaviestSlotOnSameVotedFork method #729

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

Merged
merged 6 commits into from
May 19, 2025

Conversation

dadepo
Copy link
Contributor

@dadepo dadepo commented May 9, 2025

This adds the implementation for heaviestSlotOnSameVotedFork.

This could not be implemented until now because it depends on Tower.

@github-project-automation github-project-automation bot moved this to 🏗 In progress in Sig May 9, 2025
@dadepo
Copy link
Contributor Author

dadepo commented May 9, 2025

The Agave version has two tests. One was implemented. The second test depends on heaviest_subtree_fork_choice.add_votes which was not implemented until now because it depends on input retrieved from Bank.

The heaviest_subtree_fork_choice.add_votes method can now be implemented, and would be done in a follow up PR. This is still possible even though there is no direct Bank struct, the convention of passing in the exact inputs directly would be followed (instead of via a Bank) and in this case the epoch_stakes and epoch_schedule.

@dadepo dadepo requested review from InKryption and dnut May 9, 2025 13:10
Copy link

codecov bot commented May 9, 2025

Codecov Report

Attention: Patch coverage is 90.16393% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/consensus/fork_choice.zig 90.16% 6 Missing ⚠️
Files with missing lines Coverage Δ
src/consensus/replay_tower.zig 85.69% <ø> (+0.41%) ⬆️
src/consensus/fork_choice.zig 89.85% <90.16%> (+0.02%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dadepo dadepo changed the title refactor(consensus, forkchoice) Add forkchoice.heaviestSlotOnSameVotedFork method refactor(consensus, forkchoice) Add forkchoice.heaviestSlotOnSameVotedFork method May 9, 2025
@dadepo
Copy link
Contributor Author

dadepo commented May 9, 2025

The second test depends on heaviest_subtree_fork_choice.add_votes which was not implemented until now because it depends on input retrieved from Bank

Further look into heaviest_subtree_fork_choice.add_votes shows it is only used in tests and in a struct called RepairWeight that has not popped up yet for implementation. In the meantime I manually added tests that covers the other code paths in the new code.

Base automatically changed from dade/tower-replay-refactor-main to main May 9, 2025 19:20
@dadepo dadepo force-pushed the add-forkchoice-methods branch from 589c345 to b634ac6 Compare May 11, 2025 12:31
@dadepo dadepo force-pushed the add-forkchoice-methods branch from b634ac6 to 2749421 Compare May 12, 2025 14:06
@github-project-automation github-project-automation bot moved this from 🏗 In progress to 👀 In review in Sig May 19, 2025
@dnut dnut added this pull request to the merge queue May 19, 2025
Merged via the queue into main with commit cb3ff68 May 19, 2025
17 checks passed
@dnut dnut deleted the add-forkchoice-methods branch May 19, 2025 18:32
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Sig May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants