-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: reth db diff #3917
feat: reth db diff #3917
Conversation
Could this be replaced by some form of |
that makes sense, changed it to |
c739ac1
to
0cfd3d2
Compare
fd5401c
to
27c214c
Compare
Codecov Report
... and 30 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
I like this feature,
impl is well documented.
bin/reth/src/db/diff.rs
Outdated
} | ||
|
||
impl Command { | ||
/// Execute `db diff` command |
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.
I'd like some docs about what diff exactly does behind the scenes
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.
just added a comment that is hopefully sufficient
} | ||
|
||
/// Find diffs for a table, then analyzing the result | ||
fn find_diffs<'a, T: Table>( |
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.
we call this a lot with all tables, which likely generates a lot of code due to how big the functions is.
we make it less generic over T, but we still new value etc.
so probably not worth the effort imo
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.
yeah, because cursor_read
is generic over T, I'm not sure this can be simplified much further, even in code size, especially since we want to do this for every possible table
This adds a command,
reth db diff
, which is able to diff two reth databases, either a full DB diff or table-by-table.Command line output example:
Example of extra-element output (no discrepancies but a table has an extra element):
And discrepancy output: