-
Notifications
You must be signed in to change notification settings - Fork 25
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
refactor(batcher): make versioned_constants_overrides field optional in BlockBuilderConfig #1832
refactor(batcher): make versioned_constants_overrides field optional in BlockBuilderConfig #1832
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @ArniStarkware and the rest of your teammates on Graphite |
Replaces #1414. |
Artifacts upload triggered. View details here |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1832 +/- ##
===========================================
+ Coverage 40.10% 55.84% +15.73%
===========================================
Files 26 153 +127
Lines 1895 17640 +15745
Branches 1895 17640 +15745
===========================================
+ Hits 760 9851 +9091
- Misses 1100 7349 +6249
- Partials 35 440 +405 ☔ View full report in Codecov by Sentry. |
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.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware and @Yael-Starkware)
crates/blockifier/src/versioned_constants.rs
line 328 at r1 (raw file):
/// Returns the latest versioned constants, applying the given overrides if provided. pub fn latest_with_overrides(
do you think this function will be used in other places? why not use if,else in BlockBuilderFactory
Code quote:
latest_with_overrides
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.
Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @Yael-Starkware)
crates/blockifier/src/versioned_constants.rs
line 328 at r1 (raw file):
Previously, ayeletstarkware (Ayelet Zilber) wrote…
do you think this function will be used in other places? why not use if,else in
BlockBuilderFactory
Yes. It seems very useful to me.
(My master plan is to squash latest_with_overrides
, get_versioned_constants
, latest_constants_with_overrides
together - if this is the case - I want them all to be close to each other).
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.
Reviewed 3 of 3 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yael-Starkware)
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.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ArniStarkware)
crates/batcher/src/block_builder.rs
line 143 at r1 (raw file):
dump } }
lets move this to be under the BlockBuilderConfig struct
Code quote:
impl Default for BlockBuilderConfig {
fn default() -> Self {
Self {
// TODO: update the default values once the actual values are known.
chain_info: ChainInfo::default(),
execute_config: TransactionExecutorConfig::default(),
bouncer_config: BouncerConfig::default(),
sequencer_address: ContractAddress::default(),
use_kzg_da: true,
tx_chunk_size: 100,
versioned_constants_overrides: None,
}
}
}
impl SerializeConfig for BlockBuilderConfig {
fn dump(&self) -> BTreeMap<ParamPath, SerializedParam> {
let mut dump = append_sub_config_name(self.chain_info.dump(), "chain_info");
dump.append(&mut append_sub_config_name(self.execute_config.dump(), "execute_config"));
dump.append(&mut append_sub_config_name(self.bouncer_config.dump(), "bouncer_config"));
dump.append(&mut BTreeMap::from([ser_param(
"sequencer_address",
&self.sequencer_address,
"The address of the sequencer.",
ParamPrivacyInput::Public,
)]));
dump.append(&mut BTreeMap::from([ser_param(
"use_kzg_da",
&self.use_kzg_da,
"Indicates whether the kzg mechanism is used for data availability.",
ParamPrivacyInput::Public,
)]));
dump.append(&mut BTreeMap::from([ser_param(
"tx_chunk_size",
&self.tx_chunk_size,
"The size of the transaction chunk.",
ParamPrivacyInput::Public,
)]));
dump.append(&mut ser_optional_sub_config(
&self.versioned_constants_overrides,
"versioned_constants_overrides",
));
dump
}
}
crates/blockifier/src/versioned_constants.rs
line 313 at r1 (raw file):
pub fn get_versioned_constants( versioned_constants_overrides: VersionedConstantsOverrides, ) -> Self {
why nor make this function get an option directly instead of having another function to wrap it?
Code quote:
pub fn get_versioned_constants(
versioned_constants_overrides: VersionedConstantsOverrides,
) -> Self {
…in BlockBuilderConfig
a1c02ec
to
8dd7366
Compare
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.
Reviewable status: 0 of 3 files reviewed, 2 unresolved discussions (waiting on @ayeletstarkware and @Yael-Starkware)
crates/batcher/src/block_builder.rs
line 143 at r1 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
lets move this to be under the BlockBuilderConfig struct
Done.
crates/blockifier/src/versioned_constants.rs
line 313 at r1 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
why nor make this function get an option directly instead of having another function to wrap it?
This is a topic for another PR.
I claim these other instances (of get_versioned_constants
) should be examined further and potentially refactored. I do not want to complicate this PR any further.
Added a TODO.
Artifacts upload triggered. View details here |
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.
Reviewed 3 of 3 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ayeletstarkware)
No description provided.