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

BACK-6974: New schema for EIP712 #171

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

Conversation

ClaireGuerreGiordano
Copy link

No description provided.

@ClaireGuerreGiordano ClaireGuerreGiordano marked this pull request as ready for review May 6, 2024 14:58
@ClaireGuerreGiordano ClaireGuerreGiordano requested a review from a team as a code owner May 6, 2024 14:58
Copy link
Contributor

@jnicoulaud-ledger jnicoulaud-ledger left a comment

Choose a reason for hiding this comment

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

Can you please add a description to your PR referencing specs for proper historization ? Thanks!

Adding diff of the schema for clarity:

❯ difft ethereum/eip712.schema.json ethereum/eip712-v2.schema.json                                            back6974
ethereum/eip712-v2.schema.json --- JSON
34 34                                                 "properties": {
.. 35                                                     "assetPath": {
.. 36                                                         "type": "string"
.. 37                                                     },
.. 38                                                     "format": {
.. 39                                                         "enum": [
.. 40                                                             "coin",
.. 41                                                             "amount",
.. 42                                                             "address"
.. 43                                                         ]
.. 44                                                     },
35 45                                                     "label": {

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe if we go with option 3 as specified in BACK-6974, the new schema file should replace the old one ?

Choose a reason for hiding this comment

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

The option 3 is about the asset file itself, not its schema. I think all schemas should remain in input repositories, and the single asset file should meet all these schema (this is why we cannot authorize to drop or alter field, nor add mandatory fields)

Copy link
Contributor

Choose a reason for hiding this comment

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

Documents can't pass all schemas, as additionalProperties is set to false

Copy link
Contributor

Choose a reason for hiding this comment

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

Change should be applied in all networks

Choose a reason for hiding this comment

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

As stated here, these changes are meant to be used by app-eth. Do we really need to impact non-ethereum network?

Copy link
Contributor

Choose a reason for hiding this comment

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

All these networks are EVMs, handled by the ethereum app

"type": "string"
},
"format": {
"enum": [
Copy link
Contributor

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

yes, I missed it since I relied on https://ledgerhq.atlassian.net/wiki/spaces/PTX/pages/4404903999/ARCHI+EIP-712+improvements which does not match the code you show me.

"enum": [
"coin",
"amount",
"address"
Copy link
Contributor

Choose a reason for hiding this comment

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

address will not be implemented in this version, let's remove it (see https://github.com/LedgerHQ/app-ethereum/blob/feat/apa/eip712_improvements/doc/ethapp.adoc#eip712-filtering)

Choose a reason for hiding this comment

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

ok

},
"format": {
"enum": [
"coin",
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest we follow the nomenclature defined on the nano app for clarity: https://github.com/LedgerHQ/app-ethereum/blob/feat/apa/eip712_improvements/doc/ethapp.adoc#eip712-filtering

Suggested change
"coin",
"token",

Choose a reason for hiding this comment

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

sure

"type": "string"
},
"format": {
"enum": [
Copy link
Contributor

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

yes

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.

None yet

2 participants