-
Create the directory for your task breakdown:
mkdir -p src/client/prompts/consensus_engine
-
Analyze the following Reth crates and their components:
reth/crates/consensus/consensus/
- Core consensus interfacesreth/crates/consensus/common/
- Common consensus functionsreth/crates/ethereum/consensus/
- Ethereum-specific consensusreth/crates/blockchain-tree/
- Fork choice and chain managementreth/crates/engine/tree/
- Engine integrationreth/crates/primitives/
- Block and header types
-
For each subtask you identify, create a markdown file with the naming pattern:
<priority>_<task_name>.md
-
Each markdown file should contain: <task_structure>
Brief description of what this task accomplishes.
- Blocks: [List of task files this blocks]
- Blocked by: [List of task files this depends on]
Detailed explanation of what needs to be implemented.
Specific considerations for implementing in Zig.
- Criterion 1
- Criterion 2
- Tests pass
Small/Medium/Large (1-3 days, 3-7 days, 1-2 weeks) </task_structure>
<analysis_areas>
-
Block Validation
- Header validation rules
- Body validation
- Transaction validation
- Uncle/ommer validation
- Blob validation (EIP-4844)
-
Fork Choice Rules
- LMD-GHOST implementation
- Fork choice state management
- Reorg handling
- Finalization tracking
-
Consensus Rules by Fork
- Pre-merge PoW validation
- Post-merge PoS validation
- EIP-specific validations
- Fork transition handling
-
State Transition
- Block execution orchestration
- State root validation
- Receipt root validation
- Bloom filter generation
-
Chain Management
- Canonical chain tracking
- Side chain management
- Block buffering
- Chain reorganization
-
Beacon Chain Integration
- Attestation processing
- Finalization updates
- Justified checkpoint handling
-
Consensus Constants
- Fork configuration
- Chain parameters
- Difficulty calculations
- Block rewards
-
Error Handling
- Validation errors
- Consensus faults
- Recovery mechanisms </analysis_areas>
<priority_guidelines>
- 0-19: Core validation interfaces and types
- 20-39: Basic block validation rules
- 40-59: Fork choice implementation
- 60-79: Advanced consensus features
- 80-99: Optimizations and edge cases </priority_guidelines>