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

Gov.tools generated JSON - metadata errors #2082

Closed
kostaspanagias opened this issue Sep 26, 2024 · 10 comments
Closed

Gov.tools generated JSON - metadata errors #2082

kostaspanagias opened this issue Sep 26, 2024 · 10 comments
Assignees
Labels
🐛 Bug Something isn't working

Comments

@kostaspanagias
Copy link

I have found two metadata errors when registering as a DRep through gov.tools. The errors are shown when checking your DRep profile on Adastat.net Cardano Explorer.

adastat

I have reached to them via intersect working group DReps and they confirmed that the issue is not on their side; at least the first one (screenshot below):

wg_dreps

ISSUE 1

Metadata error shown in adastat:

Error Offchain Voting Anchor: JSON decode error from when fetching metadata from Just https://raw.githubusercontent.com/kostaspanagias/drep/refs/heads/main/Kostas%20Panagias.jsonld resulted in : "Error in $['@context']: key \"@language\" not found,

Feedback I found about the error:

According to CIP-0100 the @language property should be included under the @context. However, the automatically generated JSON from gov.tools does not include this property (tested twice).

CIP-0100

Link: https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md
Image:
cip100

gov.tools output:

Link (my DRep json): https://raw.githubusercontent.com/kostaspanagias/drep/refs/heads/main/Kostas%20Panagias.jsonld

Image:
json


ISSUE 2

Metadata Error Shown in adastat:

CIP-100:Error in $.body.references[0]: reference type should be one of [\"Other\",\"GovernanceMetadata\"] but it's Link

Feedback I found about the error:

I couldn't actually map the error shown in my JSON files. Unfortunately, I don't have any further feedback on this one.

@bosko-m bosko-m added the 🐛 Bug Something isn't working label Sep 27, 2024
@bosko-m
Copy link
Contributor

bosko-m commented Sep 27, 2024

CC @spannercode

@spannercode
Copy link
Contributor

Since the language support is not yet there on GovTool, we can default to English for now.
To make the metadata compliant, as mentioned on the CIP 100, @language field can be added to @context with default value of en. The rest of the metadata can remain the same.

{
  "@context": {
    "@language": "en",
    "CIP100": "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0100/README.md#",
    "CIP119": "https://github.com/cardano-foundation/CIPs/blob/master/CIP-0119/README.md#",
    ...
  }
  ...
}

CC: @bosko-m @jdyczka

@jdyczka
Copy link
Contributor

jdyczka commented Sep 27, 2024

Regarding the first issue, CIP-100 states that @language SHOULD be included, not MUST BE included, so it's a bit of a grey area.
Eventually, we probably should include the @language property, but as @spannercode said, for now it would be English for everyone, so it becomes a bit meaningless anyway. It also would fix the issue only for future DRep registrations or for users who edit their metadata through GovTool.
So maybe it would be ok for dbSync to NOT require it, since technically it may be omitted?

@jdyczka
Copy link
Contributor

jdyczka commented Sep 27, 2024

Regarding the second issue, CIP-119 defines additional types for reference: Link and Identity
What I've found is that it is only raised as an error when accompanied by another error. But that's something to verify further.

@jdyczka
Copy link
Contributor

jdyczka commented Sep 27, 2024

And about the issue with drep name not being shown in Adastat, if I understand correctly they use data from dbSync, which will not include any metadata if it's not validated correctly. So the above mentioned issues are the reason why it's not showing.

@jdyczka
Copy link
Contributor

jdyczka commented Sep 27, 2024

This issue is connected to #1856

@jdyczka
Copy link
Contributor

jdyczka commented Sep 27, 2024

@spannercode wisely suggested to add the @language property in any case, so as not to create new DReps that, as for now, will result with a dbSync error.

That however, still doesn't fix errors for already created DReps. And since on GovTool their metadata will be displayed correctly, those users might not be aware of the problems on other tooling. So maybe we should also display some kind of a prompt instructing the user to regenerate the jsonld file through editing the DRep? cc @m-i-k-e

@m-i-k-e
Copy link

m-i-k-e commented Sep 30, 2024

It seems to me that this is a terminology issue with the CIP. 'Should' can also mean 'must'. That's how it's been interpreted. I think we 'should' add the language property, but also that adastat should allow for registrations that don't have it, and assume they're English.

I'm not a fan of asking people to re-register at this point. Do we know how many DReps are affected?

@dmitrystas
Copy link

but also that adastat should allow for registrations that don't have it

I just wanted to point out this is not AdaStat warning, but DB-Sync one. I.e. all the tools (explorers and other) that use DB-Sync are affected by the issue

@bosko-m
Copy link
Contributor

bosko-m commented Oct 8, 2024

So maybe we should also display some kind of a prompt instructing the user to regenerate the jsonld file through editing the DRep?

@m-i-k-e Any comment on @jdyczka simple copy suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

6 participants