Repository navigation
Batched Rollup Payouts, Upgraded SigmaFi LendOffer Pins and Security Hardening
Lithos Client 1.0.10 brings batched rollup payouts on-chain: a single Lithos block can now pay up to 128 miners out of a rollup in one fee-less transaction, backed by verified miner proposition storage, a one-time upgrade backfill, and jittered payout broadcast withholding so miners do not race to pay mempool fees before a Lithos block settles the rollup for everyone. SigmaFi ZC is repinned to Sigma-Finance-V2
4790a7dfor the upgradedLendOffercontract while keeping live legacy offers viewable, matchable, refundable and cancellable. Arbitrage tracks pending SigmaUSD bank transactions and isolates unpriced ZC collateral sweeps into dedicated dust boxes, public ZC reads gate wallet flags behind optionalapi_keyauthentication, and a post-1.0.9 hardening pass strengthensCandidateBuilder,ZcBook,ZcResolver,ZcFillsand all API controllers.
Released: December 2, 2026
Commit: 6015340
This update includes findings and fixes from @a-shannon. Thank you for your contributions!
To run the application, unzip the file and then run the script in the /bin directory.
./lithos-client
This will automatically read from lithos.conf in your /bin folder.
To run with a custom configuration file add the argument -Dconfig.file=
./lithos-client "-Dconfig.file=path/to/custom/config/file.conf"
To build from source run:
sbt dist
This will create a new zip file in the /target/universal directory.
Release Notes:
Upgrade Notes
- No full re-sync required. The state snapshot schema advances from v5 to v6 to persist each rollup's
payoutHeight, while remaining backward-compatible with v5 metadata and shared dictionary blobs. - One-time miner proposition backfill. Nodes restoring a pre-1.0.10 snapshot automatically walk the verified Miner Dictionary spend chain once in the background (
MDSyncTask) to populate payout propositions for previously registered miners. No manual action is needed. - Ship the whole
conf/folder (or add the three newstratum.candidate.sources.rollups.payout*keys if yourlithos.confcopiesapplication.confrather than including it). - Payouts now wait before broadcasting to the mempool. By default, payouts are withheld from funded mempool broadcasts for
32blocks plus0–7blocks of deterministic per-(rollup, miner) jitter after entering the payout phase, giving Lithos blocks time to settle every miner in one fee-less batched transaction. Setstratum.candidate.sources.rollups.payoutBroadcastAfterBlocks = 0to restore immediate mempool fallback. - SigmaFi ZC is repinned to Sigma-Finance-V2
4790a7d(LendOfferupgrade). All new lend offers created viaPOST /sigmafi/zc/offerstarget the upgradedLendOffercontract. Live pre-upgradeLendOfferboxes remain tracked, viewable, matchable/batchable (preserving their legacy script across chained partial fills), expiry-refundable and cancellable, and are flaggedlegacy: truein the API and Legacy in the web panel so owners can cancel and recreate them on the upgraded contract. - Public ZC reads now require
api_keyto populatemineandborrowedByMe. Public read routes (asks,offers,curves,orderbook,matches,auctions,lookup,search,POST /sigmafi/zc/assets) still succeed without a key; passing theapi_keyheader is optional and enables wallet-ownership flags (invalid keys on optional-auth reads are ignored rather than returning403). The bundled web panel attaches your configured API key automatically. - Unauthenticated ZC
/checkquotes are now per-IP rate-limited (burst10, then2/s) and use a separate public preview pool (MaxPreviews = 4), so public traffic cannot starve authenticated checks or simulations. lithos.apiKeyHashis now trimmed and lowercased across all 11 API controllers, matching startupConfigValidationso uppercase hex hashes in config work consistently everywhere.
Batched Rollup Payouts & Payout Withholding
- Batched payouts (
payoutMaxBatchSize = 128, range1..256).RollupTransactions.planBatchPayoutandgenBatchPayoutpay the local miner first followed by up topayoutMaxBatchSize - 1resolved remote miners (ordered deterministically by unsigned hash) in a singlePayouttransaction. Each remote output is verified against the node's live per-byte box minimum before inclusion; miners without a stored proposition remain on the payout successor box. - Adaptive batch shrinking. If a batched payout exceeds the target serialized transaction byte cap (
90,000 B), the rollup candidate byte/cost budget, or Ergo's prover execution cost limit (CostLimitException), the builder halves the batch size down to1automatically rather than dropping the payout. - Verified miner proposition persistence (
MinerProposition,MDDatabase). Extracts each miner'sSigmaPropproposition fromCTX_SIGNERon Miner Dictionary registrations (context var1) and NISP submissions (context var0) during block sync, dictionary bootstrap and rollup repair. Every entry is validated as a constantSigmaBoolean(<= 4,096 B) satisfyingblake2b256(propBytes) == minerHashon both write and read. - Payout broadcast withholding (
payoutBroadcastAfterBlocks = 32,payoutBroadcastJitterBlocks = 8).BlockReducerrecordspayoutHeightwhen a rollup transitions fromEVALtoPAYOUTand preserves it across partial payouts. While inside the hold window (payoutHeight + 32 + jitter), mining clients continuously offer the fee-less batched payout on every candidate block (ordered oldestpayoutHeightfirst) instead of releasing it to the mempool after one missed block; non-mining nodes also wait out the window so another Lithos miner's block can pay them fee-free before any funded fallback broadcasts. - Zero-burn LIT residue handling in candidate blocks. A final candidate payout with LIT flooring residue leases one confirmed wallet box (tokenless
>= 0.001 ERGpreferred, or token-bearing>= 0.002 ERG) so the residual nanoLIT returns whole to your wallet without burning any LIT, reusing the held bundle across mid-block refreshes. If no confirmed box is free and multiple claimants are in the batch, the candidate falls back to a fee-lessN - 1partial payout leaving one remote miner's entitlement and the LIT residue on the successor box. - Pending
EvalTransformchild protection on refresh. Mid-block candidate refreshes re-checkCompleteMempool.Refreshagainst all outputs of a superseded pendingEvalTransformbefore reusing a held replacement bundle, ensuring a new mempool child spending the transform's change or fee-allocation output is never displaced.
SigmaFi ZC LendOffer Upgrade & Legacy Support
- Repinned
lithos-lib/src/main/resources/sigmafi/zc/contracts.tsvto Sigma-Finance-V2 commit4790a7dand addedlegacy-offers.tsvfor pre-upgradeLendOffertrees. ZcContracts.allScriptsandZcTrackerscan both canonical and legacyLendOffertrees;ZcBatchTransactionspreservesoffer.script.contracton partial-fill continuations so live legacy offers continue matching cleanly until filled, expired or cancelled.- Legacy offers expose
"legacy": truein API JSON (offers,orderbook,lookup,portfolio) and carry an explicit origin check note recommending owners cancel and recreate on the upgraded contract.
Arbitrage & ZC Collateral Sweeps
- Pending SigmaUSD bank tracking.
ArbStage,ArbPending,ArbDiscoveryandArbCyclesnow track unconfirmed mempool spends of the SigmaUSD bank box (locating the bank NFT atassets(2)viapool.holder), letting arbitrage cycles read and build on pending bank state rather than dropping back to stale confirmed boxes. - Isolated unpriced collateral sweeps. Both in-block (
ZcCollateralArb) and every-block (ZcMempoolArb) ZC collateral arbitrage isolate unpriced tokens from purchased ZC boxes into a dedicated, exact-sized dust sweep box (<= 30unpriced tokens), keeping the wallet/carry ERG output token-clean and accounting for exact sweep box ERG sizing before verifyingminProfit.
Security & Stability Hardening
CandidateBuilder(SIGMA_TRUEfail-closed). UnderuseTruePropCollection = true, caps revenue bundles atCandidateTopUp.MaxRevenueInputs(74), propagates cap-drops transitively to dependent bundles, retries admission with top-up headroom, and fails closed by dropping revenue bundles (and their dependents) if the holding top-up cannot spend every revenue entry in the same block.ZcBookeviction & rollback hardening.- Eviction ranking (
evictionScore) strictly prioritizes state boxes (Bond,BondVault,FractionalVault,DutchAuctionVault,WrapVault) over non-state boxes and applies a conservative ERG-equivalent floor for SigUSD holdings so low-ERG SigUSD positions resist dust-spam eviction. - Separates
stateCutandminterCuttracking (restoring cut flags and filtering same-block minted-and-dropped origins on fork rollback) and resolvesINPUTS(0)minters directly from indexed block inputs. - Evaluates chained mempool minters and state moves in
ZcMempoolto a fixpoint so reverse-ordered unconfirmed chains are admitted cleanly. - Raises
ZcBook.MaxHistoryfrom16to32(exceedingZcResolver.Settled = 30) so unsettled cached origins remain canonical-header-verified across their entire settling window.
- Eviction ranking (
ZcResolvercache hardening. Snapshots the canonical tip before RPC reads so a concurrent reorg cannot tag an orphaned origin with the replacement header, capsVar(64)script disclosure unpacking at32trees per variable, and caches only scripts actually referenced by ZC outputs.ZcFillsask-fill verification. Rejects expired ask refunds (HEIGHT >= expiry), seller-cancel co-spends, zero-payment fills, under-floor payments, payout index mismatches against context var0, and self-returned ask tokens; propagates transient RPC failures instead of silently recording incomplete fills.- ZC API auth isolation & controller hardening.
- Gates
mine/borrowedByMeon public reads and wallet hash/tree checks on open/checkquotes (fillOrder,buyAsk,buyLot,mint) behind optionalapi_keyauth;simulatestays wallet-independent and bypasses the public IP limiter when authenticated. - Splits preview concurrency into separate
publicPreviewsandauthedPreviewssemaphores (4slots each) and adds per-IP rate limiting (10burst,2/s) on unauthenticated/checkquotes. - Normalizes
lithos.apiKeyHash(.trim.toLowerCase(Locale.ROOT)) consistently across all 11 API controllers.
- Gates
Configuration
- Added
stratum.candidate.sources.rollups.payoutBroadcastAfterBlocks(32, range0..720). - Added
stratum.candidate.sources.rollups.payoutBroadcastJitterBlocks(8, range0..64). - Added
stratum.candidate.sources.rollups.payoutMaxBatchSize(128, range1..256).
Webpanel & WebDocs
- Bundled
public/rebuilt fromLithos-WebDocscommit2a31e80. - SigmaFi & Wallet web panels: Opportunistically attach the configured
api_keyon public ZC reads,/sigmafi/zc/assetschecks,/simulateand open/checkquotes (clearing stale caches and forcing a refresh withoutifRevisionwhenever the API key changes), and surface Legacy tags and migration callouts for pre-upgradeLendOfferboxes across OfferPage, Portfolio, RateBook, Sidebar, Simple and OfferPeek. - Documentation updates:
- Block packages, Rollups and Candidate building: documented batched payouts, proposition persistence, payout broadcast withholding (
payoutBroadcastAfterBlocks,payoutBroadcastJitterBlocks,payoutMaxBatchSize), LIT-residue confirmed-box leasing and the new withholding log line. - SigmaFi API, Borrowing, Contracts, SigmaFi Bonds and regenerated OpenAPI reference (
/api): documented optionalapi_keyauth on ZC reads/checks and4790a7dlegacyLendOffercompatibility.
- Block packages, Rollups and Candidate building: documented batched payouts, proposition persistence, payout broadcast withholding (