Policy: Continue policy movements #5652

pull jtimon wants to merge 16 commits into bitcoin:master from jtimon:policy2 changing 68 files +888 −598
  1. jtimon commented at 0:18 am on January 13, 2015: contributor

    I had some misunderstandings about what @luke-jr and I agreed and disagreed on #5071. That’s why I created #5180. The only disagreement is how you allow users to select Params().RequireStandard() independently of the chainparams selected (but we agree that should be possible, @petertodd does too #5521 (comment)). That little disagreement is out of scope for this PR. The two potential solutions should be easier to review, maintain and discuss after this PR has been acked. I thought he also disagreed on:

    1. Only the interface can be accessed from outside policy.cpp, the implementation is hidden.
    2. policy.o shouldn’t depend on main.h or contain any concurrency-related code.

    He doesn’t disagree, he was just doing some things faster and left others for later in his version of policy encapsulation (https://github.com/luke-jr/bitcoin/tree/nodepolicy2). There’s a version rebased on top of this PR that satisfies 1 but not 2 in https://github.com/jtimon/bitcoin/tree/luke_policy2 [I’m afraid I’ve also introduced an error in the last 3 commits]. He thought I also disagreed on:

    1. static variables contained in policy.o should become parameters of the reference policy implementation (CStandardPolicy).

    I don’t: I was just leaving that for later.

    This PR is mostly composed of code movements that I expect will be uncontroversial. 3 commits just move a single function and its associated globals if any. 2 of them are not purely moveonly because they change the function headers or move some functionality from one function to another, but are mostly code movements. Finally, the last commit creates a CPolicy interface (abstract class) and a CStandardPolicy implementation; and it’s open for method name bikesheding. @luke-jr if you like this PR I’m closing #5595 and #5114.

  2. laanwj added the label TX fees and policy on Jan 19, 2015
  3. Includes: MOVEONLY: Move CNodeStateStats from main.h to net.h b466cfecb6
  4. Includes: MOVEONLY: Move some method definitions from wallet.h to wallet.cpp
    Methods moved:
    
    CWallet::IsMine()
    CWallet::GetDebit()
    CWallet::GetCredit()
    CWallet::GetChange()
    CWalletTx::IsTrusted()
    0fb34e2c94
  5. Includes: Refactor: Move CValidationInterface and CMainSignals out of main 3ef9115fc7
  6. Includes: Cleanup includes 70a502f60a
  7. Consensus: Refactor: Decouple CValidationState from main::AbortNode() a4f93af231
  8. Consensus: SQUASHME: MOVEONLY: Move CValidationState from main.h to consensus/validation.h 60e892ed53
  9. Consensus: Refactor: CheckTransaction() -> Consensus::CheckTx()
    Decouple it from util.h [bool error(char*)] and BOOST_FOREACH
    38b29bc3ca
  10. Consensus: SQUASHME: MOVEONLY: Consensus::CheckTx() from main.o to consensus/consensus.o 4eaa4f2a92
  11. Consensus: SQUASHME: Small improvements to Consensus::CheckTx() 05c77c9f53
  12. Policy: Refactor: implement more generic versions of GetArgs() functions in utilstrencodings.h 2e9627c9f2
  13. Policy: Create CPolicy interface and CStandardPolicy class implementing it 8118d9a316
  14. Policy: MOVEONLY: script/standard.o::IsStandard() -> CPolicy::ValidateScript() 8375151e09
  15. Policy: Refactor: Move datacarrier policy logic to policy.o 1615b92fc7
  16. Policy: MOVEONLY: global minRelayTxFee from main.o to policy.o
    (and initialize minRelayTxFee in InitPolicyFromArgs())
    ca3c5a8964
  17. Policy: Refactor: CTxOut::IsDust(CFeeRate) -> CPolicy::ValidateOutput(CTxOut)
    Decouples CTxOut from CFeeRate
    Simplifies IsDust() interface encapsulating the access to global minRelayTxFee
    fc5f6d5156
  18. Policy: Refactor: main::IsStandardTx(CTransaction, string) -> CPolicy::ValidateTx(CTransaction, CValidationState) dea1606989
  19. jtimon force-pushed on Jan 21, 2015
  20. jtimon renamed this:
    Policy: Create CPolicy interface and CStandardPolicy implementation
    Policy: Continue policy movements
    on Jan 21, 2015
  21. jtimon commented at 11:35 am on January 21, 2015: contributor
    Closing for now, at least until some agreement is found in #5595.
  22. jtimon closed this on Jan 21, 2015

  23. MarcoFalke locked this on Sep 8, 2021


jtimon

Labels
TX fees and policy


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-10-06 16:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me