-
Notifications
You must be signed in to change notification settings - Fork 38
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
Several NeoFS chain autodeploy/update fixes #2683
Conversation
Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #2683 +/- ##
==========================================
- Coverage 30.08% 28.49% -1.60%
==========================================
Files 406 413 +7
Lines 30182 31961 +1779
==========================================
+ Hits 9081 9108 +27
- Misses 20320 22073 +1753
+ Partials 781 780 -1 ☔ View full report in Codecov by Sentry. |
167612c
to
0a8be85
Compare
0a8be85
to
7063351
Compare
pkg/morph/deploy/funds.go
Outdated
} | ||
} | ||
|
||
func divideFundsEvenlyU64(fullAmount uint64, n int, f func(ind int, amount uint64)) { |
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.
One version is enough. We can't have more than 100M NEO.
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.
done
7063351
to
078e5ea
Compare
Previously, auto-deploy/update procedure could stuck when committee multi-sig account had less than N amount of NEO, where N is a number of the NeoFS Alphabet accounts in the deployed/update NeoFS network. This was caused by rounding integer division of fund amounts: zero funds were transferred due to which the balance did not change and each iteration did not change the network state. Fix zero transfers and also distribute remainder as evenly as possible to decrease total number of transactions. Fixes #2681. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
Previously, NeoFS chain auto-update procedure calculated nonce and ValidUntilBlock of the update transactions from the latest NeoFS epoch. This could lead to a deadlock if the epochs were not ticking (and this could have various reasons). To prevent such problems and at the same time simplify the formation of transactions, it makes sense to base height parameters on the current blockchain height only. Set nonce/ValidUntilBlock to lower/upper multiple of 100 relative to current height. Fixes #2680. Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
078e5ea
to
6128055
Compare
No description provided.