Repository navigation
Engine 0.3.0 — token issuance (Token + Mint/Burn jobs) + devnet fixes - #2
Merged
Merged
Conversation
The deferred-from-M2 issuance models, built against Kudos as the real consumer. - Solrengine::Sdp::Token: register! (create_token) / deploy! / mint! — the persisted issued token (mirrors Transfer's audit-trail posture) - Solrengine::Sdp::TokenMint: per-mint record; status machine minting -> in_flight -> minted | failed | unknown - MintJob: single never-retried mint POST; atomic claim (minting -> in_flight) guarantees a mint is never sent twice across crashes/retries/concurrent workers. Timeout -> unknown (no mint-tx listing to reconcile; surfaced for manual review, never auto-re-sent). Unavailable -> failed unsent. - Migration templates (tokens + token_mints) wired into the install generator; VERSION 0.2.0 -> 0.3.0 143 runs, 479 assertions, 0 failures. rubocop clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The redeem-path counterpart to mint, same never-double-* discipline. - Solrengine::Sdp::TokenBurn: per-burn record (burning -> in_flight -> burned | failed | unknown). A burn is signed by the SOURCE wallet's owner, so signing_wallet_id is the holder's custodial wallet, not the treasury. - BurnJob: single never-retried burn POST + atomic claim (never sent twice) - Token#burn!(source:, signing_wallet_id:, amount:, memo:) - Migration template + install generator + test schema 147 runs, 493 assertions, 0 failures. rubocop clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two devnet-surfaced fixes the WebMock-stubbed tests structurally could not
catch (stubs don't validate amounts or deliver real chain events):
- Amount normalization: BigDecimal#to_s("F") renders a whole "10" as
"10.0", which SDP rejects for a 0-decimal token ("Amount has too many
decimal places") — so every mint/burn of a whole-number points token
failed on-chain. Strip trailing fractional zeros so "10" goes out as "10"
(fractions keep their places). SDP still enforces the token's decimals.
- App-initiated issuance is its own doorbell: the chain-WebSocket watcher
only sees a wallet's native account, not the token ATA a mint credits, so
it never rang for an earn. MintJob/BurnJob now ring the balance broadcast
for the affected wallet on settle (every earn/redeem, including the first),
reusing the app's configured broadcast_targets. Broadcast failure can never
fail a settled write.
Regression tests for both; corrected the two tests that baked in "10.0".
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0.3.0 adds token issuance; the README only covered transfers. Add an Issuance section (Token.register!/deploy!/mint!/burn!, the mint/burn status machine, decimal-amount semantics, never-double posture, and the broadcast-on-settle doorbell). Correct the compatibility line to match the COMPATIBLE_SDP_VERSION constant (v0.31), which had drifted to v0.28. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
moviendome
marked this pull request as ready for review
June 26, 2026 05:21
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.
Engine 0.3.0 — adds token issuance on the custodial Wallet-per-User path, plus the fixes surfaced verifying it end-to-end on a live SDP devnet stack (the M3 Kudos reference app is the consumer).
What's in it
Solrengine::Sdp::Token—register!→deploy!→mint!/burn!, each persisted as an engine-owned audit row (TokenMint/TokenBurn).MintJob/BurnJobsend a single never-retried POST; the atomic claim (minting → in_flight) guarantees a mint/burn is never sent twice. A read-timeout landsunknown(no mint-tx list to reconcile against), surfaced not auto-re-sent.BigDecimal#to_s("F")rendered a whole10as"10.0", which SDP rejects for a 0-decimal token ("Amount has too many decimal places") — so every whole-number mint/burn failed on-chain. Now sent as"10"; fractions keep their places.MintJob/BurnJobnow ring the balance broadcast for the affected wallet on settle (every earn/redeem, including the first), reusing the app'sbroadcast_targets.COMPATIBLE_SDP_VERSION(v0.31).Verification
solrengine-sdp-0.3.0.gembuilds; runtime deps (solana-sdp 0.2,solrengine-realtime 0.2) resolve from RubyGems.The amount and doorbell bugs were invisible to the WebMock suite (stubs don't validate amounts or deliver chain events) — they only appeared against the real stack, which is exactly what this milestone's live verification is for.