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

docs(adr): ADR-050 SIGN_MODE_TEXTUAL #10701

Merged
merged 53 commits into from May 27, 2022
Merged

docs(adr): ADR-050 SIGN_MODE_TEXTUAL #10701

merged 53 commits into from May 27, 2022

Conversation

amaury1093
Copy link
Contributor

@amaury1093 amaury1093 commented Dec 7, 2021

Rendered ADR

Description

Closes: #6513

Support documents:


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@github-actions github-actions bot added the T: ADR An issue or PR relating to an architectural decision record label Dec 7, 2021
@amaury1093 amaury1093 changed the title docs(adr): ADR-048 SIGN_MODE_TEXTUAL docs(adr): ADR-049 SIGN_MODE_TEXTUAL Dec 13, 2021
@zmanian
Copy link
Member

zmanian commented Jan 23, 2022

Ethereum is working on a similar EIP

ethereum/EIPs#4430

@amaury1093 amaury1093 changed the title docs(adr): ADR-049 SIGN_MODE_TEXTUAL docs(adr): ADR-050 SIGN_MODE_TEXTUAL Feb 21, 2022
@amaury1093 amaury1093 marked this pull request as ready for review March 21, 2022 14:54
Copy link
Contributor

@alexanderbez alexanderbez left a comment

Choose a reason for hiding this comment

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

Excellent ADR @AmauryM 👏

docs/architecture/adr-050-sign-mode-textual.md Outdated Show resolved Hide resolved
docs/architecture/adr-050-sign-mode-textual-annex1.md Outdated Show resolved Hide resolved
docs/architecture/adr-050-sign-mode-textual-annex1.md Outdated Show resolved Hide resolved
docs/architecture/adr-050-sign-mode-textual-annex1.md Outdated Show resolved Hide resolved
docs/architecture/adr-050-sign-mode-textual-annex1.md Outdated Show resolved Hide resolved
docs/architecture/adr-050-sign-mode-textual-annex1.md Outdated Show resolved Hide resolved
docs/architecture/adr-050-sign-mode-textual.md Outdated Show resolved Hide resolved
docs/architecture/adr-050-sign-mode-textual.md Outdated Show resolved Hide resolved

- if a string is too long, show it on multiple screens,
- break line between the `key` and `value` from #3,
- never allow line breaks on a number or a coin value.
Copy link
Collaborator

Choose a reason for hiding this comment

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

if there is a big number, how a user will know the value if we can't scroll and can't break lines?

Copy link
Collaborator

Choose a reason for hiding this comment

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

up, this is still a concern.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Addressed. The proposed way is to do best effort:

  • if small number, no problem
  • if big number, then show it on separate line
  • if huge number (rare case), show it on multiple screens

Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe we can have an exponential notation? For example, instead 12300000000000000 we write 1.23e18

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think there's another thread with scientific notation. My opinion:

  • it's IMO not known enough by people with non-scientific background. You never see this notation in bank/finance for example.
  • 1234567890 would be written as 1,23456789e9, which is actually longer

Copy link
Member

Choose a reason for hiding this comment

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

I agree. I studied math and CS and consider this e notation unreadable in any financial context.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be good to have some shortcuts. For common Ethereum based coins (with 1e18 base) it will be difficult to read even if we use _ or ' every 3 or 6 digits.

Copy link
Member

Choose a reason for hiding this comment

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

Don't we have display respresentations to solve this such that amounts are dispplayed in ETH instead of Wei anyways?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the concern here is that we always display in the display denom, even if it doesn't make sense.

Take 20Wei, and the display denom is ETH. Textual will display 0.00000000000000002 ETH, even though 20 Wei is way more readable.

Maybe an idea is to display in the denom with the shortest string length.

docs/architecture/adr-050-sign-mode-textual.md Outdated Show resolved Hide resolved
@amaury1093 amaury1093 requested a review from a team as a code owner May 16, 2022 12:54
@amaury1093 amaury1093 mentioned this pull request May 16, 2022
39 tasks
@amaury1093
Copy link
Contributor Author

amaury1093 commented May 24, 2022

I think all comments have been addressed!

Is anyone willing to give a second approval, and then I'll merge this? We can still iterate as part of the WG. cc @webmaster128 @zmanian @JimLarson @jleni @robert-zaremba

Copy link
Collaborator

@robert-zaremba robert-zaremba left a comment

Choose a reason for hiding this comment

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

pre-approving. left few additional comments.

docs/architecture/adr-050-sign-mode-textual-annex1.md Outdated Show resolved Hide resolved
docs/architecture/adr-050-sign-mode-textual-annex1.md Outdated Show resolved Hide resolved
docs/architecture/adr-050-sign-mode-textual-annex1.md Outdated Show resolved Hide resolved
docs/architecture/adr-050-sign-mode-textual.md Outdated Show resolved Hide resolved
docs/architecture/adr-050-sign-mode-textual.md Outdated Show resolved Hide resolved
@amaury1093 amaury1093 added the A:automerge Automatically merge PR once all prerequisites pass. label May 27, 2022
@mergify mergify bot merged commit 0cee47d into main May 27, 2022
@mergify mergify bot deleted the am/adr-textual branch May 27, 2022 15:32

### `google.protobuf.Timestamp`

Rendered as either ISO8601 (`2021-01-01T12:00:00Z`).
Copy link
Member

Choose a reason for hiding this comment

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

I'm working on the implementation of Timestamp now.

I think what we want is RFC 3339. ISO8601 is a superset of that which does way too much for our needs. It does fun stuff like PT24H which is now until 24 hours later.

Also it is important to perseve nanosecond precision. Otherwise we loose information. Some more detail on how fractional seconds are displayed would be useful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think RFC3339 doesn't deal with nanos, right? I found an informal RFC3339Nano in Golang, which is RFC3339+ns support, but no official spec. That seems like exactly what we want though.

The next superset seems to be ISO8601 itself.

Copy link
Member

Choose a reason for hiding this comment

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

There are various mentions of "fraction" in RFC3339. The grammar time-secfrac = "." 1*DIGIT means at least one digit after a period. My understanding so far has been that any precision is supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah I see! OK that's nice, I'll update the ADR and add an example with fractional seconds.

@amaury1093 amaury1093 mentioned this pull request Sep 6, 2022
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. T: ADR An issue or PR relating to an architectural decision record Type: ADR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Specify SIGN_MODE_TEXTUAL
7 participants