Skip to content

Commit 35fa4f4

Browse files
committed
fixup: recover lost comments
1 parent d2670f4 commit 35fa4f4

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

node/src/effects.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ pub fn effects<S: Service>(store: &mut Store<S>, action: ActionWithMeta) {
4848

4949
p2p_try_reconnect_disconnected_peers(store);
5050

51-
store.dispatch(SnarkPoolAction::CheckTimeouts {});
52-
store.dispatch(SnarkPoolAction::P2pSendAll {});
51+
store.dispatch(SnarkPoolAction::CheckTimeouts);
52+
store.dispatch(SnarkPoolAction::P2pSendAll);
5353

5454
p2p_request_best_tip_if_needed(store);
5555

56-
store.dispatch(SnarkPoolCandidateAction::WorkFetchAll {});
57-
store.dispatch(SnarkPoolCandidateAction::WorkVerifyNext {});
56+
store.dispatch(SnarkPoolCandidateAction::WorkFetchAll);
57+
store.dispatch(SnarkPoolCandidateAction::WorkVerifyNext);
5858

5959
p2p_request_snarks_if_needed(store);
6060

node/src/external_snark_worker/external_snark_worker_effects.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn external_snark_worker_effects<S: crate::Service>(
2727
}
2828
}
2929
ExternalSnarkWorkerAction::Started => {
30-
store.dispatch(SnarkPoolAction::AutoCreateCommitment {});
30+
store.dispatch(SnarkPoolAction::AutoCreateCommitment);
3131
}
3232
ExternalSnarkWorkerAction::StartTimeout { .. } => {
3333
store.dispatch(ExternalSnarkWorkerAction::Error {
@@ -78,6 +78,7 @@ pub fn external_snark_worker_effects<S: crate::Service>(
7878
proofs: result.clone(),
7979
};
8080
let sender = store.state().p2p.my_id();
81+
// Directly add snark to the snark pool as it's produced by us.
8182
store.dispatch(SnarkPoolAction::WorkAdd { snark, sender });
8283
store.dispatch(ExternalSnarkWorkerAction::PruneWork);
8384
}
@@ -100,7 +101,7 @@ pub fn external_snark_worker_effects<S: crate::Service>(
100101
store.dispatch(ExternalSnarkWorkerAction::PruneWork);
101102
}
102103
ExternalSnarkWorkerAction::PruneWork => {
103-
store.dispatch(SnarkPoolAction::AutoCreateCommitment {});
104+
store.dispatch(SnarkPoolAction::AutoCreateCommitment);
104105
}
105106
}
106107
}

node/src/snark_pool/candidate/snark_pool_candidate_actions.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,11 @@ impl redux::EnablingCondition<crate::State> for SnarkPoolCandidateAction {
116116
})
117117
}
118118
SnarkPoolCandidateAction::WorkVerifyError { .. } => {
119+
// TODO(binier)
119120
true
120121
}
121122
SnarkPoolCandidateAction::WorkVerifySuccess { .. } => {
123+
// TODO(binier)
122124
true
123125
}
124126
SnarkPoolCandidateAction::PeerPrune { peer_id } => {

node/src/snark_pool/snark_pool_effects.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub fn snark_pool_effects<S: Service>(store: &mut Store<S>, action: SnarkPoolAct
160160
}
161161
}
162162
SnarkPoolAction::JobCommitmentTimeout { .. } => {
163-
store.dispatch(SnarkPoolAction::AutoCreateCommitment {});
163+
store.dispatch(SnarkPoolAction::AutoCreateCommitment);
164164
}
165165
}
166166
}

p2p/src/channels/rpc/p2p_channels_rpc_actions.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,11 @@ impl redux::EnablingCondition<P2pState> for P2pChannelsRpcAction {
101101
})
102102
},
103103
P2pChannelsRpcAction::ResponseReceived { peer_id, id, .. } => {
104+
// TODO(binier): use consensus to enforce that peer doesn't send
105+
// us inferior block than it has in the past.
104106
state.get_ready_peer(peer_id).map_or(false, |p| match &p.channels.rpc {
105107
P2pChannelsRpcState::Ready { local, .. } => {
108+
// TODO(binier): validate that response corresponds to request.
106109
matches!(local, P2pRpcLocalState::Requested { id: rpc_id, .. } if rpc_id == id)
107110
},
108111
_ => false,
@@ -120,6 +123,7 @@ impl redux::EnablingCondition<P2pState> for P2pChannelsRpcAction {
120123
P2pChannelsRpcAction::ResponseSend { peer_id, id, .. } => {
121124
state.get_ready_peer(peer_id).map_or(false, |p| match &p.channels.rpc {
122125
P2pChannelsRpcState::Ready { remote, .. } => {
126+
// TODO(binier): validate that response corresponds to request.
123127
remote.pending_requests.iter().any(|v| v.id == *id)
124128
},
125129
_ => false,

0 commit comments

Comments
 (0)