From 15bb71ec3ee66796e62cb7e61dec6e496e1f2774 Mon Sep 17 00:00:00 2001 From: perekopskiy <53865202+perekopskiy@users.noreply.github.com> Date: Wed, 19 Jun 2024 16:01:13 +0300 Subject: [PATCH] fix(vm): fix insertion to `decommitted_code_hashes` (#2275) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ ## Why ❔ ## Checklist - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. - [ ] Spellcheck has been run via `zk spellcheck`. --- .../versions/vm_latest/old_vm/oracles/decommitter.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/decommitter.rs b/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/decommitter.rs index 7c7dc6995d14..f5cd38779217 100644 --- a/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/decommitter.rs +++ b/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/decommitter.rs @@ -180,8 +180,15 @@ impl DecommittmentProcess Ok(partial_query) } else { partial_query.is_fresh = true; - self.decommitted_code_hashes - .insert(stored_hash, None, partial_query.timestamp); + if self + .decommitted_code_hashes + .inner() + .get(&stored_hash) + .is_none() + { + self.decommitted_code_hashes + .insert(stored_hash, None, partial_query.timestamp); + } Ok(partial_query) }