Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
fix(concurrency): remove compiled_class_hashes check from validate_reads
Browse files Browse the repository at this point in the history
  • Loading branch information
OriStarkware committed Jun 5, 2024
1 parent b54fb18 commit fce92f2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion crates/blockifier/src/concurrency/versioned_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ impl<S: StateReader> VersionedState<S> {
}
}

// Added for symmetry. We currently do not update this initial mapping.
for (&class_hash, expected_value) in &reads.compiled_class_hashes {
let value = self.compiled_class_hashes.read(tx_index, class_hash).expect(READ_ERR);

Expand All @@ -128,6 +127,7 @@ impl<S: StateReader> VersionedState<S> {
}
}


for (&class_hash, expected_value) in &reads.declared_contracts {
let is_declared = self.declared_contracts.read(tx_index, class_hash).expect(READ_ERR);
assert_eq!(
Expand Down Expand Up @@ -315,6 +315,11 @@ impl<S: StateReader> StateReader for VersionedStateProxy<S> {
}
Err(StateError::UndeclaredClassHash(class_hash)) => {
state.declared_contracts.set_initial_value(class_hash, false);
// Papyrus storage does not support read action for compiled_class_hashes
// values. We are artificially insert StarkFelt::ZERO for undeclared contracts.
state
.compiled_class_hashes
.set_initial_value(class_hash, CompiledClassHash(StarkFelt::ZERO));
Err(StateError::UndeclaredClassHash(class_hash))?
}
Err(error) => Err(error)?,
Expand Down

0 comments on commit fce92f2

Please sign in to comment.