Skip to content

Commit d2b8aaf

Browse files
committed
fix: increase proposal channel to 4096, restore direct writes for startup sync
1 parent 84e5f20 commit d2b8aaf

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

bins/validator-node/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ async fn main() -> Result<()> {
652652

653653
// Channel for local storage proposals (proposer adds to own state)
654654
let (local_proposal_tx, mut local_proposal_rx) =
655-
tokio::sync::mpsc::channel::<StorageProposal>(256);
655+
tokio::sync::mpsc::channel::<StorageProposal>(4096);
656656

657657
// Cast storage to trait object for WASM executor
658658
let storage_dyn: Arc<dyn DistributedStore> = Arc::clone(&storage) as Arc<dyn DistributedStore>;

bins/validator-node/src/wasm_executor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,8 +1026,8 @@ impl WasmChallengeExecutor {
10261026
challenge_id: module_path.to_string(),
10271027
validator_id: "validator".to_string(),
10281028
storage_host_config: StorageHostConfig {
1029-
allow_direct_writes: false,
1030-
require_consensus: true,
1029+
allow_direct_writes: true,
1030+
require_consensus: false,
10311031
..self.config.storage_host_config.clone()
10321032
},
10331033
storage_backend: Arc::clone(&self.config.storage_backend),

crates/p2p-consensus/src/state.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,13 @@ impl ChainState {
609609

610610
/// Add a storage proposal
611611
pub fn add_storage_proposal(&mut self, proposal: StorageProposal) {
612+
// Don't overwrite existing proposal (preserves accumulated votes)
613+
if self
614+
.pending_storage_proposals
615+
.contains_key(&proposal.proposal_id)
616+
{
617+
return;
618+
}
612619
info!(
613620
proposal_id = %hex::encode(&proposal.proposal_id[..8]),
614621
challenge_id = %proposal.challenge_id,

0 commit comments

Comments
 (0)