-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Xpan auto retry limit #10178
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
Open
xpanvictor
wants to merge
11
commits into
paritytech:master
Choose a base branch
from
xpanvictor:xpan-auto_retry_limit
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Xpan auto retry limit #10178
Changes from 6 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6f28bdc
feat(pallet-broker): add auto-renewal retry limit with counter reset
xpanvictor 948b1b9
fix(test): auto_renewal_works expectation for failed renewal reassign…
xpanvictor 4f848ce
fix(pallet-broker): renew_cores reset on success as well
xpanvictor 2f244de
Update from github-actions[bot] running command 'prdoc'
github-actions[bot] 112c8d8
Update pr_10178.prdoc
xpanvictor 44071d6
feat(runtime): add coretime config to coretime-westend and coretime-r…
xpanvictor dbc004f
Update prdoc/pr_10178.prdoc
xpanvictor dbaab25
Update prdoc/pr_10178.prdoc
xpanvictor aabff6a
fix(broker): use u8 for maxautorenewalretries
xpanvictor c5a3e34
fix(broker): remove the config renewal type
xpanvictor 993ea61
fix(broker): use u8 directly as counter type for autorenewalretries
xpanvictor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| title: Xpan auto retry limit | ||
| doc: | ||
| - audience: Runtime Dev | ||
| description: |- | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can probably just leave the description |
||
| BREAKING CHANGE: runtime must define `MaxAutoRenewalRetries` | ||
|
|
||
| Fixes #9548 | ||
| Problem: After auto-renewal fails due to some error, the system disables autorenewal entirely contrary to the documentation. | ||
| Solution: A more robust retry which is configurable in the pallet config. This is compile time setting currently. | ||
| Introduce `T::MaxAutoRenewalRetries` constant in `Config` trait track retry count in `AutoRenewalRetries` storage map, increment on each failed renewal attempt. When retries >= max, emit `AutoRenewalFailed`, remove auto-renew record, and reset counter to 0. Add integration tests: | ||
| - persistent retry when count < max | ||
| - record removal when count >= max | ||
|
|
||
| ## Integration | ||
| Downstream projects using pallet-broker must define `MaxAutoRenewalRetries` config. They just need to pass a retries limit. Can be set to `0` for no retry. This is similar to current logic. | ||
|
|
||
| ## Review Notes | ||
| ### Changes: | ||
| 1. Added `MaxAutoRenewalRetries` to config trait. Default type is `u8`. | ||
| 2. Added a storage for renewal retries record. This increments for failed retries. It resets on success or when renewal is cancelled. | ||
| 3. Existing code needs to add the new configuration parameter. | ||
| 4. Added the config parameter with default `constu8<2>` as in test into `coretime-rococo` and `coretime-westend`. | ||
|
|
||
| # Checklist | ||
|
|
||
| * [x] My PR includes a detailed description as outlined in the "Description" and its two subsections above. | ||
| * [x] My PR follows the [labeling requirements]( | ||
| https://github.com/paritytech/polkadot-sdk/blob/master/docs/contributor/CONTRIBUTING.md#Process | ||
| ) of this project (at minimum one label for `T` required) | ||
| * External contributors: Use `/cmd label <label-name>` to add labels | ||
| * Maintainers can also add labels manually | ||
| * [ ] I have made corresponding changes to the documentation (if applicable) | ||
| * [x] I have added tests that prove my fix is effective or that my feature works (if applicable) | ||
xpanvictor marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| crates: | ||
| - name: pallet-broker | ||
| bump: major | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.