Skip to content

Conversation

@jtimon
Copy link
Contributor

@jtimon jtimon commented Jul 11, 2016

It seems to me that version.h shouldn't be used by libconsensus, so I left that out.
amount.cpp is not used by libconsensus (see #7820 ), also left out of the rename for now.

Although pow.o and versionbits.o still depend on chain.o (dependent on storage) and can't be moved to the consensus package, they can be moved to the directory already, so they are moved.

Although @laanwj believes that the best time to do this kind of refactoring would be right after forking 0.13, I believe that doing it right before has negligible risks and would simplify future backports of consensus code to the 0.13 branch.

@dcousens
Copy link
Contributor

dcousens commented Jul 11, 2016

utACK 1e1db2f

… because

FormatMoney()

- My opinion: there's only satoshis (aka units) in libconsensus
@jtimon
Copy link
Contributor Author

jtimon commented Jul 13, 2016

Updated adding utilmoneystr, which I forgot will be needed in libconsensus for this line: https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp#L1961
(although if many people agree with me, I would prefer to keep it out and just print satoshis).

@jtimon jtimon closed this Jul 13, 2016
@jtimon jtimon deleted the 0.12.99-consensus-rename branch July 13, 2016 13:21
@jtimon jtimon restored the 0.12.99-consensus-rename branch July 13, 2016 13:25
@jtimon jtimon reopened this Jul 13, 2016
@afk11
Copy link
Contributor

afk11 commented Jul 14, 2016

ACK c078fd1

@maaku
Copy link
Contributor

maaku commented Jul 14, 2016

I really don't think that we should be moving everything that libconsensus is code-dependent on into the consensus directory. That does not help clarity of the code base. Things like serialization and basic data structures in primitives probably deserve to be their own library, which libconsensus links against. Moving them all into the consensus directory doesn't help IMHO.

@jtimon
Copy link
Contributor Author

jtimon commented Jul 14, 2016

I'm all ears for suggestions on other internal packages for the consensus one to depend on besides crypto and libsecp256k1. I think this approach does help the clarity of the codebase by explicitly putting together all the files included (or that are planned to be included) in the same building package (consensus). For example, when I ask "please don't include this header from a consensus file", it would simplify things (not everybody looks at src/Makefile.am).
Also if we plan for libconsensus to become its own repository eventually, I see this as the most straightforward path. Some people on IRC have expressed that maybe there could be some intermediary libraries that both libconsensus and bitcoin core depend on.
So it seems there's mixing feelings about this and in any case this can be done at any time (in fact, it was phase 4 in my newer published plan).
Therefore I'm closing the PR.

Regarding the separation of utilmoneystr in a different commit, it was because I believe it shouldn't be part of libconsensus. At least @sipa seems to agree with me there, so at some point before exposing verifyTx in libconsensus I will create a PR removing the one line dependency and ping you both.

@jtimon jtimon closed this Jul 14, 2016
@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.

5 participants