Skip to content

feat: StateV2 role state machine and P2P block signature verification#31

Open
tomatoishealthy wants to merge 2 commits intomainfrom
feat/p2p-broadcast-validation
Open

feat: StateV2 role state machine and P2P block signature verification#31
tomatoishealthy wants to merge 2 commits intomainfrom
feat/p2p-broadcast-validation

Conversation

@tomatoishealthy
Copy link
Copy Markdown

@tomatoishealthy tomatoishealthy commented Mar 30, 2026

Summary

  • StateV2 role state machine: Dual sequencer/follower roles; hasSigner flag gates block production vs. validation path; isHAMode interface reserved for future Raft HA extension
  • P2P signature verification: End-to-end BlockV2 signature validation on both broadcast and blocksync paths; sequencer identity verified via SequencerVerifier (backed by L1 history) to prevent forged block propagation
  • Dead code removal: Removed redundant proto conversion helpers and unused fields

Test plan

  • 4-node devnet: PBFT → V2 upgrade switch, sequencer produces blocks, followers sync correctly
  • P2P security tests (run-test.sh p2p-test): signature forgery PASSED, unsolicited sync PASSED, network resilience PASSED

🤖 Generated with Claude Code

allen.wu and others added 2 commits March 26, 2026 18:46
- StateV2: roleCheckRoutine for dynamic role detection, SequencerHA interface
- ApplyBlock: full mutex serialization + idempotent height check
- VerifyBlockSignature: fail-close, all V2 blocks must have valid signatures
- SignatureStore: independent block signature persistence (LevelDB)
- BroadcastReactor: unified signature verification, SyncReq tracking, HasSigner filter
- Interfaces: SequencerVerifier, Signer, SequencerHA

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove SequencerAddress, SetSequencerAddress, IsSequencerAddress,
  RecoverBlockV2Signer from types/block_v2.go (unused since SequencerVerifier)
- Remove duplicate BlockV2ToProto/ProtoToBlockV2 from broadcast_reactor.go,
  use types.BlockV2ToProto instead
- Clean up unused imports (fmt, crypto, math/big, seqproto)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tomatoishealthy tomatoishealthy requested a review from a team as a code owner March 30, 2026 02:37
@tomatoishealthy tomatoishealthy requested review from r3aker86 and removed request for a team March 30, 2026 02:37
@tomatoishealthy tomatoishealthy changed the title feat: StateV2 role state machine + P2P block signature verification feat: StateV2 role state machine and P2P block signature verification Mar 30, 2026
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.

1 participant