-
Notifications
You must be signed in to change notification settings - Fork 35
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
feat(starknet_class_manager): adding config to class_manager #3809
Conversation
bf4938e
to
bae685c
Compare
bae685c
to
2263014
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 7 files reviewed, 1 unresolved discussion (waiting on @lev-starkware)
crates/starknet_class_manager/src/class_storage.rs
line 243 at r1 (raw file):
]) } }
Please move to config.rs
.
Code quote:
// TODO(Elin): all this values are actually for papyrus_storage::StorageConfig.
// Check what batcher did for the same config: starknet_batcher/src/config.rs.
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct ClassHashStorageConfig {
pub path_prefix: PathBuf,
pub enforce_file_exists: bool,
pub max_size: usize,
}
impl Default for ClassHashStorageConfig {
fn default() -> Self {
Self {
path_prefix: "/data".into(),
enforce_file_exists: false,
max_size: 1 << 40, // 1TB.
}
}
}
impl SerializeConfig for ClassHashStorageConfig {
fn dump(&self) -> BTreeMap<ParamPath, SerializedParam> {
BTreeMap::from([
ser_param(
"path_prefix",
&self.path_prefix,
"Prefix of the path of the node's storage directory",
ParamPrivacyInput::Public,
),
ser_param(
"enforce_file_exists",
&self.enforce_file_exists,
"Whether to enforce that the path exists.",
ParamPrivacyInput::Public,
),
ser_param(
"max_size",
&self.max_size,
"The maximum size of the node's storage in bytes.",
ParamPrivacyInput::Public,
),
])
}
}
2263014
to
e7f5f0f
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 7 files reviewed, 3 unresolved discussions (waiting on @lev-starkware)
crates/starknet_class_manager/src/class_storage.rs
line 201 at r1 (raw file):
} // TODO(Elin): all this values are actually for papyrus_storage::StorageConfig.
Please:
- move this comment to be near the
impl Default for ClassHashStorageConfig
value - rephrase to
// TODO(Elin): set appropriate default values.
Code quote:
// TODO(Elin): all this values are actually for papyrus_storage::StorageConfig.
crates/starknet_class_manager/src/class_storage.rs
line 202 at r1 (raw file):
// TODO(Elin): all this values are actually for papyrus_storage::StorageConfig. // Check what batcher did for the same config: starknet_batcher/src/config.rs.
Delete this comment please.
Code quote:
// Check what batcher did for the same config: starknet_batcher/src/config.rs.
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 7 files reviewed, 4 unresolved discussions (waiting on @lev-starkware)
crates/starknet_class_manager/src/class_manager.rs
line 27 at r2 (raw file):
storage: S, ) -> Self { let cached_class_storage_config = config.cached_class_storage_config.clone();
Something is misaligned w.r.t. to the config definitions here
If the function requires a storage: S
object then the passed config config: ClassManagerConfig
should not contain config values of that storage, but only values relevant to the component.
There should be 3 config objects as far as I understand:
- a config for the storage (its type should be
CachedClassStorageConfig
, right?). This config is used when creating the storage. - a config for the component (I'd expect its type to be
ClassManagerConfig
, but currently this name represents something else). This config is used for the component ctor, as in this function. - a config holding both 1 and 2 -- this config should be included in the node config (e.g., like the gateway config), and passed to the
create_class_manager
fn.
Code quote:
pub fn new(
config: ClassManagerConfig,
compiler: SharedSierraCompilerClient,
storage: S,
) -> Self {
let cached_class_storage_config = config.cached_class_storage_config.clone();
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 7 files reviewed, 4 unresolved discussions (waiting on @Itay-Tsabary-Starkware)
crates/starknet_class_manager/src/class_manager.rs
line 27 at r2 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Something is misaligned w.r.t. to the config definitions here
If the function requires astorage: S
object then the passed configconfig: ClassManagerConfig
should not contain config values of that storage, but only values relevant to the component.There should be 3 config objects as far as I understand:
- a config for the storage (its type should be
CachedClassStorageConfig
, right?). This config is used when creating the storage.- a config for the component (I'd expect its type to be
ClassManagerConfig
, but currently this name represents something else). This config is used for the component ctor, as in this function.- a config holding both 1 and 2 -- this config should be included in the node config (e.g., like the gateway config), and passed to the
create_class_manager
fn.
This config holds a config for a storage and a config for a cache.
I am adding this config to the node_config in the next PR.
crates/starknet_class_manager/src/class_storage.rs
line 201 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Please:
- move this comment to be near the
impl Default for ClassHashStorageConfig
value- rephrase to
// TODO(Elin): set appropriate default values.
Done.
crates/starknet_class_manager/src/class_storage.rs
line 202 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Delete this comment please.
Done.
crates/starknet_class_manager/src/class_storage.rs
line 243 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
Please move to
config.rs
.
Done.
e7f5f0f
to
e47265d
Compare
commit-id:5fb70d46
e47265d
to
42bcb8f
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.
Reviewed 3 of 7 files at r1, 1 of 3 files at r2, 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lev-starkware)
crates/starknet_class_manager/src/class_manager.rs
line 27 at r2 (raw file):
Previously, lev-starkware wrote…
This config holds a config for a storage and a config for a cache.
I am adding this config to the node_config in the next PR.
I am not convinced, but let's handle that later.
✓ Commit merged in pull request #3839 |
Stack: