Skip to content

Consensus Limits

Patrick Fromberg edited this page Apr 20, 2022 · 3 revisions

Definitions: Bitcoin Rules, Consensus Rules, Polies:

While Policies are rules local to any node, Bitcoin Rules and Consensus Rules are global and must be obeyed by all nodes. Bitcoin Rules are immutable while Consensus Rules can change over time.

Note that both Bitcoin and Consensus Rules must be honoured by all miners because otherwise this can lead to increased network load, unfair banning, selfish mining or even a fork in the worst case. For e.g., transactions may be rejected according to local policies, but they need to be accepted during block verification according to consensus rules. A relaying peer may not be banned if not honouring the local policy as long as it honours the consensus limits.

-genesisactivationheight=<n>

Set block height at which genesis should be activated. (default: 620538). This value may not be changed on mainnet as it will break consensus.
Variables:

  • GENESIS_ACTIVATION_MAIN = 620538
  • GENESIS_ACTIVATION_STN = 100
  • GENESIS_ACTIVATION_TESTNET = 1344302
  • GENESIS_ACTIVATION_REGTEST = 10000

Maximum Coinbase ScriptSig Size = 100B

The maximum ScriptSig Size of a coinbase transaction output.
Variables:

  • MAX_COINBASE_SCRIPTSIG_SIZE = 100B

Coinbase Maturity

Number of confirmations for a coinbase transaction to be spendable.

  • COINBASE_MATURITY = 100

-maxtxsizepolicy=<n>

Set maximum transaction size in bytes we relay and mine (default: 10 MB, min: 99999 B, 0 = unlimited within consensus) after Genesis is activated.
The value may be given in bytes or with unit (B, kB, MB, GB).
Variables:

  • MAX_TX_SIZE_CONSENSUS_AFTER_GENESIS = 1GB
  • DEFAULT_MAX_TX_SIZE_POLICY_AFTER_GENESIS = 10MB
  • MAX_TX_SIZE_CONSENSUS_BEFORE_GENESIS = 1MB

Note that transactions greater policy allowances while still within the consensus limits will not lead to banning of a node relaying such transactions.

-maxscriptsizepolicy=<n>

Set maximum script size in bytes we're willing to relay/mine per script
Variables:

  • DEFAULT_MAX_SCRIPT_SIZE_POLICY_AFTER_GENESIS = 500 * ONE_KILOBYTE

-maxopsperscriptpolicy=<n>

Set maximum number of non-push operations we're willing to relay/mine per script (default: unlimited, 0 = unlimited), after Genesis is activated
Variables:

  • MAX_OPS_PER_SCRIPT_AFTER_GENESIS = UINT32_MAX
  • DEFAULT_OPS_PER_SCRIPT_POLICY_AFTER_GENESIS = UINT32_MAX
  • MAX_OPS_PER_SCRIPT_BEFORE_GENESIS = 500
  • DEFAULT_OPS_PER_SCRIPT_POLICY_BEFORE_GENESIS = NA

-maxpubkeyspermultisigpolicy=<n>

Set maximum allowed number of public keys we're willing to relay/mine in a single CHECK_MULTISIG(VERIFY) operation (default: unlimited, 0 = unlimited), after Genesis is activated
Variables:

  • DEFAULT_PUBKEYS_PER_MULTISIG_POLICY_AFTER_GENESIS = UINT32_MAX
  • DEFAULT_PUBKEYS_PER_MULTISIG_POLICY_BEFORE_GENESIS = NA
  • MAX_PUBKEYS_PER_MULTISIG_BEFORE_GENESIS = 20
  • MAX_PUBKEYS_PER_MULTISIG_AFTER_GENESIS = UINT32_MAX

-maxscriptnumlengthpolicy=<n>

Set maximum allowed number length we're willing to relay/mine in scripts (default: 10000, 0 = unlimited) after Genesis is activated. The value may be given in bytes or with unit (B, kB, MB, GB).
Variables:

  • DEFAULT_SCRIPT_NUM_LENGTH_POLICY_AFTER_GENESIS = 10KB
  • MAX_PUBKEYS_PER_MULTISIG_AFTER_GENESIS = 750KB
  • DEFAULT_SCRIPT_NUM_LENGTH_POLICY_BEFORE_GENESIS = NA
  • MAX_PUBKEYS_PER_MULTISIG_BEFORE_GENESIS = 4KB

-excessiveblocksize=<n>

Set the maximum block size in bytes we will accept from any source. This is the effective block size hard limit and it is a required parameter (0 = unlimited). The value may be given in bytes or with unit (B, kB, MB, GB).
Variables:

  • LEGACY_MAX_BLOCK_SIZE = 1MB
  • MAIN_DEFAULT_MAX_BLOCK_SIZE = INT64_MAX
  • REGTEST_DEFAULT_MAX_BLOCK_SIZE = INT64_MAX
  • TESTNET_DEFAULT_MAX_BLOCK_SIZE = INT64_MAX
  • STN_DEFAULT_MAX_BLOCK_SIZE = INT64_MAX

-blockmaxsize=<n>

Set maximum block size in bytes we will mine. Size of the mined block will never exceed the maximum block size we will accept (-excessiveblocksize). The value may be given in bytes or with unit (B, kB, MB, GB). If not specified, the following defaults

-maxtxsigopscountspolicy=<n>

Set maximum allowed number of signature operations we're willing to
relay/mine in a single transaction (default: unlimited, 0 =
unlimited) after Genesis is activated.