Skip to content

Commit

Permalink
Merge #6140: feat: harden all sporks on mainnet to current values
Browse files Browse the repository at this point in the history
e1030a0 docs: add release notes for 6140 (pasta)
9ed292a feat: harden all sporks on mainnet to current values (pasta)

Pull request description:

  ## Issue being fixed or feature implemented
  Harden all sporks on the mainnet; they are no longer necessary. Although retaining them might be beneficial in addressing bugs or issues, the greater priority is to protect mainnet by minimizing risks associated with potential centralization or even its perception. Sporks will continue to be valuable for testing on developer networks; however, on mainnet, the risks of maintaining them now outweigh the benefits of retaining them.

  ## What was done?
  Adjust CSporkManager::GetSporkValue to always return 0 for sporks in general and 1 for SPORK_21_QUORUM_ALL_CONNECTED specifically.

  ## How Has This Been Tested?
  Ran main net node with this patch. Sporks show as expected

  ## Breaking Changes
  This is not a breaking change.

  ## Checklist:
  - [x] I have performed a self-review of my own code
  - [x] I have commented my code, particularly in hard-to-understand areas
  - [ ] I have added or updated relevant unit/integration/functional/e2e tests
  - [ ] I have made corresponding changes to the documentation
  - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_

ACKs for top commit:
  knst:
    utACK e1030a0
  UdjinM6:
    utACK e1030a0 (CI failure is unrelated)

Tree-SHA512: f20d0f614b7e9d6eb5606c545d0747a9d415f2905512dd6100a2f9fb00bb6de02c8d5aa74cb41aa39163fde0ab05fe472913acc227b1b4afce7e984f8897940d
  • Loading branch information
PastaPastaPasta committed Jul 23, 2024
2 parents 1e9694d + e1030a0 commit 9855363
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/release-notes-6140.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Mainnet Spork Hardening
-----------------------

This version hardens all Sporks on mainnet. Sporks remain in effect on all devnets and testnet; however, on mainnet,
the value of all sporks are hard coded to 0, or 1 for SPORK_21_QUORUM_ALL_CONNECTED. These hardened values match the
active values historically used on mainnet, so there is no change in the network's functionality.
10 changes: 10 additions & 0 deletions src/spork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,16 @@ bool CSporkManager::IsSporkActive(SporkId nSporkID) const

SporkValue CSporkManager::GetSporkValue(SporkId nSporkID) const
{
// Harden all sporks on Mainnet
if (!Params().IsTestChain()) {
switch (nSporkID) {
case SPORK_21_QUORUM_ALL_CONNECTED:
return 1;
default:
return 0;
}
}

LOCK(cs);

if (auto opt_sporkValue = SporkValueIfActive(nSporkID)) {
Expand Down

0 comments on commit 9855363

Please sign in to comment.