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

[TRIVIAL] Reduce visibility of retired amendment identifiers: #3364

Closed
wants to merge 1 commit into from
Closed

[TRIVIAL] Reduce visibility of retired amendment identifiers: #3364

wants to merge 1 commit into from

Conversation

nbougalis
Copy link
Contributor

Identifiers for retired amendments should not generally be used in the codebase.

This commit reduces their visibility down to one translation unit and marks them as unused and deprecated to prevent accidental reuse.

@nbougalis nbougalis requested a review from scottschurr April 17, 2020 06:47
@codecov-io
Copy link

Codecov Report

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

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #3364      +/-   ##
===========================================
- Coverage    70.41%   70.40%   -0.02%     
===========================================
  Files          683      683              
  Lines        54775    54775              
===========================================
- Hits         38570    38564       -6     
- Misses       16205    16211       +6     
Impacted Files Coverage Δ
src/ripple/protocol/Feature.h 100.00% <ø> (ø)
src/ripple/protocol/impl/Feature.cpp 91.66% <ø> (ø)
src/ripple/server/impl/BaseHTTPPeer.h 87.57% <0.00%> (-3.56%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 020b285...8d5de8b. Read the comment docs.

@scottschurr
Copy link
Collaborator

@nbougalis, I think reducing the visibility of these amendment identifiers is a great idea. I've incorporated your suggested changes into the retiring amendments pull request: #3368.

@nbougalis
Copy link
Contributor Author

I am going to close this PR, since you've folded these changes in 3368.

@nbougalis nbougalis closed this Apr 22, 2020
@nbougalis
Copy link
Contributor Author

@scottschurr: considering that #3368 is closed for now, I'm going to reopen this to reduce the visibility of retired amendments. Would appreciate a review.

@nbougalis nbougalis reopened this May 13, 2020
Identifiers for retired amendments should not generally be used
in the codebase.

This commit reduces their visibility down to one translation
unit and marks them as unused and deprecated to prevent
accidental reuse.
Copy link
Collaborator

@scottschurr scottschurr left a comment

Choose a reason for hiding this comment

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

Good change. I have a couple of suggestions for you to consider including in this change. But I'll leave that to your discretion. 👍

// clang-format off

uint256 const
featureTickets = *getRegisteredFeature("Tickets"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just as a note, if getRegisteredFeature() is called with a misspelled name it returns a null pointer which then crashes the app on startup. I had this happen to me while messing with features for retiring amendments. So I created different function that would create a good error message if the passed in name was not found.

Here's a commit you can cherry-pick if you'd like to pick up that change: scottschurr@9277217 That commit also includes some improved comments.

// pre-amendment code has been removed and the identifiers are deprecated.
[[deprecated("The referenced amendment has been retired"), maybe_unused]]
uint256 const
retiredPayChan = *getRegisteredFeature("PayChan"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

This list is incomplete because when I first started unconditionalizing amendments I completely removed their registered features. I have a commit you could cherry-pick (the same one I mention elsewhere) which fills in the retired amendments that are missing from this list: scottschurr@9277217

@manojsdoshi manojsdoshi added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label May 19, 2020
This was referenced May 21, 2020
@nbougalis nbougalis deleted the retired_amendments branch October 16, 2023 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants