Do not relay or mine excessive sighash transactions #8591

pull rebroad wants to merge 1 commits into bitcoin:master from rebroad:NoExcessiveSighashTxs changing 1 files +13 −1
  1. rebroad commented at 1:49 PM on August 25, 2016: contributor

    This is a belt-and-suspenders fix to make sure CreateNewBlock() or external mining software can never produce a block that violates the MAX_BLOCK_SIGHASH rule.

    It does this by rejecting transactions that do too much signature hashing -- they are not added to the memory pool, and so will not be considered for inclusion in new blocks.

    How the code works: every transaction uses up some fraction of the MAX_BLOCK_SIZE limit and the MAX_BLOCK_SIGHASH limit. If a transaction uses up a larger fraction of the SIGHASH limit than the SIZE limit, it is rejected. That ensures that no matter which transactions are selected for the block, the SIZE limit will be hit before the SIGHASH limit.

    This is a much simpler solution than modifying CreateNewBlock or external transaction selection software to keep track of the SIZE limit, the SIGOPS limit, AND the new SIGHASH limit.

    This is belt-and-suspenders because, in practice, the 100,000-byte IsStandard size limit prevents the block SIGHASH limit from being hit.

    The IsStandard code related to the old SIGOPS limit is left unchanged.

  2. Do not relay or mine excessive sighash transactions
    This is a belt-and-suspenders fix to make sure CreateNewBlock() or external mining software can never produce a block that violates the MAX_BLOCK_SIGHASH rule.
    
    It does this by rejecting transactions that do too much signature hashing -- they are not added to the memory pool, and so will not be considered for inclusion in new blocks.
    
    How the code works: every transaction uses up some fraction of the MAX_BLOCK_SIZE limit and the MAX_BLOCK_SIGHASH limit. If a transaction uses up a larger fraction of the SIGHASH limit than the SIZE limit, it is rejected. That ensures that no matter which transactions are selected for the block, the SIZE limit will be hit before the SIGHASH limit.
    
    This is a much simpler solution than modifying CreateNewBlock or external transaction selection software to keep track of the SIZE limit, the SIGOPS limit, AND the new SIGHASH limit.
    
    This is belt-and-suspenders because, in practice, the 100,000-byte IsStandard size limit prevents the block SIGHASH limit from being hit.
    
    The IsStandard code related to the old SIGOPS limit is left unchanged.
    
    Conflicts:
    	src/main.cpp
    36eb2ca620
  3. MarcoFalke commented at 2:30 PM on August 25, 2016: member

    @rebroad Have you tried compiling this locally?

  4. rebroad commented at 2:38 PM on August 25, 2016: contributor

    @MarcoFalke no, not yet

  5. sipa commented at 2:47 PM on August 25, 2016: member

    Please don't submit code you haven't even tried yourself.

  6. sipa closed this on Aug 25, 2016

  7. rebroad commented at 3:09 PM on August 25, 2016: contributor

    @sipa Apologies.. I didn't expect anyone would look at it until Travis had given it the all clear - is there a preferred way to get Travis to look at my code before any of the Core developers, such as yourself, do?

  8. sipa commented at 3:14 PM on August 25, 2016: member

    It's fine to submit a pull request you're confident about to get all the testing Travis does. But please try compiling things yourself first before wasting other's time.

    In this case you're clearly missing a file. It would also be nice to credit the original author of the code...

  9. jl2012 commented at 3:26 PM on August 25, 2016: contributor

    I think it is abusing Travis for submitting codes that clearly won't compile

  10. rebroad commented at 3:44 PM on August 25, 2016: contributor

    @sipa The author is already clearly credited - Gavin's photo appears next to the commit, and it would be Gavin's name, as far as I know that would appear in the commit log - although I'm not sure this is ideal given that I made some edits to it - anyway, I was mostly testing, and perhaps @jl2012 is correct when saying I was abusing Travis! I'm not aware of a Travis policy, so if there is one, please do let me know about it.

  11. sipa commented at 3:45 PM on August 25, 2016: member

    @rebroad Well at least first get your code to run fine for yourself...

  12. rebroad deleted the branch on Aug 25, 2016
  13. MarcoFalke 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: 2026-04-22 18:15 UTC

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