Skip to content

Commit

Permalink
fix(vm): fix insertion to decommitted_code_hashes (#2275)
Browse files Browse the repository at this point in the history
## What ❔

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] 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`.
  • Loading branch information
perekopskiy authored Jun 19, 2024
1 parent 440f2a7 commit 15bb71e
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,15 @@ impl<S: ReadStorage + Debug, const B: bool, H: HistoryMode> 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)
}
Expand Down

0 comments on commit 15bb71e

Please sign in to comment.