-
Notifications
You must be signed in to change notification settings - Fork 0
chore(skeleton): add new ctor to PathToBottom #188
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
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #188 +/- ##
==========================================
+ Coverage 61.74% 62.83% +1.08%
==========================================
Files 36 36
Lines 1660 1816 +156
Branches 1660 1816 +156
==========================================
+ Hits 1025 1141 +116
- Misses 585 623 +38
- Partials 50 52 +2 ☔ 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 14 files at r1, all commit messages.
Reviewable status: 5 of 14 files reviewed, 2 unresolved discussions (waiting on @TzahiTaub)
crates/committer/src/patricia_merkle_tree/node_data/errors.rs
line 15 at r1 (raw file):
}, #[error("EdgePath {path:?} is too long for EdgePathLength {length:?}.")]
no newline between error variants (for consistency with everyone else)
Suggestion:
},
#[error("EdgePath {path:?} is too long for EdgePathLength {length:?}.")]
crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs
line 95 at r1 (raw file):
} #[non_exhaustive]
ok this doesn't work
Code quote:
#[non_exhaustive]
b9cfc2d
to
bef17f8
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: 5 of 14 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @TzahiTaub)
crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs
line 95 at r1 (raw file):
Previously, dorimedini-starkware wrote…
ok this doesn't work
:)
6484a6a
to
d21a176
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 8 of 14 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @TzahiTaub)
crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs
line 107 at r2 (raw file):
/// Creates a new [PathToBottom] instance. // Asserts the path is not longer than the length. pub fn new(path: EdgePath, length: EdgePathLength) -> Result<Self, PathToBottomError> {
define a type for this (usages below)
Suggestion:
PathToBottomResult
crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs
line 154 at r2 (raw file):
_fake_field: (), } }
Suggestion:
pub(crate) fn concat_paths(&self, other: Self) -> PathToBottomResult {
Self::new(
EdgePath::from((self.path.0 << other.length.0) + other.path.0),
self.length + other.length,
)
}
crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs
line 160 at r2 (raw file):
&self, n_edges: EdgePathLength, ) -> Result<Self, PathToBottomError> {
Suggestion:
PathToBottomResult
crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs
line 171 at r2 (raw file):
length: self.length - n_edges, _fake_field: (), })
Suggestion:
Self::new(
EdgePath(self.path.0 >> n_edges.0),
self.length - n_edges,
)
crates/committer/src/storage/errors.rs
line 28 at r2 (raw file):
EdgePathError(#[from] EdgePathError), #[error("Illegal PathToBottom: {0}")] PathToBottomError(#[from] PathToBottomError),
while you're here... these should be transparent
Suggestion:
#[error(transparent)]
ParsingError(#[from] serde_json::Error),
#[error(transparent)]
EdgePathError(#[from] EdgePathError),
#[error(transparent)]
PathToBottomError(#[from] PathToBottomError),
d21a176
to
cd30cc9
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: all files reviewed, 5 unresolved discussions (waiting on @dorimedini-starkware)
crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs
line 107 at r2 (raw file):
Previously, dorimedini-starkware wrote…
define a type for this (usages below)
Done.
crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs
line 154 at r2 (raw file):
_fake_field: (), } }
Not sure if its better to expect inside the concat function, as concatenation of two valid PathToBottoms should be a valid PathToBottom (unless they are too long together, but I think this will panic with u8 overflow and won't raise an error in any case). WDYT?
crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs
line 160 at r2 (raw file):
&self, n_edges: EdgePathLength, ) -> Result<Self, PathToBottomError> {
Done.
crates/committer/src/patricia_merkle_tree/node_data/inner_node.rs
line 171 at r2 (raw file):
length: self.length - n_edges, _fake_field: (), })
Done.
crates/committer/src/storage/errors.rs
line 28 at r2 (raw file):
Previously, dorimedini-starkware wrote…
while you're here... these should be transparent
Done.
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 2 of 2 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub)
This change is