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
Introduce CBlockchain and move CheckBlockHeader #8087
Conversation
I think you forgot to include the files in git. On May 23, 2016 12:23:38 AM PDT, Patrick Strateman notifications@github.com wrote:
|
Indeed I did |
5fe5a66
to
ff61c68
Compare
High level consensus logic is currently in main.cpp In time these functions should be moved to CBlockchain Initially as static methods and then as normal methods.
7388d27
to
88d3cf5
Compare
This is a very different approach to libconsensus. I already see chainparams.h, checkpoints and other dependencies that shouldn't be in the consensus module (and libconsensus). This seems more disruptive to my work on libconsensus than segwit (for which I'm waiting to continue proposing more consensus related refactors). |
@jtimon I think there was a misunderstanding in the intention here. My goal is simply to more clearly define the interface functions in an effort to separate networking and consensus logic. The implementing functions should be pure while the interface used by bitcoind/bitcoin-qt would have some state, such as the block index and utxo states as well as which chain we're dealing with (ie ConsensusParams) |
I think we need to first have a plan about refactorings in this space. There are too many people with conflicting goals pulling in different directions. Without coordination, I fear we'll end up with partially-completed refactors that are worse than what we've started off with. |
Agreed, perhaps this is an article for in-depth technical discussion after the next meeting? |
utACK 942a847 |
@pstratem Encapsulating consensus logic has been a long term goal of mine. I believe you are underestimating how disruptive this PR would be to my previous (but still not reviewed or merged) work in this subject. Let's please take little steps trying to find common ground. I never created the promised "libconsensus plan" document with pictures, but people really really interested have always had the chance to look at my longest branches (thus I assumed nobody was really as interested as they claimed...). Please, feel free to comment on any of my multiple "consensus" closed PRs. |
Needs rebase. Also see related work such as #8969 which attempts to move towards this in a different way - pull everything that isnt CBlockchain out of main.cpp first, then just put everything left in a class. |
The ultimate goal here is to move all of the consensus functions defined in main.cpp to CBlockchain.
Initially they will all simply be static functions to ensure that the changes are obviously correct.