-
Notifications
You must be signed in to change notification settings - Fork 32
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
Ft/os upgrade #453
Ft/os upgrade #453
Conversation
7832163
to
8184adb
Compare
@@ -215,6 +215,7 @@ pub(crate) fn get_starknet_version(block_with_txs: &BlockWithTxs) -> blockifier: | |||
"0.13.1.1" => blockifier::versioned_constants::StarknetVersion::V0_13_1_1, | |||
"0.13.2" => blockifier::versioned_constants::StarknetVersion::V0_13_2, | |||
"0.13.2.1" => blockifier::versioned_constants::StarknetVersion::Latest, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this for:
StarknetVersion::V0_13_2_1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not available in the Blockifier version that we're using. I can double check this but updating Blockifier to a commit where it's defined lead to some extra changes that are meant for os v0.13.4 and are not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job man, I left some changes requested
crates/starknet-os/src/config.rs
Outdated
pub const DEFAULT_FEE_TOKEN_ADDR: &str = "7ce4aa542d72a82662cda96b147da9b041ecf8c61f67ef657f3bbb852fc698f"; | ||
pub const DEFAULT_DEPRECATED_FEE_TOKEN_ADDR: &str = "5195ba458d98a8d5a390afa87e199566e473d1124c07a3c57bf19813255ac41"; | ||
pub const SEQUENCER_ADDR_0_13_2: &str = "0x31c641e041f8d25997985b0efe68d0c5ce89d418ca9a127ae043aebed6851c5"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is changing? could you point to where you are getting the information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeap! It's defined in general_config.yaml
from cairo-lang:
https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/starknet/definitions/general_config.yml
@@ -49,7 +49,7 @@ const DEFAULT_COMPILED_OS: &[u8] = include_bytes!("../../../../build/os_latest.j | |||
#[case::inconsistent_cairo0_class_hash_1(204936)] | |||
#[case::no_possible_convertion_1(155007)] | |||
#[case::no_possible_convertion_2(155029)] | |||
#[case::reference_pie_with_full_output_enabled(173404)] | |||
// #[case::reference_pie_with_full_output_enabled(173404)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont remove this test:
The failure is related to the fact that this test is also comparing output and in this version the output structure has changed.
Fix: Find a new v0.13.3 PIE (we need them form Starkware) and modify this test to check that Block and output.
@@ -114,8 +112,7 @@ impl StarknetGeneralConfig { | |||
|
|||
pub fn empty_block_context(&self) -> BlockContext { | |||
let mut versioned_constants = VersionedConstants::default(); | |||
versioned_constants.invoke_tx_max_n_steps = self.invoke_tx_max_n_steps; | |||
versioned_constants.validate_max_n_steps = self.validate_max_n_steps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont you need to change it for:
pub validate_max_n_steps_override: u32
?
pub fn set_compressed_start( | ||
vm: &mut VirtualMachine, | ||
exec_scopes: &mut ExecutionScopes, | ||
ids_data: &HashMap<String, HintReference>, | ||
ap_tracking: &ApTracking, | ||
_constants: &HashMap<String, Felt252>, | ||
) -> Result<(), HintError> { | ||
let use_kzg_da_felt = exec_scopes.get::<Felt252>(vars::scopes::USE_KZG_DA)?; | ||
|
||
let use_kzg_da = if use_kzg_da_felt == Felt252::ONE { | ||
Ok(true) | ||
} else if use_kzg_da_felt == Felt252::ZERO { | ||
Ok(false) | ||
} else { | ||
Err(HintError::CustomHint("ids.use_kzg_da is not a boolean".to_string().into_boxed_str())) | ||
}?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add unit test for this hint
let n_updates_small_packing_bound = get_constant(vars::ids::N_UPDATES_SMALL_PACKING_BOUND, constants)?; | ||
|
||
let is_n_updates_small = | ||
if n_actual_updates < *n_updates_small_packing_bound { Felt252::ZERO } else { Felt252::ONE }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the other way around
if n_actual_updates < *n_updates_small_packing_bound { Felt252::ZERO } else { Felt252::ONE }; | |
if n_actual_updates < *n_updates_small_packing_bound { Felt252::ONE } else { Felt252::ZERO }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! Fixed this one and the deserialize_output that was comparing the wrong value 💪
#[case(10, 0)] | ||
#[case(255, 0)] | ||
// big updates | ||
#[case(256, 1)] | ||
#[case(1024, 1)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This conditions are also the other way around, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find anything to comment on the code, but the CI tests are failing on the tests test_kzg_da_cairo_0
and test_kzg_da_cairo_1
Those tests depends on some hints that will be merge in the following PRs and that's why they are not passing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome job!!!! LGTM
Upgrade to OS version V0.13.3. This PR includes the minimal changes that are needed to execute SNOS for blocks with the latest OS version.
Changes on deserialization from OS output
Some new hints that are needed for deserialization
Disable test that compares SNOS with reference PIE ---> Need to update the reference PIE with a new one (changes in output structure)
Issue Number: N/A
Type
Description
Breaking changes?