Skip to content

Conversation

jtimon
Copy link
Contributor

@jtimon jtimon commented Nov 18, 2015

This the last part of #5970 that is going to be opened independently,
see more details for why in #5970 (comment).

The main remaining commit in that #5970 was
jtimon@8550a27
which is lazily leveraging not only previous steps in that PR,
but also in the additional work by many people accepting that, given
that they were altering the declaration of a function, it was free
for them to pass Consensus::Params or CChainParams too. This PR
contains that commit plus a few small additions ready to squash or
leave out.

It may be disruptive to things we would really like to see in 0.12
before the testing window closes, but I can easily rebase this on
demand, even after all the desired changes are merged and right
before forking 0.12 (and I believe it will remain pretty reviewable and
low risk). It is likely that after rebase, this becomes more incomplete than it currently is, but better is better.

@dcousens
Copy link
Contributor

utACK

@jtimon jtimon force-pushed the globals-chainparams-main branch from 561fb7e to 5aa4a0d Compare November 18, 2015 12:14
@btcdrak
Copy link
Contributor

btcdrak commented Nov 18, 2015

utACK

@@ -3041,13 +3042,13 @@ void UnlinkPrunedFiles(std::set<int>& setFilesToPrune)
}

/* Calculate the block/rev files that should be deleted to remain under target*/
void FindFilesToPrune(std::set<int>& setFilesToPrune)
void FindFilesToPrune(std::set<int>& setFilesToPrune, uint64_t nPruneAfterHeight)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I think it'd make more sense if FindFilesToPrune() took a params object, as the PruneAfterHeight feels like an implementation specific detail that FlushStateToDisk() doesn't need to know about.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems to me that nPruneAfterHeight is precisely the only "implementation detail" from CChainParams that FlushStateToDisk() needs to know about.

Copy link
Contributor

Choose a reason for hiding this comment

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

Right now it is, but my point is the fact that it is is an implementation detail that may change in the future!

But anyway, that's a pretty minor nit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure it was a good idea to put nPruneAfterHeight in CChainParams in the first place. In any case, for functions that only take one thing from CChainParams (not Consensus::Params) I prefer to use the single thing directly instead of the full CChainParams, and if FlushStateToDisk ever needs more things from CChainParams, he can change the function prototype himself. See #6173 for example.
So I'm going to leave it as is and squash.

@petertodd
Copy link
Contributor

utACK

1) Chainparams: Explicit CChainParams arg for main:

-AcceptBlock
-AcceptBlockHeader
-ActivateBestChain
-ConnectTip
-InitBlockIndex
-LoadExternalBlockFile
-VerifyDB parametric constructor

2) Also pickup more Params()\. in main.cpp

3) Pass nPruneAfterHeight explicitly to new FindFilesToPrune() in main.cpp
@jtimon jtimon force-pushed the globals-chainparams-main branch from 5aa4a0d to 2e29e7e Compare November 23, 2015 11:15
@jtimon
Copy link
Contributor Author

jtimon commented Nov 23, 2015

Squashed

@laanwj laanwj added this to the 0.12.0 milestone Nov 24, 2015
@maflcko
Copy link
Member

maflcko commented Nov 27, 2015

utACK

@laanwj laanwj merged commit 2e29e7e into bitcoin:master Nov 27, 2015
laanwj added a commit that referenced this pull request Nov 27, 2015
2e29e7e Globals: Remove a bunch of Params() calls from main.cpp: (Jorge Timón)
jtimon added a commit to jtimon/bitcoin that referenced this pull request Nov 29, 2015
laanwj added a commit that referenced this pull request Nov 30, 2015
cb491e7 Trivial: Fix warning introduced by #7053 by casting to uint64_t (Jorge Timón)
zkbot added a commit to zcash/zcash that referenced this pull request Mar 10, 2018
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5994
- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request Apr 6, 2018
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5994
- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request May 31, 2018
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5994
- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request Oct 24, 2018
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5994
- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request Oct 25, 2018
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5994
- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request Apr 5, 2019
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters, and
various other functions in `main.cpp` have `const CChainParams&` arguments added.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request Apr 9, 2019
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters, and
various other functions in `main.cpp` have `const CChainParams&` arguments added.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request May 24, 2019
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters, and
various other functions in `main.cpp` have `const CChainParams&` arguments added.

Part of #2074.
zkbot added a commit to zcash/zcash that referenced this pull request May 28, 2019
Bitcoin Core refactoring and cleanups 1

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6538
- bitcoin/bitcoin#6163
- bitcoin/bitcoin#6982
- bitcoin/bitcoin#6986
- bitcoin/bitcoin#7053
- bitcoin/bitcoin#7444
- bitcoin/bitcoin#7793
  - Excluding some comments in `txmempool.h` on code we haven't yet pulled in.
- bitcoin/bitcoin#7916
- bitcoin/bitcoin#7815

Additionally, the Equihash parameters are moved into the consensus parameters, and
various other functions in `main.cpp` have `const CChainParams&` arguments added.

Part of #2074.
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants