Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions crates/apollo_consensus_orchestrator/src/build_proposal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,16 @@ async fn get_proposal_content(
// If the blob writing operation to Aerospike doesn't return a success status, we
// can't finish the proposal. Must wait for it at least until batcher_timeout is
// reached.
let remaining = (args.batcher_deadline - args.deps.clock.now())
let remaining_duration = (args.batcher_deadline - args.deps.clock.now())
.to_std()
.unwrap_or_default()
.max(MIN_WAIT_DURATION); // Ensure we wait at least 1 ms to avoid immediate timeout.
match tokio::time::timeout(remaining, args.cende_write_success.borrow_mut()).await {
.max(MIN_WAIT_DURATION); // Ensure we wait at least 1 ms to avoid immediate timeout.
match tokio::time::timeout(
remaining_duration,
args.cende_write_success.borrow_mut(),
)
.await
{
Err(_) => {
return Err(BuildProposalError::CendeWriteError(
"Writing blob to Aerospike didn't return in time.".to_string(),
Expand Down
8 changes: 4 additions & 4 deletions crates/apollo_consensus_orchestrator/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,14 +447,14 @@ pub(crate) fn truncate_to_executed_txs(
// Truncate `content` to keep only the first `final_n_executed_txs`, preserving batch
// structure.
let mut executed_content: Vec<Vec<InternalConsensusTransaction>> = Vec::new();
let mut remaining = final_n_executed_txs;
let mut remaining_tx_count = final_n_executed_txs;

for batch in content {
if remaining < batch.len() {
executed_content.push(batch.into_iter().take(remaining).collect());
if remaining_tx_count < batch.len() {
executed_content.push(batch.into_iter().take(remaining_tx_count).collect());
break;
} else {
remaining -= batch.len();
remaining_tx_count -= batch.len();
executed_content.push(batch);
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/blockifier/src/execution/entry_point_execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ pub fn get_call_result(
let [failure_flag, retdata_start, retdata_end]: &[MaybeRelocatable; 3] =
(&return_result[2..]).try_into().expect("Return values must be of size 3.");

let failed = if *failure_flag == MaybeRelocatable::from(0) {
let execution_failed = if *failure_flag == MaybeRelocatable::from(0) {
false
} else if *failure_flag == MaybeRelocatable::from(1) {
true
Expand Down Expand Up @@ -535,7 +535,7 @@ pub fn get_call_result(
TrackedResource::SierraGas => syscall_handler.base.call.initial_gas - gas,
};
Ok(CallResult {
failed,
failed: execution_failed,
retdata: read_execution_retdata(runner, retdata_size, retdata_start)?,
gas_consumed,
})
Expand Down
4 changes: 2 additions & 2 deletions crates/blockifier/src/execution/syscalls/syscall_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ impl<'state> SyscallHandlerBase<'state> {
let call_info = call.execute(self.state, self.context, remaining_gas)?;

let mut raw_retdata = call_info.execution.retdata.0.clone();
let failed = call_info.execution.failed;
let call_failed = call_info.execution.failed;
self.inner_calls.push(call_info);
if failed {
if call_failed {
self.context.revert(revert_idx, self.state)?;

// Delete events and l2_to_l1_messages from the reverted call.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl UpdatedSkeletonTreeImpl {
}
}
};
let updated = match original_node {
let updated_node = match original_node {
OriginalSkeletonNode::Binary => UpdatedSkeletonNode::Binary,
OriginalSkeletonNode::Edge(path_to_bottom) => {
UpdatedSkeletonNode::Edge(*path_to_bottom)
Expand All @@ -251,7 +251,7 @@ impl UpdatedSkeletonTreeImpl {
continue;
}
};
self.skeleton_tree.insert(index, updated);
self.skeleton_tree.insert(index, updated_node);
}

return TempSkeletonNode::Original(OriginalSkeletonNode::Binary);
Expand Down
Loading