-
Notifications
You must be signed in to change notification settings - Fork 28
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(papyrus_rpc): get compiled class #2493
refactor(papyrus_rpc): get compiled class #2493
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware and @Yael-Starkware)
crates/papyrus_rpc/src/v0_8/api/api_impl.rs
line 1478 at r1 (raw file):
.sierra_program, ) .unwrap();
why panic here? shouldn't you return an RpcError if the sierra version is unavailable?
Code quote:
.unwrap();
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 @AvivYossef-starkware and @dorimedini-starkware)
crates/papyrus_rpc/src/v0_8/api/api_impl.rs
line 1478 at r1 (raw file):
Previously, dorimedini-starkware wrote…
why panic here? shouldn't you return an RpcError if the sierra version is unavailable?
Doesn't this error fails the declare transaction in the gateway?
crates/papyrus_rpc/src/v0_8/api/api_impl.rs
line 1475 at r1 (raw file):
.get_class(&class_hash) .map_err(internal_server_error)? .ok_or_else(|| ErrorObjectOwned::from(CLASS_HASH_NOT_FOUND))?
does it make sense that the casm exists in storage and the sierra doesn't?
I think this scenario indicates a bug.
Code quote:
ErrorObjectOwned::from(CLASS_HASH_NOT_FOUND)
d1ec273
to
b638c90
Compare
eb75d10
to
3072566
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: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware and @Yael-Starkware)
crates/papyrus_rpc/src/v0_8/api/api_impl.rs
line 1475 at r1 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
does it make sense that the casm exists in storage and the sierra doesn't?
I think this scenario indicates a bug.
Right, Now the get_sierra_and_casm
returns an error if Sierra Xor Casm exist in the server`s storage
crates/papyrus_rpc/src/v0_8/api/api_impl.rs
line 1478 at r1 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
Doesn't this error fails the declare transaction in the gateway?
It should fail because it indicates that the Sierra program is invalid. I think that the internal server error is ok since it indicates we have saved an invalid Sierra program on our server.
b638c90
to
9c10db4
Compare
3072566
to
850fcd1
Compare
9c10db4
to
3f30869
Compare
850fcd1
to
df92693
Compare
3f30869
to
9c1e654
Compare
df92693
to
0aa221d
Compare
9c1e654
to
4068cd0
Compare
0aa221d
to
f0b5b45
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## aviv/add_sierra_version_to_papyrus_cache #2493 +/- ##
===========================================================================
Coverage ? 47.89%
===========================================================================
Files ? 187
Lines ? 23007
Branches ? 23007
===========================================================================
Hits ? 11020
Misses ? 10886
Partials ? 1101 ☔ 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 1 of 1 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (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: complete! all files reviewed, all discussions resolved (waiting on @AvivYossef-starkware)
4068cd0
to
f1edf4a
Compare
f0b5b45
to
5f97fd9
Compare
f1edf4a
to
a4c372e
Compare
5f97fd9
to
2f6028a
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 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware)
crates/papyrus_rpc/src/v0_8/api/api_impl.rs
line 1473 at r4 (raw file):
// Check if both options are `Some`. let (casm, sierra) = option_casm .zip(option_sierra)
it's logic like this that makes me think returning Option<(X, Y)>
is better than returning (Option<X>, Option<Y>)
. this is not possible, since the storage layer can return one None and one Some?
Code quote:
let (option_casm, option_sierra) = storage_txn
.get_casm_and_sierra(&class_hash)
.map_err(internal_server_error_with_msg)?;
// Check if both options are `Some`.
let (casm, sierra) = option_casm
.zip(option_sierra)
a4c372e
to
fd89b79
Compare
2f6028a
to
36e2342
Compare
fd89b79
to
d7a28ec
Compare
cc83787
to
53e73f8
Compare
9e86221
to
31b9b09
Compare
53e73f8
to
e488534
Compare
31b9b09
to
1d07618
Compare
e488534
to
13bef90
Compare
1d07618
to
ea4ebab
Compare
13bef90
to
998c0ba
Compare
ea4ebab
to
2674f68
Compare
998c0ba
to
348f11c
Compare
2674f68
to
0646db2
Compare
348f11c
to
5a28773
Compare
0646db2
to
168ae5f
Compare
5a28773
to
fd172ca
Compare
49cc29a
to
476a794
Compare
fd172ca
to
c1a5904
Compare
c1a5904
to
7efc710
Compare
7efc710
to
3fe6ead
Compare
Artifacts upload workflows: |
Merge activity
|
No description provided.