Skip to content

version: types#2438

Merged
ebuchman merged 1 commit intodevelopfrom
bucky/versions
Sep 23, 2018
Merged

version: types#2438
ebuchman merged 1 commit intodevelopfrom
bucky/versions

Conversation

@ebuchman
Copy link
Contributor

@ebuchman ebuchman commented Sep 19, 2018

Define some new types to approach #1135 and ADR-016

Breaks out some changes from #2160

  • 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 Sep 19, 2018

Codecov Report

Merging #2438 into develop will decrease coverage by 0.12%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           develop    #2438      +/-   ##
===========================================
- Coverage    61.75%   61.63%   -0.13%     
===========================================
  Files          198      198              
  Lines        16358    16316      -42     
===========================================
- Hits         10102    10056      -46     
+ Misses        5434     5432       -2     
- Partials       822      828       +6
Impacted Files Coverage Δ
libs/db/remotedb/remotedb.go 36.84% <0%> (-4.69%) ⬇️
consensus/reactor.go 71.84% <0%> (-2.11%) ⬇️
libs/clist/clist.go 66.49% <0%> (-1.53%) ⬇️
blockchain/pool.go 65.73% <0%> (-0.7%) ⬇️
consensus/state.go 77.27% <0%> (-0.36%) ⬇️
p2p/conn/connection.go 79.43% <0%> (-0.29%) ⬇️

const ABCIVersion = "0.14.0"

// Protocol is used for implementation agnostic versioning.
type Protocol int64
Copy link
Contributor

Choose a reason for hiding this comment

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

int64? why not the smallest uint (uint16). It can only go up, right? And there is no arithmetic

Copy link
Contributor

Choose a reason for hiding this comment

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

Is this easy to update in the future? If so I'm in full support if uint16. If not, then perhaps uint32. (uint64 is definitely overkill though imo)

Copy link
Contributor Author

@ebuchman ebuchman Sep 19, 2018

Choose a reason for hiding this comment

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

Agree it should be unsigned. I went for the larger 64-bit to give us more space to signal things so that versions in the future may not be just an incrementing integer, but somehow take advantage of the bit-array, kind of like https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki

I should add that to the ADR

Copy link
Contributor

Choose a reason for hiding this comment

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

👍 for uint64.

@xla xla added the protocol label Sep 19, 2018
Copy link
Contributor

@xla xla left a comment

Choose a reason for hiding this comment

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

👍 :octocat: :shipit: 🍡

// updated in ResponseEndBlock.
type App struct {
Protocol Protocol
Software string
Copy link
Contributor

Choose a reason for hiding this comment

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

Should these have json struct tags as well?

const ABCIVersion = "0.14.0"

// Protocol is used for implementation agnostic versioning.
type Protocol int64
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 for uint64.

@ebuchman ebuchman force-pushed the bucky/versions branch 3 times, most recently from 5ccfc76 to e4ee34c Compare September 23, 2018 13:16
@ebuchman ebuchman merged commit d297f02 into develop Sep 23, 2018
@ebuchman ebuchman deleted the bucky/versions branch September 23, 2018 20:24
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.

5 participants