-
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: ingress-egress tracking for DOT #4121
Conversation
PRO-868 Ingress Egress Tracker
This will/should be broken down into smaller tickets after we've discussed it. Problem: The swapping app currently has to wait for the CFE witnessing and respective confirmation on the SC, both for ingress, when the user is depositing funds, and for egress, when the user is receiving funds. This duration can be quite long, because of the added safety margins to protect against reorgs. Solution: While the reorg safety is important for the protocol it's not important for the product. We can use the same code that we use in the CFE witnessing to avoid duplicating the work, but instead redirect the results of that. Requirements:
Useful info:
Out of scope:
If you have questions for the product team and what they need, you can reach out to nat |
d5c95eb
to
51e6ef8
Compare
Codecov Report
@@ Coverage Diff @@
## main #4121 +/- ##
=====================================
- Coverage 72% 72% -0%
=====================================
Files 378 378
Lines 60637 60663 +26
Branches 60637 60663 +26
=====================================
- Hits 43492 43490 -2
- Misses 14881 14905 +24
- Partials 2264 2268 +4
... and 3 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn 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.
👍
}, | ||
eth_key_path: eth_key_path.into(), | ||
state_chain_ws_endpoint: sc_ws_endpoint, | ||
state_chain_ws_endpoint: env::var("SC_WS_ENDPOINT") |
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 don't have the BTC settings loaded in here, we should probably change that to be consistent... it's weird that the settings are read from environment on each call anyway for BTC. - will create an issue, is separate to this PR: https://linear.app/chainflip/issue/PRO-916/btc-ingress-egress-tracker-settings-to-be-unified-into
+ 'static, | ||
ProcessingFut: Future<Output = ()> + Send + 'static, | ||
{ | ||
let dot_client = { |
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.
no need for this block {}
.egress_items(scope, state_chain_stream.clone(), state_chain_client.clone()) | ||
.await | ||
.then({ | ||
let process_call = witness_call.clone(); |
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.
nit for consistency
let process_call = witness_call.clone(); | |
let witness_call = witness_call.clone(); |
process_egress(epoch, header, process_call.clone(), dot_client.clone()) | ||
} | ||
}) | ||
.logging("DOT Witnessing") |
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.
for consistency
.logging("DOT Witnessing") | |
.logging("witnessing") |
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.
the chain is already logged in the logging adapter which is enough for polkadot
* origin/main: chore: get gas parameters from statechain event (#4125) Feat: ingress-egress tracking for DOT (#4121) add support for hex encoded amounts on limit order and range order methods in LP API (#4120) feat: bouncer command for submitting runtime upgrades (#4122) Feat: ensure correct process termination in ingress/egress tracker (#4101) feat(custom-rpc): add flip balance to account info (#4119) chore: storage migration delete NextCompatibilityVersion (#4115) chore: delete unneeded function (#4116) # Conflicts: # state-chain/runtime/src/lib.rs
Pull Request
Closes: PRO-868
Checklist
Please conduct a thorough self-review before opening the PR.
Summary
Took me a while, but I managed to extract the
proxy_added_witnessing
andprocess_egress
from inside the lamdbas to avoid duplicating logic (it is hard to keep track of types of different variables when everything is implicit, and I needed an extra constraint onExtraHistoricInfo
in dot_deposits to make it work). I then used these functions in the new dot module inside ingress-egress tracking. Tested the engine and the tracking for DOT witnessing on localnet for both ingress and egress.