XRPLF / rippled

Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger protocol in C++
https://xrpl.org
ISC License
4.51k stars 1.46k forks source link

Less contentious restructure #4966

Closed thejohnfreeman closed 5 months ago

thejohnfreeman commented 6 months ago

This PR implements half of the changes planned for the physical redesign. These changes, described below, are in files touched infrequently by other contributors, so I expect them to be less disruptive or contentious. (The second half of the changes will come in a later PR that I expect to be more contentious.)

Before this PR is merged, we should:

codecov-commenter commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 70.9%. Comparing base (676aae2) to head (b84f7e7).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/XRPLF/rippled/pull/4966/graphs/tree.svg?width=650&height=150&src=pr&token=i2RPGI5xGF&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF)](https://app.codecov.io/gh/XRPLF/rippled/pull/4966?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF) ```diff @@ Coverage Diff @@ ## develop #4966 +/- ## ========================================= - Coverage 71.0% 70.9% -0.0% ========================================= Files 796 796 Lines 66727 66727 Branches 10973 10978 +5 ========================================= - Hits 47348 47336 -12 - Misses 19379 19391 +12 ``` | [Files](https://app.codecov.io/gh/XRPLF/rippled/pull/4966?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF) | Coverage Δ | | |---|---|---| | [src/ripple/app/main/Main.cpp](https://app.codecov.io/gh/XRPLF/rippled/pull/4966?src=pr&el=tree&filepath=src%2Fripple%2Fapp%2Fmain%2FMain.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-c3JjL3JpcHBsZS9hcHAvbWFpbi9NYWluLmNwcA==) | `47.0% <ø> (ø)` | | | [src/ripple/app/paths/AMMLiquidity.h](https://app.codecov.io/gh/XRPLF/rippled/pull/4966?src=pr&el=tree&filepath=src%2Fripple%2Fapp%2Fpaths%2FAMMLiquidity.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-c3JjL3JpcHBsZS9hcHAvcGF0aHMvQU1NTGlxdWlkaXR5Lmg=) | `100.0% <ø> (ø)` | | | [src/ripple/overlay/impl/TxMetrics.cpp](https://app.codecov.io/gh/XRPLF/rippled/pull/4966?src=pr&el=tree&filepath=src%2Fripple%2Foverlay%2Fimpl%2FTxMetrics.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-c3JjL3JpcHBsZS9vdmVybGF5L2ltcGwvVHhNZXRyaWNzLmNwcA==) | `16.2% <ø> (ø)` | | | [src/ripple/overlay/impl/TxMetrics.h](https://app.codecov.io/gh/XRPLF/rippled/pull/4966?src=pr&el=tree&filepath=src%2Fripple%2Foverlay%2Fimpl%2FTxMetrics.h&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-c3JjL3JpcHBsZS9vdmVybGF5L2ltcGwvVHhNZXRyaWNzLmg=) | `100.0% <ø> (ø)` | | | [src/ripple/protocol/impl/SecretKey.cpp](https://app.codecov.io/gh/XRPLF/rippled/pull/4966?src=pr&el=tree&filepath=src%2Fripple%2Fprotocol%2Fimpl%2FSecretKey.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF#diff-c3JjL3JpcHBsZS9wcm90b2NvbC9pbXBsL1NlY3JldEtleS5jcHA=) | `83.4% <100.0%> (ø)` | | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/XRPLF/rippled/pull/4966/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF) [![Impacted file tree graph](https://app.codecov.io/gh/XRPLF/rippled/pull/4966/graphs/tree.svg?width=650&height=150&src=pr&token=i2RPGI5xGF&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF)](https://app.codecov.io/gh/XRPLF/rippled/pull/4966?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XRPLF)
godexsoft commented 6 months ago

@scottschurr I have no objections either way. If moving to .h is significantly easier then that's a valid strategy 👍 I'm wondering however who is it disruptive for? Does anyone but Clio actually consume libxrpl? From Clio's perspective, where we already have everything as .hpp it would look better if rippled's headers were also .hpp but that's very minor.

scottschurr commented 6 months ago

I have no objections either way. If moving to .h is significantly easier then that's a valid strategy 👍 I'm wondering however who is it disruptive for?

That's a fair question, @godexsoft. In terms of disruption I was thinking of folks, like me, who work in the rippled code base. Renaming fewer files means I don't have to retrain that part of my brain. I also frequently have trouble tracing history through renamed files in git. Reducing the number of renamed files will increase the likelihood that looking at history using git continues to work for more files.

But neither of those are killer arguments. It's mostly about my personal convenience. So, yeah, I'm still leaning toward the current approach that @thejohnfreeman has taken.

thejohnfreeman commented 6 months ago

I prefer .hpp to .h too, stylistically, but the .hpp files are in the extreme minority in this codebase, to the point that they are overlooked: they have been mistakenly excluded from the formatting requirements for years.

The next PR is about to rename every file in src/ripple. If we want to adopt .hpp, that would be the time, but I don't feel strongly enough to fight for it.

ximinez commented 6 months ago

Does anyone but Clio actually consume libxrpl?

Two that I know about are:

thejohnfreeman commented 5 months ago

@Bronek the packaging files have been moved to a separate, internal (Ripple GitLab) project. They were never used outside of Ripple. They drive our internal package pipelines. As a separate project, they can be developed outside of the rippled review and release process. I've already worked with @legleux to ensure that the new project can successfully package this branch.

thejohnfreeman commented 5 months ago

Now that this PR has two approvals, I will work on the finishing steps outlined at the end of the PR description.