-
Notifications
You must be signed in to change notification settings - Fork 17
Closed
Description
Description
Part of issue #605: Adaptive Difficulty Adjustment for PoUW Consensus
Add a new DifficultyConfig struct to store governance-controlled difficulty parameters in the blockchain state, replacing hardcoded constants.
Acceptance Criteria
- Create
DifficultyConfigstruct in lib-blockchain with fields:target_timespan: u64(default: 14 days)adjustment_interval: u64(default: 2016 blocks)min_adjustment_factor: u64(default: 4 - max 4x decrease)max_adjustment_factor: u64(default: 4 - max 4x increase)last_updated_at_height: u64(tracks when last changed)
- Add
difficulty_config: DifficultyConfigfield toBlockchainstruct - Initialize with default values in
Blockchain::new() - Implement serialization/deserialization for persistence
- Add getter method
get_difficulty_config(&self) -> &DifficultyConfig - Write unit tests for serialization round-trip
- Ensure backward compatibility with existing genesis blocks
Related
- Blocks issue feat: Implement adaptive difficulty adjustment for network-wide PoUW consensus #605: Adaptive Difficulty Adjustment for PoUW Consensus
Metadata
Metadata
Assignees
Labels
No labels