Skip to content
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

Support old and new reputation type #1664

Merged
merged 14 commits into from
Mar 19, 2024
Merged

Conversation

clangenb
Copy link
Member

@clangenb clangenb commented Mar 18, 2024

The api infers the correct reputation type based on the runtime version's spec name and the spec version. If the chain doesn't support ReputationV2 yet, it will migrate fetched values to V2, where the linked index is going to be the current ceremony index. This essentially preserves the reputation v1 behavior, as any previously linked reputation can't be used again. Closes #1662.

Additionally, I regenerated the polkadart types, as it gave me the draft to use for the new reputation enum.

Tests:

@clangenb clangenb added A0-ux PR changes the UX B0-low Does not elevate a release containing this beyond "low priority" C0-breaksnothing PR does not introduce any breaking changes labels Mar 18, 2024
bool hasNewReputationType(RuntimeVersion version) {
Log.p('Runtime version ${version.toJson()}');
if (version.specName == 'encointer-parachain') {
return version.specVersion >= 1002001;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brenzi here I need your help. On latest master we have version 1002000 but on your pr we also have encointer/encointer-parachain#216 version 1002000, on rococo it is 1002001. Which spec version will be the one that has reputation v2 on Kusama?

Copy link
Member

@brenzi brenzi Mar 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to bump spec version for rococo because the migration wouldn't be applied otherwise. I upgraded two RC's sequentially.

On kusama, 1002000 will be V2
On rococo, 1002000 was V1 1002001 is V2

As we will never see 1002000 on roc again, I think it is safe to assume

=1002000 => V2

@clangenb clangenb merged commit 49e9e81 into master Mar 19, 2024
9 of 11 checks passed
@clangenb clangenb deleted the cl/update-reputation-tzpe branch March 20, 2024 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A0-ux PR changes the UX B0-low Does not elevate a release containing this beyond "low priority" C0-breaksnothing PR does not introduce any breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade reputation enum
2 participants