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

fix(cheqd): cheqd revocationRegistryDefinition resource name #2139

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

DaevMithran
Copy link
Contributor

This PR fixes resource name collisions for revocation registries with different tags.

Creating two revocation registries with same name's will lead to updating the resource. Adding credential definition tag in the resource name will fix this issue

Copy link

changeset-bot bot commented Jan 6, 2025

⚠️ No Changeset found

Latest commit: 2b7b32b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Signed-off-by: DaevMithran <[email protected]>
Copy link
Contributor

@TimoGlastra TimoGlastra left a comment

Choose a reason for hiding this comment

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

Thanks. Some notes

@@ -308,8 +312,8 @@ export class CheqdAnonCredsRegistry implements AnonCredsRegistry {

const revocationRegistryDefinitionResource = {
id: utils.uuid(),
name: credentialDefinitionName as string,
resourceType: 'anonCredsRevocRegDef',
name: `${credentialDefinitionName}-${revocationRegistryDefinition.tag}`,
Copy link
Contributor

Choose a reason for hiding this comment

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

we had issues with long names in the past, for which I think we came up with the solution to hash. Also, does this break already existing revocation registry definitions? Can we resolve both previously created ones, and the new one? And should the spec be updated?

Copy link
Contributor Author

@DaevMithran DaevMithran Jan 6, 2025

Choose a reason for hiding this comment

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

As the credential definition name is hashed already in credo will this still be a problem?

Resolution is backward compatible. we are resolving using the resource id -> get the resource name from metadata to resolve the status lists. Apologies our spec should be updated

Copy link
Contributor

@TimoGlastra TimoGlastra Jan 6, 2025

Choose a reason for hiding this comment

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

Okay thanks for the answers! I'm not sure, what is the max length of the tag? I think the credential definition name is max 32 because it's hashed. With the dash, the tag can max be 31 characters then. I think it should suffice, but if we really want it to be not prone to errors we should maybe re-hash?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Both the approaches sound good to me. Let me know if I should change it to the hashed one

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes let's do the hash. Or the cheqd spec should mention it can max be 31 characters long, but I think that's more prone to errors down the line. So hashing seems most stable to me

@@ -26,7 +26,7 @@
"test": "jest"
},
"dependencies": {
"@cheqd/sdk": "^2.5.1",
"@cheqd/sdk": "^2.6.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

We should properly test this in RN. We have to pin everything to a very specific version or the SDK breaks. Even with the current version it throws an unhandled promise rejection on startup (due to wasm errors) but it somehow still works for resolving.

We haven't had the time to properly look into it, but before we can merge this we should first test it in react native (actually we should pin the version to 2.5.1 for now, instead of using ^2.5.1 until it's fixed)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverting it! It would be very helpful if you can create an issue on our sdk with context-rich logs or reproduction steps. Thanks

Copy link
Contributor Author

@DaevMithran DaevMithran Jan 9, 2025

Choose a reason for hiding this comment

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

@TimoGlastra after our mainnet upgrade we got some feedback that Cheqd transactions from credo are failing, and you can also see that some of the integration tests are failing in 2.5.1. This must be due to insufficient gas after introducing our fee market module, In our latest sdk we have fixed the default gas fees. We have not made any major dependency changes from 2.5.1 to 2.6.0

@DaevMithran DaevMithran requested a review from a team as a code owner January 9, 2025 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants