Skip to content

Commit 242f711

Browse files
committed
fix: add local vote for storage proposals
Validators must vote locally on their own proposals since they don't receive their own P2P broadcasts. This ensures the proposer's vote is counted toward the 2f+1 quorum.
1 parent 3679106 commit 242f711

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bins/validator-node/src/main.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2249,12 +2249,17 @@ async fn handle_network_event(
22492249

22502250
let vote_msg = P2PMessage::StorageVote(StorageVoteMessage {
22512251
proposal_id: proposal.proposal_id,
2252-
voter: my_hotkey,
2252+
voter: my_hotkey.clone(),
22532253
approve,
22542254
timestamp,
22552255
signature,
22562256
});
22572257

2258+
// Add our own vote locally (we don't receive our own broadcasts)
2259+
state_manager.apply(|state| {
2260+
state.vote_storage_proposal(&proposal.proposal_id, my_hotkey, approve);
2261+
});
2262+
22582263
if let Err(e) = p2p_cmd_tx
22592264
.send(platform_p2p_consensus::P2PCommand::Broadcast(vote_msg))
22602265
.await

0 commit comments

Comments
 (0)