Skip to content

docs(protocol): slashing, auth surface, upgrade discipline#145

Merged
drewstone merged 2 commits intomainfrom
docs/protocol-slashing-auth-upgrade
May 5, 2026
Merged

docs(protocol): slashing, auth surface, upgrade discipline#145
drewstone merged 2 commits intomainfrom
docs/protocol-slashing-auth-upgrade

Conversation

@drewstone
Copy link
Copy Markdown
Contributor

Summary

Three new pages in /developers/ covering protocol mechanics that the docs site previously had no canonical home for. Each page was cross-checked by an audit subagent against the live tnt-core source and corrected for factual accuracy.

slashing.mdx

Lifecycle (Pending / Disputed / Executed / Cancelled), authorization with preconditions, all six SlashConfig parameters with bounds and defaults, operator runbook (received-a-slash, leave-the-network), SLASH_ADMIN runbook (review-a-dispute, detect-stuck-state), dispute economics including bond fallback semantics, per-asset commitment slashing, and the upgrade-driven evolution path.

auth-surface.mdx

Every privileged function in:

  • Tangle (Base / Slashing / Blueprints / Operators / Services / Payments)
  • MultiAssetDelegation split by facet (Admin / Assets / Slashing / Operators)
  • MBSMRegistry
  • Beacon stack (ValidatorPodManager, L2SlashingReceiver, L2SlashingConnector)
  • Governance (TangleTimelock, TangleGovernor, TangleToken)

Plus a role registry that clarifies Tangle and MAD do NOT share role constants, and that MAD has neither UPGRADER_ROLE nor PAUSER_ROLE.

upgrade-discipline.mdx

Per-contract _authorizeUpgrade gate, storage gap rules and discipline checklist, the ERC-7201 namespaced slot used for TangleTimelock._minDelay (with the OZ-version pinning rule), parameter migration playbook, post-deploy role-renunciation assertions.

Style

  • No em dashes; ASCII punctuation only.
  • Title case headings to match protocol-architecture.mdx and operators/runbook.mdx.
  • All code links pin to tangle-network/tnt-core@main.

Cross-check evidence

Audit subagents ran against ~/code/tnt-core/ and found the following errors which are now corrected:

  • The earlier draft generalized "every upgradeable contract gates _authorizeUpgrade on UPGRADER_ROLE". False for MAD (ADMIN_ROLE), Governor (onlyGovernance), Timelock (onlySelf).
  • TangleMetrics was missing from the upgradeable list.
  • setTreasury and setPaymentSplit are NOT whenNotPaused (they live in Payments.sol, not Base.sol); the blanket "all admin setters are whenNotPaused" claim is now qualified.
  • MAD's facet surface had fabricated rows (setMinOperatorStake, setSlasher); replaced with the real functions from StakingAdminFacet / StakingAssetsFacet / StakingSlashingFacet / StakingOperatorsFacet.
  • MBSM addVersion rejects EOA targets, not callers; clarified.
  • Dispute bond fallback path (bond restored on transfer fail rather than silently lost / forfeit) was previously oversimplified; now documented.
  • _startLeaving requires zero pending slashes AND zero active services; the runbook previously listed only the slash precondition.
  • The instantSlashEnabled flag has no effect through the standard public proposeSlash (which hardcodes instant=false); doc now reflects that it is reserved for future use.

Test plan

  • next dev and confirm the three new pages render under /developers/{slashing,auth-surface,upgrade-discipline}.
  • Confirm sidebar shows them under "Protocol Integration".
  • Click every code link and confirm it resolves.

Three new pages under /developers:

- slashing.mdx: lifecycle (Pending/Disputed/Executed/Cancelled), authorization
  table with preconditions, configuration parameters with bounds and defaults,
  operator runbook (received-a-slash, leave-the-network), SLASH_ADMIN runbook
  (review-a-dispute, detect-stuck-state), dispute economics including bond
  fallback semantics, per-asset commitment slashing, and the future-evolution
  path through UUPS upgrade.

- auth-surface.mdx: every privileged function in Tangle, MultiAssetDelegation
  (split across StakingAdminFacet/StakingAssetsFacet/StakingSlashingFacet/
  StakingOperatorsFacet), MBSMRegistry, the beacon stack
  (ValidatorPodManager/L2SlashingReceiver/L2SlashingConnector), and governance
  (TangleTimelock/TangleGovernor/TangleToken). Role registry clarifies that
  Tangle and MAD do not share role constants and that MAD has neither
  UPGRADER_ROLE nor PAUSER_ROLE; both flow through ADMIN_ROLE.

- upgrade-discipline.mdx: per-contract _authorizeUpgrade gate (UPGRADER_ROLE
  on most peripherals, ADMIN_ROLE on MAD, onlyGovernance on TangleGovernor,
  onlySelf on TangleTimelock), storage gap rules with discipline checklist,
  the OZ ERC-7201 namespaced slot used for TangleTimelock._minDelay
  (0x9a37c2aa...fb3600 + 1, pinned to OZ Upgradeable 5.1.0), parameter
  migration playbook, and post-deploy role-renunciation assertions.

Code links pin to tangle-network/tnt-core@main. No em dashes; ASCII
punctuation only. Headings in title case to match neighboring developer docs.

All three pages were cross-checked by parallel audit subagents against the
on-chain code and corrected for factual accuracy: dispute bond fallback
semantics (bond restored on transfer fail rather than silently lost),
instant slash flag is reserved (not exposed through the public proposeSlash
entrypoint), MAD's actual role surface (no UPGRADER_ROLE), TangleMetrics
added to the upgradeable list.

Wired into pages/developers/_meta.ts under "Protocol Integration".
@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for tangle-docs ready!

Name Link
🔨 Latest commit 45a693c
🔍 Latest deploy log https://app.netlify.com/projects/tangle-docs/deploys/69f9e18271c94c0008d053dc
😎 Deploy Preview https://deploy-preview-145--tangle-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@drewstone drewstone merged commit b8b39ef into main May 5, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant