Consensus: Turn CBlockIndex::GetMedianTimePast into independent function #6009

pull jtimon wants to merge 7 commits into bitcoin:master from jtimon:consensus_mediantime changing 26 files +244 −126
  1. jtimon commented at 5:31 pm on April 13, 2015: contributor
    ContextualCheckBlockHeader() [which is needed to verify a block header] depends on CBlockIndex::GetMedianTimePast but the goal is for verify block header is to be independent from chain.o and CBlockIndex C++ class [which cannot be exposed in the consensus C API]. This is also contained in #5995.
  2. jtimon force-pushed on Apr 13, 2015
  3. jtimon force-pushed on Apr 20, 2015
  4. jtimon commented at 7:49 pm on April 20, 2015: contributor
    Needed rebase.
  5. laanwj added the label Consensus on Apr 29, 2015
  6. jtimon force-pushed on Apr 29, 2015
  7. jtimon commented at 2:15 pm on April 29, 2015: contributor
    Needed rebase.
  8. sipa commented at 6:48 am on April 30, 2015: member
    utACK
  9. sipa commented at 2:57 pm on June 16, 2015: member
    Needs rebase.
  10. jtimon commented at 3:20 pm on June 16, 2015: contributor
    @sipa I know, but I’m waiting for #6051 to be merged since it will require another rebase after that.
  11. jtimon force-pushed on Jun 21, 2015
  12. jtimon commented at 1:02 pm on June 21, 2015: contributor
    Rebased
  13. in src/consensus/blockverify.cpp: in 704737c721 outdated
     5+
     6+#include "consensus/consensus.h"
     7+
     8+#include "chain.h"
     9+
    10+#include <algorithm>  
    


    petertodd commented at 5:07 am on June 22, 2015:
    Nit: tailing whitespace
  14. petertodd commented at 5:20 am on June 22, 2015: contributor
    Modulo nit, (somewhat tested) ACK.
  15. jtimon force-pushed on Jun 25, 2015
  16. jtimon commented at 5:13 pm on June 25, 2015: contributor
    @petertodd ’s nit fixed.
  17. btcdrak commented at 2:03 pm on June 26, 2015: contributor
    utACK
  18. jtimon commented at 11:56 pm on July 15, 2015: contributor

    Closing for now

    EDIT: as said on #6051 I’m not convinced anymore that is a good idea to create consensus/txverify.cpp and consensus/blockverify.cpp instead of just consensus/consensus.cpp.

  19. jtimon closed this on Jul 15, 2015

  20. jtimon reopened this on Aug 26, 2015

  21. jtimon force-pushed on Aug 26, 2015
  22. jtimon commented at 8:24 am on August 26, 2015: contributor
    Rebased and reopened.
  23. jtimon force-pushed on Sep 13, 2015
  24. consensus: don't define MAX_STANDARD_TX_SIGOPS in terms of block size 46f073ba77
  25. consensus: teach ExtractMatches to check for an arbitrary max transaction number
    This is a no-op change. For now, everything passes MAX_BLOCK_SIZE / 60, so the
    result matches what it would've before.
    
    Tests use a number equal to the number of transactions where necessary,
    to ensure that they're never rejected when blocksizesize isn't being tested.
    60e6ae70ef
  26. consensus: teach CheckTransaction to check for an arbitrary max tx size
    This is a no-op change. For now, everything passes MAX_BLOCK_SIZE, so the
    result matches what it would've before.
    
    Tests use a value of std::numeric_limits<uint64_t>::max() where necessary, to ensure that they're never
    rejected when size isn't being tested.
    736dc1285c
  27. consensus: Move consensus constants into Consensus::Params and consensus.h (as functions)
    The following are now tied to a chain rather than being defined as global
    constants. Their values have not changed.
    
    nMinTxSize
    nMaxBlockSize
    nMaxTxSize
    nMaxBlockSigops
    nCoinbaseMaturity
    
    Also, for free (diff-wise):
    
    Blocksize: Turn MAX_BLOCK_SIZE (nMaxBlockSize) and MAX_BLOCK_SIGOPS (nMaxBlockSigops) into functions
    
    ...which take Consensus::Params as parameter
    This will be convenient to reduce the diff of any proposal that changes the blocksize as a hardfork
    269fe4015f
  28. Consensus: MOVEONLY: Most important consensus function declarations to consensus/consensus.h 664549eb00
  29. Consensus: Chainparams: Explicit Consensus::Params for consensus functions:
    -CheckBlockHeader
    -ContextualCheckBlockHeader
    -CheckBlock
    -ContextualCheckBlock
    
    Also add nTime parameter to CheckBlockHeader and CheckBlock.
    Also use the oportunity to rename the functions inside the Consensus namespace.
    37f7792998
  30. Consensus: Refactor: Turn CBlockIndex::GetMedianTimePast into independent function
    ...and CBlockIndex::nMedianTimeSpan into Consensus::Params::nMedianTimeSpan
    c85ded0a67
  31. jtimon force-pushed on Sep 13, 2015
  32. jtimon commented at 5:01 pm on September 13, 2015: contributor
    Rebased on top of #6591. Still had merging conflicts so rebased on top of master after that.
  33. dcousens commented at 3:17 am on September 14, 2015: contributor
    utACK for c85ded0 after nit is addressed
  34. jtimon commented at 7:54 pm on September 14, 2015: contributor
    Closing in favor of #6672 .
  35. jtimon closed this on Sep 14, 2015

  36. DrahtBot locked this on Sep 8, 2021

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