Skip to content

types: first field in Canonical structs is Type#2675

Merged
ebuchman merged 2 commits intodevelopfrom
bucky/canonical-type
Oct 19, 2018
Merged

types: first field in Canonical structs is Type#2675
ebuchman merged 2 commits intodevelopfrom
bucky/canonical-type

Conversation

@ebuchman
Copy link
Contributor

@ebuchman ebuchman commented Oct 19, 2018

Despite deciding in #1622 and ADR-024 to include a version field in the sign bytes, #2665 suggested it was unnecessary, so it was removed. Further discussion has re-iterated the desire for the HSMs to be able to independently reject schemas they do not know about, without relying on something like the KMS to do it for them.

Rather than bring back the Version field, we can use the existing Type byte field, which currently has only 4 defined types (prevote, precommit, proposal, heartbeat). If and when we need to upgrade the sign bytes format, we can introduce new types here. 256 options should be more than enough.

  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG_PENDING.md

@codecov-io
Copy link

codecov-io commented Oct 19, 2018

Codecov Report

Merging #2675 into develop will increase coverage by 0.04%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #2675      +/-   ##
===========================================
+ Coverage    61.69%   61.74%   +0.04%     
===========================================
  Files          207      207              
  Lines        16902    16934      +32     
===========================================
+ Hits         10428    10456      +28     
- Misses        5607     5610       +3     
- Partials       867      868       +1
Impacted Files Coverage Δ
tools/tm-bench/statistics.go 0% <0%> (ø) ⬆️
privval/ipc_server.go 69.81% <0%> (ø) ⬆️
blockchain/pool.go 66.43% <0%> (+0.69%) ⬆️
libs/clist/clist.go 68.18% <0%> (+1.51%) ⬆️
privval/tcp_server.go 81.42% <0%> (+2.85%) ⬆️
libs/db/remotedb/remotedb.go 41.52% <0%> (+4.68%) ⬆️

Copy link
Contributor

@liamsi liamsi left a comment

Choose a reason for hiding this comment

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

LGTM. Left a comment about the spec/documentation. Is @jleni on board with this too?

Height int64 `binary:"fixed64"`
Round int64 `binary:"fixed64"`
VoteType byte
Type byte
Copy link
Contributor

Choose a reason for hiding this comment

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

This would need to be the first field in the documentation too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Weird I thought I fixed that - thanks!

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.

3 participants