Skip to content

Commit

Permalink
Fix ineffective concurrency lock (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
nulltea authored Mar 11, 2024
1 parent abd30f2 commit 1627403
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions prover/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ where
[(); S::SYNC_COMMITTEE_DEPTH]:,
[(); S::FINALIZED_HEADER_INDEX]:,
{
if let Err(e) = state.concurrency.clone().acquire_owned().await {
return Err(JsonRpcError::internal(format!(
"Failed to acquire concurrency lock: {}",
e
)));
};
let _permit = state
.concurrency
.clone()
.acquire_owned()
.await
.map_err(|e| {
JsonRpcError::internal(format!("Failed to acquire concurrency lock: {}", e))
})?;

let GenProofCommitteeUpdateParams {
light_client_update,
Expand Down Expand Up @@ -119,12 +121,14 @@ where
[(); S::BYTES_PER_LOGS_BLOOM]:,
[(); S::MAX_EXTRA_DATA_BYTES]:,
{
if let Err(e) = state.concurrency.clone().acquire_owned().await {
return Err(JsonRpcError::internal(format!(
"Failed to acquire concurrency lock: {}",
e
)));
};
let _permit = state
.concurrency
.clone()
.acquire_owned()
.await
.map_err(|e| {
JsonRpcError::internal(format!("Failed to acquire concurrency lock: {}", e))
})?;

let GenProofStepParams {
light_client_finality_update,
Expand Down

0 comments on commit 1627403

Please sign in to comment.