starknet_patricia_storage: move is_gatherable to ReadOnlyStorage#14280
Conversation
a4466a7 to
a5ac682
Compare
6209862 to
17d61f2
Compare
PR SummaryLow Risk Overview Each backend and wrapper now implements the hook on Reviewed by Cursor Bugbot for commit 22fbbee. Bugbot is set up for automated code reviews on this repo. Configure here. |
a5ac682 to
320dff3
Compare
17d61f2 to
4d43ae3
Compare
320dff3 to
e126a94
Compare
831d5cf to
6b3eb36
Compare
e126a94 to
50bbdd5
Compare
a3f03fc to
5b37897
Compare
1741bec to
263e820
Compare
5b37897 to
48b3a2f
Compare
2534a7d to
c698d25
Compare
48b3a2f to
75e57b6
Compare
c698d25 to
b9f4b32
Compare
75e57b6 to
9114559
Compare
b9f4b32 to
ad400eb
Compare
9114559 to
5326f1b
Compare
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs reviewed 8 files and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ArielElp).
crates/starknet_patricia_storage/src/map_storage.rs line 305 at r1 (raw file):
} // TODO(Nimrod): Find a way to share the implementation with `ImmutableReadOnlyStorage`.
Mark as done?
Code quote:
// TODO(Nimrod): Find a way to share the implementation with `ImmutableReadOnlyStorage`.
ArielElp
left a comment
There was a problem hiding this comment.
@ArielElp made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on yoavGrs).
crates/starknet_patricia_storage/src/map_storage.rs line 305 at r1 (raw file):
Previously, yoavGrs wrote…
Mark as done?
I don't think it's related to the change. This one is about attempting to use the logic of ImmutableReadOnlyStorage's get in get_mut so that it looks something like:
- immutable get
- update cache
5326f1b to
e1d16c6
Compare
ad400eb to
0d7ef4c
Compare
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on ArielElp).
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware reviewed 8 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on ArielElp).
crates/starknet_patricia_storage/src/two_layer_storage.rs line 75 at r1 (raw file):
fn as_gatherable_storage(&mut self) -> Option<&mut impl GatherableStorage> { None::<&mut NullStorage> }
add a docstring remarking why this type should not return Some please
Code quote:
fn as_gatherable_storage(&mut self) -> Option<&mut impl GatherableStorage> {
None::<&mut NullStorage>
}crates/starknet_patricia_storage/src/reads_collector_storage.rs line 51 at r1 (raw file):
fn as_gatherable_storage(&mut self) -> Option<&mut impl GatherableStorage> { None::<&mut NullStorage> }
am i right?
Suggestion:
/// This type is intended to be the gather *target*; do not spawn gatherable instances.
fn as_gatherable_storage(&mut self) -> Option<&mut impl GatherableStorage> {
None::<&mut NullStorage>
}0d7ef4c to
7e41fc2
Compare
e1d16c6 to
cf047d5
Compare
ArielElp
left a comment
There was a problem hiding this comment.
@ArielElp made 2 comments.
Reviewable status: 7 of 8 files reviewed, 2 unresolved discussions (waiting on dorimedini-starkware and yoavGrs).
crates/starknet_patricia_storage/src/reads_collector_storage.rs line 51 at r1 (raw file):
Previously, dorimedini-starkware wrote…
am i right?
I'm not sure wdym by "the gather target". gather has a default implementation that is running tasks and collecting reads via the ReadsCollectorStorage wrapper, but there is nothing inherent in this behavior. Any storage (well, except TwoLayerStorage) can be gatherable; we only did it for types we intend to use in that way.
crates/starknet_patricia_storage/src/two_layer_storage.rs line 75 at r1 (raw file):
Previously, dorimedini-starkware wrote…
add a docstring remarking why this type should not return
Someplease
Done.
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ArielElp).
crates/starknet_patricia_storage/src/reads_collector_storage.rs line 51 at r1 (raw file):
Previously, ArielElp wrote…
I'm not sure wdym by "the gather target".
gatherhas a default implementation that is running tasks and collecting reads via theReadsCollectorStoragewrapper, but there is nothing inherent in this behavior. Any storage (well, except TwoLayerStorage) can be gatherable; we only did it for types we intend to use in that way.
we use "gatherable" storage to spawn separate storage readers which separately cache reads, so they can be collected via ReadsCollectorStorage; this is why making ReadCollectorStorage gatherable is redundant, no?
ArielElp
left a comment
There was a problem hiding this comment.
@ArielElp made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware).
crates/starknet_patricia_storage/src/reads_collector_storage.rs line 51 at r1 (raw file):
Previously, dorimedini-starkware wrote…
we use "gatherable" storage to spawn separate storage readers which separately cache reads, so they can be collected via ReadsCollectorStorage; this is why making ReadCollectorStorage gatherable is redundant, no?
This is what we use it for in practice, but the notion of gatherable is "run a bunch of tasks concurrently". We don't need to do it with ReadsCollectorStorage, as it's just an implementation detail of the default gather logic, but we could do it in the future for some reason.
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on ArielElp).
crates/starknet_patricia_storage/src/reads_collector_storage.rs line 51 at r1 (raw file):
Previously, ArielElp wrote…
This is what we use it for in practice, but the notion of gatherable is "run a bunch of tasks concurrently". We don't need to do it with ReadsCollectorStorage, as it's just an implementation detail of the default
gatherlogic, but we could do it in the future for some reason.
it would be best to add a remark to explain why it's Null. it can be
/// It's possible to implement [GatherableStorage] on [Self] but it currently has no use case.
cf047d5 to
22fbbee
Compare
ArielElp
left a comment
There was a problem hiding this comment.
@ArielElp made 1 comment.
Reviewable status: 7 of 8 files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware and yoavGrs).
crates/starknet_patricia_storage/src/reads_collector_storage.rs line 51 at r1 (raw file):
Previously, dorimedini-starkware wrote…
it would be best to add a remark to explain why it's Null. it can be
/// It's possible to implement [GatherableStorage] on [Self] but it currently has no use case.
Added, WDYT?
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on ArielElp).

No description provided.