-
Notifications
You must be signed in to change notification settings - Fork 31
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: post compilation size limit validation #284
feat: post compilation size limit validation #284
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @ArniStarkware and the rest of your teammates on Graphite |
92f1dc5
to
f44f1cf
Compare
229f578
to
b76640a
Compare
f44f1cf
to
f54a4f5
Compare
b76640a
to
fd09b45
Compare
f54a4f5
to
b064637
Compare
fd09b45
to
6840f82
Compare
b064637
to
db6c928
Compare
6840f82
to
593e130
Compare
db6c928
to
bd04a7e
Compare
593e130
to
78f25db
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 all commit messages.
Reviewable status: 0 of 8 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware, @dafnamatsry, and @yair-starkware)
crates/gateway/src/compilation.rs
line 32 at r1 (raw file):
sierra_to_casm_compiler: SierraToCasmCompiler { config: config.sierra_to_casm_compiler_config, },
why the duplication of sierra_to_casm_compiler_config?
Code quote:
config,
sierra_to_casm_compiler: SierraToCasmCompiler {
config: config.sierra_to_casm_compiler_config,
},
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 8 files reviewed, 2 unresolved discussions (waiting on @ArniStarkware, @dafnamatsry, and @yair-starkware)
crates/gateway/src/config.rs
line 242 at r1 (raw file):
pub struct GatewayCompilerConfig { pub sierra_to_casm_compiler_config: SierraToCasmCompilationConfig, pub max_raw_casm_class_size: usize,
the word raw confuses me, I am think about eating steak.
Code quote:
raw
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 8 files reviewed, 2 unresolved discussions (waiting on @ArniStarkware, @dafnamatsry, and @yair-starkware)
crates/gateway/src/config.rs
line 242 at r1 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
the word raw confuses me, I am think about eating steak.
*thinking
bd04a7e
to
c55f0be
Compare
78f25db
to
035c12e
Compare
c55f0be
to
79ec169
Compare
035c12e
to
34b50eb
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 8 files reviewed, 2 unresolved discussions (waiting on @dafnamatsry, @Yael-Starkware, and @yair-starkware)
crates/gateway/src/compilation.rs
line 32 at r1 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
why the duplication of sierra_to_casm_compiler_config?
Done.
Now there is no duplication. - The price is the multiplicity of objects.
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 4 of 8 files at r1, 2 of 3 files at r4, 3 of 3 files at r5, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @ArniStarkware, @Yael-Starkware, and @yair-starkware)
crates/gateway/src/compilation.rs
line 27 at r5 (raw file):
impl GatewayCompiler { pub fn new(config: GatewayCompilerConfig) -> Self {
In the following PR: https://reviewable.io/reviews/starkware-libs/sequencer/319#- you define different initialisation methods. Are you planning to delete this new
later?
Code quote:
pub fn new(config: GatewayCompilerConfig)
crates/gateway/src/config.rs
line 230 at r5 (raw file):
#[derive(Clone, Copy, Debug, Default, Serialize, Deserialize, Validate, PartialEq)] pub struct GatewayCompilerConfig { pub sierra_to_casm_compiler_config: SierraToCasmCompilationConfig,
Maybe better to put it outside of GatewayCompilerConfig
?
The SierraToCasmCompilation
is given to the GatewayCompiler
with a dependency injection (https://reviewable.io/reviews/starkware-libs/sequencer/319#-), so I think it makes sense that it would be outside.
Code quote:
pub sierra_to_casm_compiler_config: SierraToCasmCompilationConfig,
crates/gateway/src/config.rs
line 251 at r5 (raw file):
/// The configuration for the post compilation process in the gateway compiler. #[derive(Clone, Copy, Debug, Serialize, Deserialize, Validate, PartialEq)] pub struct PostCompilationConfig {
Why do we need this extra level of config, and not just define max_raw_casm_class_size
to the GatewayCompilerConfig
?
Code quote:
PostCompilationConfig
feb96da
to
f7d4f8e
Compare
This PR will be restacked over #357. |
f7d4f8e
to
1354412
Compare
Benchmark movements: |
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: 1 of 9 files reviewed, 5 unresolved discussions (waiting on @dafnamatsry, @Yael-Starkware, and @yair-starkware)
crates/gateway/src/compilation.rs
line 27 at r5 (raw file):
Previously, dafnamatsry wrote…
In the following PR: https://reviewable.io/reviews/starkware-libs/sequencer/319#- you define different initialisation methods. Are you planning to delete this
new
later?
Deleted. Replaced with the existing new_cario_lang_compiler
function.
Rebases made this comment had to follow.
crates/gateway/src/config.rs
line 230 at r5 (raw file):
Previously, dafnamatsry wrote…
Maybe better to put it outside of
GatewayCompilerConfig
?
TheSierraToCasmCompilation
is given to theGatewayCompiler
with a dependency injection (https://reviewable.io/reviews/starkware-libs/sequencer/319#-), so I think it makes sense that it would be outside.
Done. See previous PR in the stack. #374.
Now: GatewayCompilerConfig
sits directly in the mempool node config.
crates/gateway/src/config.rs
line 251 at r5 (raw file):
Previously, dafnamatsry wrote…
Why do we need this extra level of config, and not just define
max_raw_casm_class_size
to theGatewayCompilerConfig
?
I think it's cleaner that there is a level with all sub-configs. But it is a taste thing.
I plan to also have other similar numbers in this PostCompilerConfig
level - like the size of the casm-bytecode.
1354412
to
eeb7ac1
Compare
Benchmark movements: |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## graphite-base/284 #284 +/- ##
==================================================
Coverage 76.12% 76.13%
==================================================
Files 329 329
Lines 35241 35288 +47
Branches 35241 35288 +47
==================================================
+ Hits 26826 26865 +39
- Misses 6119 6128 +9
+ Partials 2296 2295 -1 ☔ 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.
Reviewed 5 of 10 files at r6, all commit messages.
Reviewable status: 6 of 11 files reviewed, 5 unresolved discussions (waiting on @ArniStarkware, @Yael-Starkware, and @yair-starkware)
crates/gateway/src/compilation.rs
line 22 at r6 (raw file):
#[derive(Clone)] pub struct GatewayCompiler { config: PostCompilationConfig,
Suggestion:
config: GatewayCompilerConfig,
crates/gateway/src/compilation.rs
line 27 at r6 (raw file):
impl GatewayCompiler { pub fn new_cairo_lang_compiler(config: GatewayCompilerConfig) -> Self {
Once you remove the SierraToCasmCompilationConfig
from the GatewayConfig
you can pass it here as an argument.
crates/gateway/src/config.rs
line 242 at r1 (raw file):
Not critical but: for the future, I prefer you address this kind of comments in the same PR.
This field was introduced in this PR, so merging it and immediately renaming it in a following PR feels like extra work that could have been avoided.
crates/gateway/src/config.rs
line 230 at r5 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
Done. See previous PR in the stack. #374.
Now:
GatewayCompilerConfig
sits directly in the mempool node config.
With the previous PR the SierraToCasmCompilationConfig
sits directly in the mempool node config. So you can remove it from here no?
crates/gateway/src/config.rs
line 251 at r5 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
I think it's cleaner that there is a level with all sub-configs. But it is a taste thing.
I plan to also have other similar numbers in thisPostCompilerConfig
level - like the size of the casm-bytecode.
Ok.
a071e2e
to
12c79b6
Compare
eeb7ac1
to
976f8fb
Compare
12c79b6
to
e6fcc96
Compare
976f8fb
to
ff67b95
Compare
Benchmark movements: |
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: 5 of 11 files reviewed, 5 unresolved discussions (waiting on @dafnamatsry, @Yael-Starkware, and @yair-starkware)
crates/gateway/src/compilation.rs
line 22 at r6 (raw file):
#[derive(Clone)] pub struct GatewayCompiler { config: PostCompilationConfig,
The struct called GatewayCompilerConfig
also holds the config of the SierraToCasmCompiler.
There will be duplication - The GatewayCompiler
will have access to unused info - which is used by the SierraToCasmCompiler
.
Are you sure?
crates/gateway/src/config.rs
line 230 at r5 (raw file):
Previously, dafnamatsry wrote…
With the previous PR the
SierraToCasmCompilationConfig
sits directly in the mempool node config. So you can remove it from here no?
Got it.
Do we want to do something similar with the RpcStateReaderConfig
.
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 10 files at r6, 2 of 2 files at r7, all commit messages.
Reviewable status: 10 of 11 files reviewed, 5 unresolved discussions (waiting on @ArniStarkware, @Yael-Starkware, and @yair-starkware)
crates/gateway/src/compilation.rs
line 22 at r6 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
The struct called
GatewayCompilerConfig
also holds the config of theSierraToCasmCompiler.
There will be duplication - TheGatewayCompiler
will have access to unused info - which is used by theSierraToCasmCompiler
.Are you sure?
I think GatewayCompilerConfig
shouldn't hold the SierraToCasmCompilerConfig
.
A lot of requests regarding this PR. Please Do not review it until I re-publish it. |
This PR is imported into this repo. The original PR: starkware-libs/mempool#298.
Note the stack of PRs has a different order in this repo.
This change is