Skip to content

Lithos Mainnet 1.0.10

Latest

Choose a tag to compare

@K-Singh K-Singh released this 02 Dec 16:58

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 4790a7d for the upgraded LendOffer contract 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 optional api_key authentication, and a post-1.0.9 hardening pass strengthens CandidateBuilder, ZcBook, ZcResolver, ZcFills and 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 new stratum.candidate.sources.rollups.payout* keys if your lithos.conf copies application.conf rather than including it).
  • Payouts now wait before broadcasting to the mempool. By default, payouts are withheld from funded mempool broadcasts for 32 blocks plus 0–7 blocks 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. Set stratum.candidate.sources.rollups.payoutBroadcastAfterBlocks = 0 to restore immediate mempool fallback.
  • SigmaFi ZC is repinned to Sigma-Finance-V2 4790a7d (LendOffer upgrade). All new lend offers created via POST /sigmafi/zc/offers target the upgraded LendOffer contract. Live pre-upgrade LendOffer boxes remain tracked, viewable, matchable/batchable (preserving their legacy script across chained partial fills), expiry-refundable and cancellable, and are flagged legacy: true in 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_key to populate mine and borrowedByMe. Public read routes (asks, offers, curves, orderbook, matches, auctions, lookup, search, POST /sigmafi/zc/assets) still succeed without a key; passing the api_key header is optional and enables wallet-ownership flags (invalid keys on optional-auth reads are ignored rather than returning 403). The bundled web panel attaches your configured API key automatically.
  • Unauthenticated ZC /check quotes are now per-IP rate-limited (burst 10, then 2/s) and use a separate public preview pool (MaxPreviews = 4), so public traffic cannot starve authenticated checks or simulations.
  • lithos.apiKeyHash is now trimmed and lowercased across all 11 API controllers, matching startup ConfigValidation so uppercase hex hashes in config work consistently everywhere.

Batched Rollup Payouts & Payout Withholding

  • Batched payouts (payoutMaxBatchSize = 128, range 1..256). RollupTransactions.planBatchPayout and genBatchPayout pay the local miner first followed by up to payoutMaxBatchSize - 1 resolved remote miners (ordered deterministically by unsigned hash) in a single Payout transaction. 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 to 1 automatically rather than dropping the payout.
  • Verified miner proposition persistence (MinerProposition, MDDatabase). Extracts each miner's SigmaProp proposition from CTX_SIGNER on Miner Dictionary registrations (context var 1) and NISP submissions (context var 0) during block sync, dictionary bootstrap and rollup repair. Every entry is validated as a constant SigmaBoolean (<= 4,096 B) satisfying blake2b256(propBytes) == minerHash on both write and read.
  • Payout broadcast withholding (payoutBroadcastAfterBlocks = 32, payoutBroadcastJitterBlocks = 8). BlockReducer records payoutHeight when a rollup transitions from EVAL to PAYOUT and 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 oldest payoutHeight first) 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 ERG preferred, 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-less N - 1 partial payout leaving one remote miner's entitlement and the LIT residue on the successor box.
  • Pending EvalTransform child protection on refresh. Mid-block candidate refreshes re-check CompleteMempool.Refresh against all outputs of a superseded pending EvalTransform before 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.tsv to Sigma-Finance-V2 commit 4790a7d and added legacy-offers.tsv for pre-upgrade LendOffer trees.
  • ZcContracts.allScripts and ZcTracker scan both canonical and legacy LendOffer trees; ZcBatchTransactions preserves offer.script.contract on partial-fill continuations so live legacy offers continue matching cleanly until filled, expired or cancelled.
  • Legacy offers expose "legacy": true in 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, ArbDiscovery and ArbCycles now track unconfirmed mempool spends of the SigmaUSD bank box (locating the bank NFT at assets(2) via pool.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 (<= 30 unpriced tokens), keeping the wallet/carry ERG output token-clean and accounting for exact sweep box ERG sizing before verifying minProfit.

Security & Stability Hardening

  • CandidateBuilder (SIGMA_TRUE fail-closed). Under useTruePropCollection = true, caps revenue bundles at CandidateTopUp.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.
  • ZcBook eviction & 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 stateCut and minterCut tracking (restoring cut flags and filtering same-block minted-and-dropped origins on fork rollback) and resolves INPUTS(0) minters directly from indexed block inputs.
    • Evaluates chained mempool minters and state moves in ZcMempool to a fixpoint so reverse-ordered unconfirmed chains are admitted cleanly.
    • Raises ZcBook.MaxHistory from 16 to 32 (exceeding ZcResolver.Settled = 30) so unsettled cached origins remain canonical-header-verified across their entire settling window.
  • ZcResolver cache hardening. Snapshots the canonical tip before RPC reads so a concurrent reorg cannot tag an orphaned origin with the replacement header, caps Var(64) script disclosure unpacking at 32 trees per variable, and caches only scripts actually referenced by ZC outputs.
  • ZcFills ask-fill verification. Rejects expired ask refunds (HEIGHT >= expiry), seller-cancel co-spends, zero-payment fills, under-floor payments, payout index mismatches against context var 0, and self-returned ask tokens; propagates transient RPC failures instead of silently recording incomplete fills.
  • ZC API auth isolation & controller hardening.
    • Gates mine/borrowedByMe on public reads and wallet hash/tree checks on open /check quotes (fillOrder, buyAsk, buyLot, mint) behind optional api_key auth; simulate stays wallet-independent and bypasses the public IP limiter when authenticated.
    • Splits preview concurrency into separate publicPreviews and authedPreviews semaphores (4 slots each) and adds per-IP rate limiting (10 burst, 2/s) on unauthenticated /check quotes.
    • Normalizes lithos.apiKeyHash (.trim.toLowerCase(Locale.ROOT)) consistently across all 11 API controllers.

Configuration

  • Added stratum.candidate.sources.rollups.payoutBroadcastAfterBlocks (32, range 0..720).
  • Added stratum.candidate.sources.rollups.payoutBroadcastJitterBlocks (8, range 0..64).
  • Added stratum.candidate.sources.rollups.payoutMaxBatchSize (128, range 1..256).

Webpanel & WebDocs

  • Bundled public/ rebuilt from Lithos-WebDocs commit 2a31e80.
  • SigmaFi & Wallet web panels: Opportunistically attach the configured api_key on public ZC reads, /sigmafi/zc/assets checks, /simulate and open /check quotes (clearing stale caches and forcing a refresh without ifRevision whenever the API key changes), and surface Legacy tags and migration callouts for pre-upgrade LendOffer boxes 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 optional api_key auth on ZC reads/checks and 4790a7d legacy LendOffer compatibility.