Repository navigation
mppx@0.14.0
·
12 commits
to main
since this release
Minor Changes
-
00d3894: Added session accounting primitives to the Tempo session server, so payment servers no longer edit channel records themselves.
Session.Server.charge()(alsotempo.session.charge()) accepted anidempotencyKey: a retry with the same key and amount returned the recorded charge without charging again, and the same key with another amount threwIdempotencyKeyConflictError. It also accepted aStoreas well as a channel store.- Added
Session.Server.credit()(alsotempo.session.credit()), which returned an amount to a channel'sspentat most once per key. Its first outcome was final:credited,declinedwhen the channel was closing or finalized or the credit would takespentbelow zero or below what settled or may still settle on-chain, orunknownwhen the store write failed and may have committed. - Keyed charge and credit outcomes were recorded on the channel record for
retention(24 hours by default) and removed by the channel's next keyed charge or credit, so they worked with every channel store. settle()and the settlement schedule settled the largest accepted voucher at or belowspent(Session.Server.resolveSettleableVoucher()) instead of the highest voucher, which a credit can leave abovespent; channels kept up to 16 earlier vouchers for this. A settlement held a credit floor at its amount until its transaction could no longer land. Breaking:settle()no longer captured a voucher abovespent, and threw "nothing to settle" when no accepted voucher was withinspent.- Added
tempo.superviseCloses()(alsoSession.Server.superviseCloses()) for a scheduled job: it read the escrow state of the given channels at one pinned block, answered payer close requests with a payee close capturingmax(spent, settled)with configurable fee payment, finalized channels whose deposit left the escrow from theirChannelClosedevent, and reopened channels whose close request was cancelled. It returned the pinned block and its timestamp with per-channel outcomes and counts. - Added
sponsorshipLimittotempo.session(), which limited fee-payer-sponsored opens, and separately top-ups, to five per verified transaction signer per UTC day, counted in aStore.AtomicStore. Chain.getChannelStatesBatch()accepted a block number.