-
Notifications
You must be signed in to change notification settings - Fork 40
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: adds withdrawal finalizing logic. #56
Conversation
40851b2 adds initial implementation of finalizer that migrates data from watcher table into |
config.batch_finalization_gas_limit, | ||
); | ||
|
||
let finalizer = finalizer::Finalizer::new( |
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.
Now it became a bit confusing:
We have WithdrawalFinalizer
and Finalizer
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.
Let's choose the proper names for all components
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.
Yes I wanted to do rename in another patch not to bloat this one
let is_finalized = self | ||
.is_withdrawal_finalized(event.tx_hash, index, event.token) | ||
.await?; | ||
let is_finalized = false; |
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 is it always false?
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.
This field is being retied as all relevant info now lives in finalization_data
table. Hoever I believe that we cannot delete this field since it would be breaking?
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.
So, I think in terms of the stage of the project we can.
We can't afford a nonworking state keeper.
But here it's better to have less legacy
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.
column removed in d667fc3
finalizer/src/lib.rs
Outdated
|
||
// process withdrawals that have been predicted as unsuccessful. | ||
// | ||
// there may be two reasons for such predictions: |
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.
It's just the main reasons.
But it also possible, that ERC20 contract reject those txs for some internal reasons
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.
Micro nit
finalizer/src/lib.rs
Outdated
where | ||
M2: ZksyncMiddleware + 'static, | ||
{ | ||
let migrator_handle = tokio::spawn(params_fetcher_loop(self.pgpool.clone(), middleware)); |
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.
still migrator
No description provided.