Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::str::FromStr;

use apollo_class_manager_types::SharedClassManagerClient;
use blockifier::blockifier::transaction_executor::CompiledClassHashesToMigrate;
use blockifier::bouncer::{BouncerWeights, CasmHashComputationData};
use blockifier::state::cached_state::CommitmentStateDiff;
use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass;
Expand Down Expand Up @@ -63,6 +64,9 @@ pub(crate) type CentralCompressedStateDiff = CentralStateDiff;
pub(crate) type CentralSierraContractClassEntry = (ClassHash, CentralSierraContractClass);
pub(crate) type CentralCasmContractClassEntry = (CompiledClassHash, CentralCasmContractClass);
pub(crate) type CentralCasmHashComputationData = CasmHashComputationData;
// TODO(AvivG): Remove this once added to 'AerospikeBlob'.
#[allow(unused)]
pub(crate) type CentralCompiledClassHashesToMigrate = CompiledClassHashesToMigrate;

#[derive(Clone, Debug, PartialEq, Serialize)]
struct CentralResourcePrice {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ use starknet_types_core::felt::Felt;
use super::{
CentralBouncerWeights,
CentralCasmHashComputationData,
CentralCompiledClassHashesToMigrate,
CentralCompressedStateDiff,
CentralDeclareTransaction,
CentralDeployAccountTransaction,
Expand Down Expand Up @@ -410,6 +411,13 @@ fn central_casm_hash_computation_data() -> CentralCasmHashComputationData {
}
}

fn central_compiled_class_hashes_to_migrate() -> CentralCompiledClassHashesToMigrate {
CentralCompiledClassHashesToMigrate::from([
(CompiledClassHash(felt!("0x2")), CompiledClassHash(felt!("0x1"))),
(CompiledClassHash(felt!("0x4")), CompiledClassHash(felt!("0x3"))),
])
}

fn central_sierra_contract_class() -> CentralSierraContractClass {
CentralSierraContractClass { contract_class: sierra_contract_class() }
}
Expand Down Expand Up @@ -651,6 +659,7 @@ fn central_blob() -> AerospikeBlob {
execution_infos: vec![transaction_execution_info()],
casm_hash_computation_data_sierra_gas: central_casm_hash_computation_data(),
casm_hash_computation_data_proving_gas: central_casm_hash_computation_data(),
compiled_class_hashes_to_migrate: central_compiled_class_hashes_to_migrate(),
};

// This is to make the function sync (not async) so that it can be used as a case in the
Expand Down
5 changes: 5 additions & 0 deletions crates/apollo_consensus_orchestrator/src/cende/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use apollo_config::dumping::{ser_optional_param, ser_param, SerializeConfig};
use apollo_config::{ParamPath, ParamPrivacyInput, SerializedParam};
use apollo_proc_macros::sequencer_latency_histogram;
use async_trait::async_trait;
use blockifier::blockifier::transaction_executor::CompiledClassHashesToMigrate;
use blockifier::bouncer::{BouncerWeights, CasmHashComputationData};
use blockifier::state::cached_state::CommitmentStateDiff;
use blockifier::transaction::objects::TransactionExecutionInfo;
Expand Down Expand Up @@ -297,6 +298,7 @@ pub struct BlobParameters {
// TODO(dvir): consider passing the execution_infos from the batcher as a string that
// serialized in the correct format from the batcher.
pub(crate) execution_infos: Vec<TransactionExecutionInfo>,
pub(crate) compiled_class_hashes_to_migrate: CompiledClassHashesToMigrate,
}

impl AerospikeBlob {
Expand Down Expand Up @@ -325,6 +327,9 @@ impl AerospikeBlob {
.map(CentralTransactionExecutionInfo::from)
.collect();

// TODO(AvivG): add `compiled_class_hashes_to_migrate` to `AerospikeBlob`.
let _ = blob_parameters.compiled_class_hashes_to_migrate;

Ok(AerospikeBlob {
block_number,
state_diff,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ impl ConsensusContext for SequencerConsensusContext {
l2_gas_consumed: l2_gas_used,
next_l2_gas_price: self.l2_gas_price,
},
compiled_class_hashes_to_migrate: central_objects.compiled_class_hashes_to_migrate,
})
.await
.inspect_err(|e| {
Expand Down