diff --git a/crates/blockifier/src/concurrency/versioned_state.rs b/crates/blockifier/src/concurrency/versioned_state.rs index 55196768c9..1823baf2f3 100644 --- a/crates/blockifier/src/concurrency/versioned_state.rs +++ b/crates/blockifier/src/concurrency/versioned_state.rs @@ -109,7 +109,6 @@ impl VersionedState { } } - // 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); @@ -341,6 +340,11 @@ impl StateReader for VersionedStateProxy { } 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 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)?,