Skip to content

Conversation

Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Implements fork choice logic and adds comprehensive unit tests for vote targeting, head selection, attestation validation/processing, and time advancement per the linked spec.

  • Add ForkChoiceStore core logic (safe target, head updates, attestation processing, time ticking) and helper API.
  • Introduce supporting types/constants (ValidatorIndex, Interval, ceilDiv, Checkpoint::from) and wire into build.
  • Add unit tests covering fork-choice behaviors and time advancement scenarios.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
vcpkg-overlay/qtils/portfile.cmake Bump qtils port to v0.1.5 to use updated test/outcome utilities.
src/blockchain/fork_choice.hpp New public API and data structures for fork choice.
src/blockchain/fork_choice.cpp Implementation of fork choice logic (safe target, head update, attestation handling, time ticking, and head selection).
src/utils/ceil_div.hpp New ceilDiv utility.
src/types/checkpoint.hpp Default-initialize slot; add Checkpoint::from factory.
src/types/block.hpp Allow setHash() on const Blocks by making hash cache mutable.
src/types/constants.hpp Add second-based slot/interval constants.
src/types/slot.hpp Add Interval alias.
src/types/validator_index.hpp Add ValidatorIndex alias.
src/types/vote.hpp Default-initialize validator_id and slot.
src/blockchain/CMakeLists.txt Link new fork_choice.cpp into blockchain lib.
tests/unit/blockchain/fork_choice_test.cpp New unit tests for fork choice behaviors.
tests/unit/blockchain/CMakeLists.txt Add fork_choice_test target.
DEPRECATED.md Note naming convention differences from spec (comment-only).

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
Signed-off-by: turuslan <[email protected]>
@turuslan turuslan closed this Sep 29, 2025
@turuslan turuslan deleted the feature/fork_choice branch October 16, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants