Skip to content
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

Update blockifier #2397

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

AnkushinDaniil
Copy link
Contributor

This pull request includes several changes to the vm module, primarily focusing on extending the class information in vm/class.go, updating dependencies in Cargo.toml.

Class Information Extension:

  • Updated the marshalClassInfo function in vm/class.go to include ClassVersion and SierraVersion fields for both Cairo0Class and CompiledClass. [1] [2]

Dependency Updates:

  • Updated dependencies in vm/rust/Cargo.toml to newer versions, including blockifier, cairo-lang-starknet-classes, cairo-lang-runner, starknet_api, and starknet-types-core.

@AnkushinDaniil AnkushinDaniil added VM dependencies Pull requests that update a dependency file go Pull requests that update Go code rust Pull requests that update Rust code labels Jan 24, 2025
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.43%. Comparing base (61d810a) to head (c54d485).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2397      +/-   ##
==========================================
- Coverage   74.48%   74.43%   -0.06%     
==========================================
  Files         113      113              
  Lines       13020    13020              
==========================================
- Hits         9698     9691       -7     
- Misses       2587     2592       +5     
- Partials      735      737       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@AnkushinDaniil AnkushinDaniil requested a review from cicr99 January 24, 2025 19:23
@@ -131,7 +131,7 @@ impl StateReader for JunoStateReader {
}

/// Returns the contract class of the given class hash.
fn get_compiled_contract_class(&self, class_hash: ClassHash) -> StateResult<ContractClass> {
fn get_compiled_class(&self, class_hash: ClassHash) -> StateResult<RunnableCompiledClass> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not possible for this method to return a V1Native(NativeCompiledClassV1) right? I'm just wondering if we should distinguish this case separately

Comment on lines +223 to +229
0 => {
sierra_version = SierraVersion::DEPRECATED;
match parse_deprecated_class_definition(class_def.to_string()) {
Ok(class) => class,
Err(err) => return Err(format!("failed parsing deprecated class: {:?}", err)),
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are abi_length and sierra_len still set to zero? I believe we need to manually override these fields for Cairo0 contracts, because abi_len affects the fee (and therefore traces and receipts), and originally these fields were ignored when generating the fee.

}

// TODO: Should I add versioned constants 13.4?. Where are 13.3?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer needed?

// the genesis block has a gas price of 0, but the blockifier
// does not allow for this. This, however, is not critical
// for consensus, and so the value of 1 is used instead.
fn gas_price_from_bytes(bytes: &[c_uchar; 32]) -> Result<NonzeroGasPrice, anyhow::Error> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about renaming this as gas_price_from_bytes_min1 or gas_price_from_bytes_bonded or something?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what do you mean that this isn't ciritical for consensus?

let actual_fee: Felt = t.receipt.fee.0.into();
let da_gas_l1_gas = t.receipt.da_gas.l1_gas.into();
let da_gas_l1_data_gas = t.receipt.da_gas.l1_data_gas.into();
// TODO: Are these resurce usage still valid?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still needed?

Comment on lines +373 to +374
// TODO: what goes here? Random value currently
l2_gas: GasAmount(8),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Comment on lines +311 to +312
// TODO: Which si the right gas vector, how to select it
&GasVectorComputationMode::All,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth asking the SN guys about this

Comment on lines +135 to +138
// TODO: initial gas should be different based on the execution method used: vm or native!
// There should be some check.
let initial_gas = get_versioned_constants(block_info.version).infinite_gas_for_vm_mode();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for myself to come back to this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file go Pull requests that update Go code rust Pull requests that update Rust code VM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants