-
Notifications
You must be signed in to change notification settings - Fork 11
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: store witness safety margins on SC #4260
Conversation
PRO-983 CFE Reads SC Constant for safety margin
We want the safety margin for each chain to be a
Out of scope:
The values for these on each public network should be: Perseverance: 5 Mainnet: 2 (There was a long discussion about this, the tl;dr is that reorgs greater than 2 blocks are very rare on mainnet, and when there is, the chances are that there's a reorg where there's a tx removed entirely is even rarer). On localnets we can probably bring this down to 2 too - and decrease the ETH margin for localnets while we can too, this should speed up localnets / CI quite a bit. |
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 will also need a migration. You can see the state-chain/pallets/cf-ingress-egress/src/migrations/ingress_expiry.rs
migration for one way to do this to set different values for the different instances of the instantiable pallets
also note that this PR: #4258 which will probably be merged today, changes the migration process slightly. It doesn't change anything to do with writing the migration file itself along with the pre and post hooks, as in the example above.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #4260 +/- ##
=====================================
- Coverage 72% 71% -0%
=====================================
Files 385 385
Lines 63554 63622 +68
Branches 63554 63622 +68
=====================================
+ Hits 45448 45479 +31
- Misses 15749 15797 +48
+ Partials 2357 2346 -11 ☔ View full report in Codecov by Sentry. |
5a6b359
to
e63e9b8
Compare
Added assertions so that the migration can be tested, and checked it with |
Pull Request
Closes: PRO-983
Checklist
Please conduct a thorough self-review before opening the PR.
Summary
As discussed, used storage itmes instead of constants so we can have different values depending on the network. Everything expect for Perseverance is set to 2 blocks (it is 5 blocks on Perseverance as requested in PRO-983)