Post
Topic
Board Bitcoin Discussion
Re: Last Time. In small words. Why 2MB impossible. Why Soft Fork. Why SegWit First..
by
franky1
on 02/05/2017, 20:38:22 UTC
which file has the sigops limit?  i would like to see

it requires basic elementary/primary school level maths and reading a couple locations wrote in c++ which i know lauda has a hard time dealing with. so i simplified it for him by just using laymans: maxtxsigop=16k

but for those able to read and do basic maths

https://github.com/bitcoin/bitcoin/blob/master/src/policy/policy.h
Quote
/** The maximum number of sigops we're willing to relay/mine in a single tx */
static const unsigned int MAX_STANDARD_TX_SIGOPS_COST = MAX_BLOCK_SIGOPS_COST/5;
and here is where the MAX_BLOCK_SIGOPS_COST exists
https://github.com/bitcoin/bitcoin/blob/master/src/consensus/consensus.h
Quote
/** The maximum allowed number of signature check operations in a block (network rule) */
static const int64_t MAX_BLOCK_SIGOPS_COST = 80000;

rearranged into one line of text is:
 MAX_STANDARD_TX_SIGOPS_COST = MAX_BLOCK_SIGOPS_COST/5;
becomes
MAX_STANDARD_TX_SIGOPS_COST = 80000/5 = 16,000
meaning
"The maximum number of sigops we're willing to relay/mine in a single tx = 16k"


also worth noting
in short you can use up a base blocks entire MAX_BLOCK_SIGOPS_COST with just 5 tx of 16k sigops

also worth noting
thats 3 different spam attack vectors

1. just fill a block of native data to 1mb
2. use up the block sigops limit with say 1000tx of just 80sigops each for example
3. use up the block sigops limit with say 5tx of just 16,000sigops each for example