Skip to content

Commit

Permalink
Merge pull request #4361 from rafal-ch/remove_unnecessary_deploy_check
Browse files Browse the repository at this point in the history
Remove the superfluous deploy crypto verification from deploy buffer
  • Loading branch information
sacherjj authored Apr 10, 2024
2 parents bc43388 + 53539df commit e4e700e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
4 changes: 0 additions & 4 deletions node/src/components/deploy_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ impl DeployBuffer {
/// Update buffer considering new stored deploy.
fn register_deploy(&mut self, deploy: Deploy) {
let deploy_hash = deploy.hash();
if deploy.is_valid().is_err() {
error!(%deploy_hash, "DeployBuffer: invalid deploy must not be buffered");
return;
}
if self.dead.contains(deploy_hash) {
info!(%deploy_hash, "DeployBuffer: attempt to register already dead deploy");
return;
Expand Down
18 changes: 0 additions & 18 deletions node/src/components/deploy_buffer/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,6 @@ fn create_valid_deploys(
deploys
}

fn create_invalid_deploys(rng: &mut TestRng, size: usize) -> Vec<Deploy> {
let mut deploys = create_valid_deploys(rng, size, DeployType::Random, None, None);

for deploy in deploys.iter_mut() {
deploy.invalidate();
}

deploys
}

/// Checks sizes of the deploy_buffer containers. Also checks the metrics recorded.
#[track_caller]
fn assert_container_sizes(
Expand Down Expand Up @@ -147,14 +137,6 @@ fn register_deploy_and_check_size() {
.for_each(|deploy| deploy_buffer.register_deploy(deploy.clone()));
assert_container_sizes(&deploy_buffer, valid_deploys.len(), 0, 0);

// Try to register invalid deploys
let num_invalid_deploys: usize = rng.gen_range(10..100);
let invalid_deploys = create_invalid_deploys(&mut rng, num_invalid_deploys);
invalid_deploys
.iter()
.for_each(|deploy| deploy_buffer.register_deploy(deploy.clone()));
assert_container_sizes(&deploy_buffer, valid_deploys.len(), 0, 0);

// Try to register a duplicate deploy
let duplicate_deploy = valid_deploys
.get(rng.gen_range(0..num_valid_deploys))
Expand Down

0 comments on commit e4e700e

Please sign in to comment.