Skip to content

Commit

Permalink
Small cleanup (#2947)
Browse files Browse the repository at this point in the history
  • Loading branch information
ndr-ds authored Nov 23, 2024
1 parent d62efd9 commit 0498c40
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion linera-core/src/chain_worker/state/temporary_changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ where
missing_published_blob_ids.is_empty(),
WorkerError::BlobsNotFound(missing_published_blob_ids)
);
block.check_proposal_size(policy.maximum_block_proposal_size, blobs)?;
for blob in blobs {
Self::check_blob_size(blob.content(), &policy)?;
}
block.check_proposal_size(policy.maximum_block_proposal_size, blobs)?;

let local_time = self.0.storage.clock().current_time();
ensure!(
Expand Down
14 changes: 6 additions & 8 deletions linera-core/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2377,11 +2377,10 @@ where
};

let identity = self.identity().await?;
let round =
match Self::round_for_new_proposal(&info, &identity, Some(&executed_block.block))? {
Either::Left(round) => round,
Either::Right(timeout) => return Ok(ClientOutcome::WaitForTimeout(timeout)),
};
let round = match Self::round_for_new_proposal(&info, &identity, &executed_block.block)? {
Either::Left(round) => round,
Either::Right(timeout) => return Ok(ClientOutcome::WaitForTimeout(timeout)),
};

// Collect the blobs required for execution.
let block = &executed_block.block;
Expand Down Expand Up @@ -2463,14 +2462,13 @@ where
fn round_for_new_proposal(
info: &ChainInfo,
identity: &Owner,
block: Option<&Block>,
block: &Block,
) -> Result<Either<Round, RoundTimeout>, ChainClientError> {
// If there is a conflicting proposal in the current round, we can only propose if the
// next round can be started without a timeout, i.e. if we are in a multi-leader round.
let manager = &info.manager;
let conflicting_proposal = manager.requested_proposed.as_ref().is_some_and(|proposal| {
proposal.content.round == manager.current_round
&& block.map_or(true, |block| proposal.content.block != *block)
proposal.content.round == manager.current_round && proposal.content.block != *block
});
let round = if !conflicting_proposal {
manager.current_round
Expand Down

0 comments on commit 0498c40

Please sign in to comment.