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

chore(blockifier, native_blockifier): update versioned constants #559

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

amosStarkware
Copy link
Contributor

@amosStarkware amosStarkware commented Aug 22, 2024

This change is Reviewable

@amosStarkware amosStarkware self-assigned this Aug 22, 2024
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

Attention: Patch coverage is 63.63636% with 4 lines in your changes missing coverage. Please review.

Project coverage is 76.43%. Comparing base (ddc8f51) to head (0b13111).
Report is 1 commits behind head on main-v0.13.2.

Files Patch % Lines
crates/native_blockifier/src/py_objects.rs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           main-v0.13.2     #559      +/-   ##
================================================
+ Coverage         76.38%   76.43%   +0.04%     
================================================
  Files               316      316              
  Lines             34282    34263      -19     
  Branches          34282    34263      -19     
================================================
+ Hits              26188    26190       +2     
+ Misses             5817     5797      -20     
+ Partials           2277     2276       -1     

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

@amosStarkware amosStarkware force-pushed the amos/update_versioned_constants branch from d83a3aa to 9189079 Compare August 22, 2024 09:17
@amosStarkware amosStarkware changed the base branch from main-v0.13.2 to amos/convert_general_config_to_os_config August 22, 2024 09:17
@amosStarkware amosStarkware force-pushed the amos/convert_general_config_to_os_config branch from 3c2a46d to 380a783 Compare August 22, 2024 09:22
@amosStarkware amosStarkware force-pushed the amos/update_versioned_constants branch 3 times, most recently from 7f1b309 to 0d617f4 Compare August 25, 2024 10:06
Copy link
Contributor Author

@amosStarkware amosStarkware left a comment

Choose a reason for hiding this comment

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

+reviewer:@dorimedini-starkware +reviewer:@Yonatan-Starkware

Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @dorimedini-starkware and @Yonatan-Starkware)

@amosStarkware amosStarkware requested review from Yoni-Starkware and removed request for Yonatan-Starkware August 25, 2024 12:30
Copy link
Contributor Author

@amosStarkware amosStarkware left a comment

Choose a reason for hiding this comment

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

-reviewer:@Yonatan-Starkware +reviewer:@Yoni-Starkware

Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @dorimedini-starkware and @Yoni-Starkware)

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @amosStarkware and @Yoni-Starkware)


crates/blockifier/src/versioned_constants.rs line 746 at r1 (raw file):

    pub max_recursion_depth: usize,
    pub invoke_tx_max_n_steps: Option<u32>,
}

why is only one field optional here?

I would expect either:

  1. make all three optional (and override only what is Some, as you do above)
  2. make none optional, and force the caller to override all three (if the caller needs only one override, the caller can explicitly put the defaults in the other two fields)

I personally prefer (2)

Code quote:

pub struct VersionedConstantsOverrides {
    pub validate_max_n_steps: u32,
    pub max_recursion_depth: usize,
    pub invoke_tx_max_n_steps: Option<u32>,
}

crates/blockifier/src/versioned_constants_test.rs line 97 at r1 (raw file):

/// Assert versioned constants overrides are used when provided.
#[test]
fn test_versioned_constants_overrides() {

parametrize all three fields with #[values] in this test? or is it redundant?

Code quote:

#[test]
fn test_versioned_constants_overrides() {

crates/native_blockifier/src/py_objects.rs line 53 at r1 (raw file):

    pub max_recursion_depth: usize,
    pub invoke_tx_max_n_steps: Option<u32>,
}

see above: I think either all optional or none optional

Code quote:

pub struct PyVersionedConstantsOverrides {
    pub validate_max_n_steps: u32,
    pub max_recursion_depth: usize,
    pub invoke_tx_max_n_steps: Option<u32>,
}

@amosStarkware amosStarkware force-pushed the amos/update_versioned_constants branch 2 times, most recently from 6500b49 to dc56135 Compare August 26, 2024 07:42
Copy link
Contributor Author

@amosStarkware amosStarkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 3 files reviewed, 3 unresolved discussions (waiting on @dorimedini-starkware and @Yoni-Starkware)


crates/blockifier/src/versioned_constants.rs line 746 at r1 (raw file):

Previously, dorimedini-starkware wrote…

why is only one field optional here?

I would expect either:

  1. make all three optional (and override only what is Some, as you do above)
  2. make none optional, and force the caller to override all three (if the caller needs only one override, the caller can explicitly put the defaults in the other two fields)

I personally prefer (2)

Done.


crates/blockifier/src/versioned_constants_test.rs line 97 at r1 (raw file):

Previously, dorimedini-starkware wrote…

parametrize all three fields with #[values] in this test? or is it redundant?

I added the other values to the test - no need for parameterising IMO


crates/native_blockifier/src/py_objects.rs line 53 at r1 (raw file):

Previously, dorimedini-starkware wrote…

see above: I think either all optional or none optional

Done.

Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)

@amosStarkware amosStarkware force-pushed the amos/update_versioned_constants branch from dc56135 to 8aae73b Compare August 26, 2024 10:04
@amosStarkware amosStarkware changed the base branch from amos/convert_general_config_to_os_config to main-v0.13.2 August 26, 2024 10:04
@amosStarkware amosStarkware force-pushed the amos/update_versioned_constants branch from 8aae73b to 0b13111 Compare August 26, 2024 10:52
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)

@amosStarkware amosStarkware merged commit 29f90d3 into main-v0.13.2 Aug 26, 2024
14 checks passed
@amosStarkware amosStarkware deleted the amos/update_versioned_constants branch August 26, 2024 11:04
@github-actions github-actions bot locked and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants