-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add vm concurrency support #2016
Comments
looks interesting, If no one has taken this in a two weeks or more. |
Hey @obasekiosa! |
@obasekiosa Hey there! I was wondering if you wouldn't mind if I took on this task? |
Hey @AnkushinDaniil! |
If earlier we processed all transactions sequentially, at the moment we must first collect #[no_mangle]
pub extern "C" fn cairoVMExecute(
// ...
concurrency_mode: c_uchar,
) {
// ...
for (txn_index, txn_and_query_bit) in txns_and_query_bits.iter().enumerate() {
// ...
match transaction_from_api(
// ...
) {
Ok(t) => txs.push(t),
Err(e) => {
// ...
}
}
}
let mut tx_executor = TransactionExecutor::new(
state,
block_context,
TransactionExecutorConfig {
concurrency_config: ConcurrencyConfig {
enabled: concurrency_mode,
// TODO: make this configurable
n_workers: 4,
chunk_size: 64,
},
},
);
let res = tx_executor.execute_txs(&txs);
for (txn_index, result) in res.iter().enumerate() {
let minimal_l1_gas_amount_vector: Option<GasVector>;
match result {
Ok(mut t) => {
// ...
}
Err(e) => {
// ...
}
}
}
} |
what is and why is it a problem? |
We have to use more memory and we can't extract transaction trace in the provided solution. |
We should allow users to use the latest Blockifier feature, which is concurrent execution. We should add a Go flag (boolean) vm-concurrency-mode that will trigger parallel execution in Blockifier. This will require restructuring the Rust code that handles transactions.
Keep in mind that concurrent transactions may modify shared data structures (maps, slices), and we should protect them with mutexes on the Go side (CGo).
The text was updated successfully, but these errors were encountered: