feat(CCHAIN-740): Implement validator proof protocol per ADR-006#1450
feat(CCHAIN-740): Implement validator proof protocol per ADR-006#1450ancazamfir merged 30 commits intocirclefin:mainfrom
Conversation
|
For testing I used the example/channel app, init and started nodes wiht testnet_manager.bash script. With these settings the validator set rotates every 10 heights and 3 validators are selected from the validators crates. Testing uses the metrics to determine node classification, for this PR the
...
Moniker Type Cons Prop Live Expl Peers InPeers OutPeers Conns InConns OutConns
-----------------------------------------------------------------------------------------------------------------------------
app-1 validator 11 11 11 0 11 7 4 15 11 4
app-2 validator 10 8 11 0 11 7 4 15 11 4
app-3 validator 6 11 7 0 11 7 4 15 11 4
-----------------------------------------------------------------------------------------------------------------------------
app-0 persistent 11 11 11 0 11 7 4 15 11 4
app-4 persistent 10 7 8 0 11 7 4 15 11 4
-----------------------------------------------------------------------------------------------------------------------------
app-10 full_node 4 4 4 0 5 0 5 5 0 5
app-11 full_node 4 4 4 0 5 0 5 5 0 5
app-5 full_node 4 4 4 0 5 0 5 5 0 5
app-6 full_node 4 4 4 0 5 0 5 5 0 5
app-7 full_node 4 4 4 0 5 0 5 5 0 5
app-8 full_node 4 4 4 0 5 0 5 5 0 5
app-9 full_node 4 4 4 0 5 0 5 5 0 5 |
Wrap the proof read in a 5-second timeout to prevent a malicious or buggy peer from holding substreams open indefinitely by never sending data. On timeout, the reader is dropped which closes the substream. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover the critical code paths in the proof-of-validator protocol: - Behaviour: poll state machine (anti-spam, retry-on-failure), connection tracking (first/additional/partial/full close), and send_proof logic - State: record_verified_proof, reclassify_peers via process_validator_set_update, local node reclassification, and persistent peer + proof interaction Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
nenadmilosevic95
left a comment
There was a problem hiding this comment.
Made a full code pass, and the code looks good! Left some comments, most are minor, some we can maybe discuss! Didn't run any tests, plan to do this on Monday!
Co-authored-by: nenadmilosevic95 <nenad.milosevic@circle.com>
nenadmilosevic95
left a comment
There was a problem hiding this comment.
Awesome work! Left 3 nitpicks, feel free to ignore!
| match &event { | ||
| // On send failure, allow retry by removing from sent set | ||
| Event::ProofSendFailed { peer, .. } => { | ||
| self.proofs_sent.remove(peer); |
There was a problem hiding this comment.
Ok, let's skip it for now
Co-authored-by: nenadmilosevic95 <nenad.milosevic@circle.com>
Implementation of #1436
Uses libp2p-stream protocol to satisfy the protocol spec and as proposed by @romac