-
Notifications
You must be signed in to change notification settings - Fork 503
TxPause&SafeMode for Astar #1501
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
Conversation
ashutoshvarma
left a comment
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.
looks good!
Do we want to add integration tests for it?
ipapandinas
left a comment
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, thanks for opening issue #1503
ashutoshvarma
left a comment
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
| | RuntimeCall::TechnicalCommittee(_) | ||
| | RuntimeCall::Sudo(_) | ||
| | RuntimeCall::Democracy( | ||
| pallet_democracy::Call::external_propose_majority { .. } |
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.
don't we need vote?
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've thought about that but decided to exclude it since it's not a privileged action.
In a recent exploit scenario, the problematic account could have voted to put funds into locked state, which would be problematic for us. This is why it's blocked.
Rest of the whitelisted calls are all privileged ones, that require collective agreement.
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.
@ermalkaleci I've allowed Vote and added a comprehensive integration test to demonstrate the full flow of how recovery would go.
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.
@Dinonard we may want to allow proxy as well
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.
@Dinonard do we need to allow oracle?
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.
Preimage as well
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.
Multisig?
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 preimage, sure, makes sense if we want to run referendum.
Multisig can also be alloed, since the embedded calls will be filtered again.
For oracle, I'm not sure.
We can allow them, but keep the option to block those calls using tx-pause I guess.
EDIT: added, thanks for the suggestion
|
/bench astar |
|
Benchmark job failed. |
|
/bench astar pallet_inflation |
|
Benchmarks job is scheduled at https://github.com/AstarNetwork/Astar/actions/runs/16437771685. |
|
Benchmarks have been finished. |
PierreOssun
left a comment
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
| | b"Council" | ||
| | b"TechnicalCommittee" | ||
| | b"Sudo" | ||
| | b"TxPause" |
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.
Same for the tx-pause pallet, its own calls are always allowed.
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 know, but wanted to add it here for completeness, irrelevant of the implementation details.
I could remove it.
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.
Thanks for the explanation, I don't have a strong opinion, we can keep it
| ) | ||
| | RuntimeCall::Proxy(_) | ||
| | RuntimeCall::TxPause(_) | ||
| | RuntimeCall::SafeMode(_) => true, |
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 safe-mode pallet always allows its own calls.
|
|
||
| // Now use main council to extend safe mode | ||
| let safe_mode_extend_call = RuntimeCall::SafeMode(pallet_safe_mode::Call::force_extend {}); | ||
| propose_vote_and_close!(Council, safe_mode_extend_call, 0); |
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.
Do we want to check the correct extension against the configuration param? This can be done by reading enteredUntil storage value.
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 want to avoid checking pallet's implementation details.
If duration doesn't properly work, it's not something for integration tests to discover IMO.
| type RuntimeCall = RuntimeCall; | ||
| type PauseOrigin = EnsureRootOrHalfTechCommitteeOrTwoThirdCouncil; | ||
| type UnpauseOrigin = EnsureRootOrHalfTechCommitteeOrTwoThirdCouncil; | ||
| type WhitelistedCalls = TxPauseWhitelistedCalls; |
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.
When I've added tx_pause into Shibuya, I didn't specified whitelisting on purpose, reference: #1388 (comment)
In fact, I've just removed the
TxPauseWhitelistedCallstype and itsContainstrait implementation.tx-pauseis more granular, we should be able to pause any call in an emergency.
But I guess you're adding it now on purpose to avoid being stuck?
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 haven't checked this, but thanks for the reminder.
I've added it since Pierre commented it, and avoiding being stuck just came as an extra reason later.
ipapandinas
left a comment
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
|
@ermalkaleci @ashutoshvarma can you please also check & think about more possible problematic scenarios? |
Minimum allowed line rate is |
ermalkaleci
left a comment
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
|
Merging it since I got approval from everyone, at least once 🙂 |
Pull Request Summary
Introduces safe mode & tx pause support for Astar.