-
Notifications
You must be signed in to change notification settings - Fork 15
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: solana backoff deposit witnessing #5636
Conversation
Codecov ReportAttention: Patch coverage is 📢 Thoughts on this report? Let us know! |
81b0ef1
to
1fb1070
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!
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.
Looking good! One question for my understanding: are we sure that the engines are voting for each statechain block?
Ok(!((current_state_chain_block_number.clone() > | ||
last_channel_opened_at + backoff_settings.backoff_after_blocks) && | ||
(current_state_chain_block_number.clone() % backoff_settings.backoff_frequency != | ||
Zero::zero()))) |
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 would probably be more readable if we apply the negation to the clauses:
(current <= opened + backoff) || (current % freq == zero)
Good question. The answer is no. You're asking because when we backoff, we have to have got the elections at that particular block in order for the mod = 0 condition to be true? ... I thought about it, and figured given this is a kinda of backup case anyway, as in, we assume we deposit in the first hour anyway, then a potential added 10 minute delay isn't that bad. Plus, it's quite unlikely we hit this case given we query every 6 seconds anyway. |
Why would we miss an election at a particular block? isn't the engine processing all the state-chain blocks? 🤔 |
You're right actually. Was thinking about submission. But for processing of the data we use the unfinalised stream, so even better :)
if let Some(block_info) = unfinalized_block_stream.next() => { |
d086341
to
333cbfa
Compare
I'm not sure whether this changes things, if we start processing the data for some block with
I agree with this though. |
9ff3436
to
00eb5fa
Compare
00eb5fa
to
4f151cb
Compare
336d7a0
to
cda1157
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.
I feel like there's something a little leaky about the abstraction here... maybe there's a better way to tackle this?
(Not saying I know what it is, just that something doesn't feel quite right here)
Basically, it feels like this is neither encapsulated in the abstraction layer of electoral systems, nor fully hidden inside the implementation of the election. It sort of exists in both, but is not useful in either piece individually.
Pull Request
Closes: PRO-1984
Checklist
Please conduct a thorough self-review before opening the PR.
Summary
This will drastically reduce the number of RPC requests related to deposit witnessing. We can probably do something similar for egress witnessing too.