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 e2cfead commit 10bba60
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/blockifier/src/concurrency/versioned_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,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 Down Expand Up @@ -316,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 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 10bba60

Please sign in to comment.