Repository navigation
feat(runtime)!: private entries wait unbonded until they settle, ending the reward leak from pending entries to minted shares; events name each entry's key and Compounded the share price (spec 24, v0.10.0) - #194
Merged
Conversation
…time key and Compounded announces the share price (spec 24, v0.10.0)
…ounds, so pending entries draw no pool rewards for the shares already minted, and a refund is paid at once (spec 24)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Spec 24, v0.10.0. Two changes to private staking:
Compoundedannounces the share price.Plus a wasmtime patch bump for three new advisories.
1. The reward leak
Until spec 23 an entry's ORB was bonded the moment it entered, but its shares were minted only after its era compounded. The pool hands out rewards by points at payout time, so a pending entry's points drew rewards its stake had not earned (it was not exposed in that era). Compounding then bonded those rewards as points of the minted shares. Value moved from entrants and the pool's public members to the private holders.
On testnet pool 1, from the indexer (m_P's payout at each compounding vs the share of its points that were pending entries):
About 1,460 ORB over three eras, most of pool 1's share price rise (25 → 643 ORB). It also drove the mass refunds: entries priced against the inflated price fell under the app's old
min_shares.Fix
m_P's free balance, unbonded, counted in a new storage itemEntryEscrow. A pending entry has no points, so it draws no rewards and bears no slash.bond_extra, orjoinfor the pool's first private entry); then its shares are minted.liquid()leavesEntryEscrowout.m_P, so it is queued as an output already funded and minted in the same block.EntryRefunded.unlock_erais the era it settled in. No unbonding wait.points > 0) settle the old way on their points (EntryPoints, which only drains now). No migration:Entryis unchanged andEntryEscrowstarts empty.step_weightcovers a settling entry's firstjoin.try_statechecksEscrow + EntryEscrow <= m_P's free balance.Once settled, an entry is a holder like any other. Bonding right before a payout shares that payout, as for any nomination pool member who joins (standard pool behavior); nothing moves from waiting entries to holders anymore.
2. Events
Entered,Exited,EntrySettled,EntryRefundedandExitSettledcarryowner_pk, the entry's or exit's one-time key, already public in its bound spend's action. Wallets and indexers can follow an entry to its outcome without decoding calls or matching amounts. A refund's ORB is paid byExitSettledto the entry's key.Compoundedcarriesvalueandsupply(the share price per era). Its four reads are charged incompound_weight.Dependencies
cargo denyflagged three new wasmtime advisories in the node's executor: RUSTSEC-2026-0566, RUSTSEC-2026-0569 and RUSTSEC-2026-0571.cargo update -p wasmtimetakes wasmtime to 36.0.22 and cranelift to 0.123.22, patch releases within the same major;Cargo.lockonly.Other
The shared signed-text vectors (
ed25519_text_vectors.json) are regenerated: the signed payload carriesspec_version(23 → 24). The copy in ts-protocol is synced in its own PR.No call changes:
transaction_versionstays 8.Tests
fast-runtimebefore the fix: the holder earned 14.36 ORB with an entry pending vs 3.32 without.fast-runtime386/386,runtime-benchmarks,skip-proof-verification387/387, default 390/390.runtime-benchmarks,skip-proof-verification,try-runtime,-D warnings) and rustfmt clean.cargo deny checkpasses.app/scripts/e2e-private-stake): 22/22. On chain it checks that a pending entry is escrowed (EntryEscrow= its value), that a refund is paid in the same block, and that the escrow is bonded once shares are minted. In the UI and the indexer it checks the refund, settlement, share price over two eras, exit and restore.