Understanding Sporks

From Terracoin Wiki
Revision as of 16:37, 16 January 2018 by TheSin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Originally developed by DASH.

A multi-phased fork, colloquially known as a "spork", is a mechanism unique to Terracoin used to safely deploy new features to the network through network-level variables to avoid the risk of unintended network forking during upgrades. It can also be used to disable certain features if a security vulnerability is discovered - see Spork for a brief introduction to sporks. This documentation describes the meaning of each spork currently existing on the network, and how to check their respective statuses.

Spork functions

Sporks are set using integer values. Many sporks may be set to a particular epoch datetime (number of seconds that have elapsed since January 1, 1970) to specify the time at which they will active. Enabled sporks are set to 0 (seconds until activation). This function is often used to set a spork enable date so far in the future that it is effectively disabled until changed. The following sporks currently exist on the network and serve functions as described below:

SPORK_1_INSTANTSEND_ENABLED: Governs the ability of Terracoin clients to use InstandSend functionality.

SPORK_2_INSTANTSEND_BLOCK_FILTERING: If enabled, masternodes will reject blocks containing transactions in conflict with locked but unconfirmed InstandSend transactions.

SPORK_3_INSTANTSEND_MAX_VALUE: Enforces the maximum value in TRC that can be included in an InstantSend transaction.

SPORK_4_MASTERNODE_PAYMENT_ENFORCEMENT: If enabled, miners must pay 50% of the block reward to a masternode currently pending selection or the block will be considered invalid.

SPORK_5_SUPERBLOCKS_ENABLED: If enabled, superblocks are verified and issued to pay proposal winners.

SPORK_6_RECONSIDER_BLOCKS: Forces reindex of a specified number of blocks to recover from unintentional network forks.

SPORK_7_REQUIRE_SENTINEL_FLAG: Toggles whether masternodes with status are eligible for payment if status is WATCHDOG_EXPIRED, i.e. Sentinel is not running properly.

Viewing spork status

The spork show and spork active commands issued in the debug window (or from terracoin-cli on a masternode) allow you to interact with sporks. You can open the debug window by selecting Tools > Debug console.

Debug Console Sporks

spork show and spork active output in the Terracoin Core debug console