verifier-alliance / database-specs

11 stars 1 forks source link

Renaming the `_transformations` and `_values` "reasons" consistently #9

Closed kuzdogan closed 1 month ago

kuzdogan commented 1 month ago

In the current application of the VerA schema, at least in practice, we have inconsistent naming for the transformations and the values "reasons":

Call Protection:

Transformation:

[
  {
    "type": "replace",
    "offset": 0,
    "reason": "call-protection"
  }
]

Value:

{
  "callProtection": "0x7340b70a4904fad0ff86f8c901b231eac759a0ebb0"
}

Similarly:

Rename all of them as such consistently:

This doesn't need to be specified in an SQL schema etc. but putting it here for clarity. This will be specified in a doc explaining the JSON fields.

kuzdogan commented 1 month ago

I've updated the spec in #11

If we all agree, can you update it for Sourcify too @marcocastignoli ?

marcocastignoli commented 1 month ago

The only doubts that I have here is that inside the values some of the keys (e.g. libraries) contain multiple fields.

So it makes sense to have the transformation name in the singular, while transformation_values object keys in the plural.

transformations

[
  {
    "reason": "library",
    "id": "__$KEY1$__"
    ....
  },
  {
    "reason": "library",
    "id": "__$KEY2$__"
    ....
  }
]

transformation_values

{
    "libraries": {
      "__$KEY1$__": "0x...",
      "__$KEY2$__": "0x...",
    }
}

transformations keys:

values:

kuzdogan commented 1 month ago

Fine for me. Any opinions @rimrakhimov ?

rimrakhimov commented 1 month ago

I agree with @marcocastignoli. I just believe 'data' is used in both singular and plural forms, so maybe it should be cborAuxdata in both value and transformation