-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(stages): sender recovery stage progress #2910
Conversation
edf3394
to
af6663d
Compare
a750555
to
fc7528d
Compare
af6663d
to
b8820bc
Compare
@@ -145,8 +149,18 @@ impl<DB: Database> Stage<DB> for SenderRecoveryStage { | |||
} | |||
} | |||
|
|||
// Drop cursors, so we can get mutable tx borrow for stage progress calculation |
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.
why does it need to be mut?
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.
oops there's actually no need, fixed in other stages too
} | ||
} | ||
|
||
fn stage_progress<DB: Database>( |
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.
should we define this on the trait level once we implement it for all of the stages?
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.
not sure because only 3 stages use this approach with calculating total entries in different tables. For others, we increment/decrement processed
according to changes in the stage execution/unwind.
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.
what definition on trait level do you have in mind? maybe I misunderstood
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 in general, every stage must implement stage_progress
/stage_checkpoint
method. the implementation details are up to the respective stage
fc7528d
to
8530b0d
Compare
8530b0d
to
fc7528d
Compare
fc7528d
to
4785b20
Compare
760fd23
to
0926895
Compare
4785b20
to
dcbb2fc
Compare
f22a694
to
c91dbe8
Compare
dcbb2fc
to
3fd3df6
Compare
c91dbe8
to
12ae48a
Compare
12ae48a
to
3879a36
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.
lgtm overall, shall we get rid of progress
terminology all together? let's rename the stage_progress
fns to stage_checkpoint
073b209
to
b0027b8
Compare
@rkrasiuk sg. In hashing stages, renamed to |
569a215
to
1b43946
Compare
Continuing with the same idea as in #2820, we calculate progress for Sender Recovery stage based on the number of entries in the
TxSenders
table vs number of entries in theTransactions
table. Both contain only canonical transactions, so it should be correct.