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

Report right protocol version in horizon root path #783

Merged

Conversation

charlie-wasp
Copy link
Contributor

Addresses #580

As stated in stellar/stellar-core#1740, I take here current protocol version from the ledger.version attribute of stellar-core info command response

I am a quite newbie in both Stellar and Go, so I will appreciate any comments, which help me improve this PR 🙏

@charlie-wasp charlie-wasp force-pushed the issue-58-wrong-protocol-version branch from e1305ce to ac60d66 Compare December 3, 2018 14:54
@tomquisel
Copy link
Contributor

@charlie-wasp thanks for this! Can you bring your branch up to date with master? That'll fix the build issue this PR is hitting.

@charlie-wasp charlie-wasp force-pushed the issue-58-wrong-protocol-version branch from ac60d66 to f6ea0bf Compare January 15, 2019 06:42
@charlie-wasp
Copy link
Contributor Author

@tomquisel done! ✅

@bartekn
Copy link
Contributor

bartekn commented Jan 16, 2019

Because of the concerns in stellar/stellar-core#1740 I think we can try to make it by introducing new fields with unambiguous names and deprecating existing protocol_version field. New fields would be:

  • core_supported_protocol_version - protocol version reported by stellar-core,
  • current_protocol_version - protocol version of the last ledger.

Then in the next minor release (we should really start following semver...) we will remove protocol_version.

@charlie-wasp
Copy link
Contributor Author

@bartekn 👌 I'll give it a shot

@charlie-wasp charlie-wasp force-pushed the issue-58-wrong-protocol-version branch 2 times, most recently from 919fad8 to f85e4c6 Compare January 24, 2019 08:32
@charlie-wasp
Copy link
Contributor Author

@bartekn @tomquisel I added new fields and updated the branch. And seemingly nothing is broken 😅

@tomquisel tomquisel changed the base branch from master to horizon-0.16.0 January 24, 2019 15:59
tomquisel
tomquisel previously approved these changes Jan 24, 2019
Copy link
Contributor

@tomquisel tomquisel left a comment

Choose a reason for hiding this comment

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

Looks good! I switched the base to horizon v0.16.0. @bartekn can you do a final sign off & merge?

Copy link
Contributor

@bartekn bartekn left a comment

Choose a reason for hiding this comment

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

LGTM, just 3 very small issues. Thank you so much for this PR!

redis *redis.Pool
coreVersion string
horizonVersion string
protocolVersion int32 // will be deprecated in the next minor release
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not part of the public API, can be removed right away.

@@ -18,6 +18,7 @@ func PopulateRoot(
hVersion, cVersion string,
passphrase string,
pVersion int32,
coreProtocolVersion int32,
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's change these names to currentProtocolVersion and coreSupportedProtocolVersion. Will be less confusing.

HistoryElderSequence int32 `json:"history_elder_ledger"`
CoreSequence int32 `json:"core_latest_ledger"`
NetworkPassphrase string `json:"network_passphrase"`
ProtocolVersion int32 `json:"protocol_version"` // will be deprecated in the next minor release
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you change this to:

// Deprecated - remove in: horizon-v0.17.0
ProtocolVersion      int32  `json:"protocol_version"`		ProtocolVersion

to support #833. This will help us automatically detect deprecations.

@charlie-wasp
Copy link
Contributor Author

@bartekn done! ✅ Thank you for the review!

@bartekn bartekn force-pushed the issue-58-wrong-protocol-version branch from 979f966 to e47de18 Compare January 28, 2019 13:44
@bartekn
Copy link
Contributor

bartekn commented Jan 28, 2019

LGTM! Added small changes in e47de18.

@bartekn bartekn merged commit e786eb6 into stellar:horizon-0.16.0 Jan 28, 2019
oryband added a commit to kinecosystem/go that referenced this pull request Feb 17, 2019
* tag 'horizon-v0.16.0':
  horizon: 0.16.0 CHANGELOG (stellar#851)
  Allow smooth migration for failed transactions column (stellar#847)
  Clean up the redundancy in the Horizon command line option handling (stellar#834)
  horizon/actions: fix a bug in `GetPageQuery` and `GetAddress` (stellar#846)
  remove JSON
  horizon/actions: check hash before sending an event to the stream of orderbook (stellar#828)
  Deprecated check (stellar#838)
  Report right protocol version in horizon root path (stellar#783)
  fix migration ordering (stellar#821)
  Add failed transactions to ledger resource (stellar#756)
  Ignore "0" trades effects (stellar#791)
  Add package index to README (stellar#831)
  horizon/db2/history: optimize account queries for payments and operations (stellar#829)
  Update "gap detected" message (stellar#830)
  Update setTickInProgress comment (stellar#824)
  Bump postgres version for Travis (stellar#822)
  fix wrong effect of a circular path payment (stellar#807)
  Update README.md (stellar#820)
  Fix build badge (stellar#816)
  Require migration to run Horizon version successfully (fixes stellar#778) (stellar#808)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants