-
Notifications
You must be signed in to change notification settings - Fork 3
state transition function #12
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
Conversation
turuslan
commented
Sep 16, 2025
- implement stf from spec
- simple unit test for stf
Signed-off-by: turuslan <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the state transition function (STF) from the lean Ethereum specification, enabling block validation and state updates in the blockchain system.
Key changes include:
- Implementation of the complete state transition function with block processing, slot advancement, and attestation handling
- Addition of SSZ serialization support to core data structures (State, Config, BlockBody)
- Creation of comprehensive unit tests to validate the STF implementation
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/blockchain/state_transition_function_test.cpp | Unit test validating STF with genesis state generation and multi-block transitions |
| tests/unit/blockchain/CMakeLists.txt | Build configuration for new STF test |
| src/types/state.hpp | Updated State struct with SSZ serialization and proper field types |
| src/types/config.hpp | Added SSZ serialization to Config struct |
| src/types/block_body.hpp | Renamed votes to attestations and updated to use SignedVote |
| src/types/block.hpp | Modified setHash() to allow re-setting with validation |
| src/blockchain/state_transition_function.hpp | Interface definition for STF with error handling and processing methods |
| src/blockchain/state_transition_function.cpp | Complete STF implementation with block processing, justification, and finalization logic |
| src/blockchain/is_justifiable_slot.hpp | Utility function to determine valid justifiable slots using mathematical conditions |
| src/blockchain/CMakeLists.txt | Build configuration updates to include new STF source file |
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]>
Signed-off-by: turuslan <[email protected]>