Repository navigation
chore: bump every package to 0.8.0 - #84
Merged
Merged
Conversation
aleo-sdk, aleo-contract-abi-generator, shield-swap-sdk, and aleo-bridge-sdk move from 0.7.0 to 0.8.0 together, as before. shield-swap-sdk now imports aleo.inventory at module load, so its aleo-sdk floor rises to 0.8.0 and the import guard probes aleo.inventory instead of aleo.compliance. The bridge floor stays at 0.7.0; nothing there needs the new module.
iamalwaysuncomfortable
merged commit Oct 23, 2026
57e8044
into
feat/record-inventory
8 checks passed
iamalwaysuncomfortable
added a commit
that referenced
this pull request
Oct 23, 2026
…eselection (#82) * feat: record inventory with shared reservations and concurrent swap reselection Port of Veil PR #172 (head 2e324d5) into the Python SDK. aleo.inventory: get/plan/rebalance/reconcile record inventory, join_records, split_record, auto_join over credits.aleo and ARC-20/ARC-22 tokens. One sans-IO engine drives both RecordInventory and AsyncRecordInventory. The planner, join-helper registry, and output resolution follow Veil; its planner tests are the known answers. RecordInventoryStore is a three-method protocol with an in-memory implementation; scopes match Veil's so journals can be shared. Facade: Aleo(provider, record_management=...) and aleo.inventory. On a managed client every transact and delegate reserves its record inputs before proving, saves the proved transaction before broadcast, journals submission, and enforces the fee ceiling. Private fees pick and reserve the credits record once the exact fee is known (fee_record may be a callable). A node rejected broadcast releases its reservation; uncertain outcomes keep it. transact_with_result returns the built transaction beside the id. Shield Swap: plan_inventory and rebalance_inventory on the token's underlying program, reserved records excluded from selection, and swaps that lose a record to another writer move to the next eligible record before proving. Concurrent-swaps example with a file-backed store and recovery steps. AGENTS.md regenerated. * test: live record inventory suite on testnet Port of Veil's recordInventory, recordInventoryStrategy, and concurrentInventory e2e suites for the Shield Swap SDK. Keeps six equal USDCx and ETH records in the e2e account, trades an explicit round trip and repairs the inventory through the stablecoin join helper, submits six swaps at once in each direction with automatic record selection under a forced first-selection collision, claims every output, and reopens the journal to verify confirmed checkpoints and distinct inputs. Passed on testnet in 7m31s (28 transactions). Journals live under .shield-swap/, now ignored. * feat: ship JSON file and SQLite reservation stores JsonFileRecordInventoryStore keeps the journal in one JSON file under a file lock; SqliteRecordInventoryStore uses the stdlib sqlite3 module with the same table layout and row JSON as Veil's store, so the two SDKs can share a journal. Both record the writer's pid and host and release a reserved entry whose local writer has exited before proving. The store contract tests run against all three stores. The concurrent-swaps example and the live inventory suite use the SQLite store instead of a private class; the README compares the three stores. * docs: flatten the concurrent-swaps example into one script The example now reads top to bottom like the first-swap example: client setup, the unresolved-work check, planning, execution, and the concurrent batch are inline, with only the per-trade thread body as a nested function. The offline test checks the script's flags and its refusal to run without a key instead of importing helpers. * fix: keep the JSON journal owner-only across rewrites The atomic rewrite created its temporary file with the default umask and then replaced the 0600 journal with it. Create the temporary file with mode 0600 and assert the mode after a write in the durable store test. * refactor: manage the build and submit halves instead of a combined verb On a client with record management enabled, build_transaction now reserves the call's record inputs before proving and saves the proved transaction to the journal, and submit_transaction records the broadcast (a 4xx refusal releases the reservation, an unknown outcome keeps it). transact is the two in sequence again, matching how snarkVM separates building a transaction from broadcasting it, and transact_with_result is removed. A built transaction that will not be sent is released with result.discard(). Shield Swap's DexCall returns to the plain build-then-submit split and is protected without changes. The checkpoint rules move into one SpendCheckpoint class shared by the engine and the facade. * fix: close the four review findings on record management - Inventory actions prove through the facade's unmanaged paths (_prove_transaction, delegate(broadcast=False)) so a managed client under local proving does not reserve its inputs twice. - The private fee record is folded into the same journal entry as the execution inputs (Veil's layout): a short-lived claim wins it atomically, then update(records, fee_record_id) moves it over. Every later checkpoint is one store update, so a crash cannot keep the proved transaction while releasing its fee record. - Dead-process recovery and reconcile(release_reserved=True) cancel only entries with account_type "local"; a Veil wallet's rpc entry is kept. - SpendCheckpoint tracks uncertain broadcast attempts: discard() is inert after any attempt, and a 4xx that follows an uncertain attempt keeps the reservation. The managed broadcast asks the raw client for single attempts (retry=False) and reports each one to the checkpoint before retrying with the usual backoff. * fix: hold a reservation while its broadcast is in flight - SpendCheckpoint marks a broadcast attempt before the request leaves (begin_broadcast); discard() is inert until the attempt resolves, and a checkpoint that was already discarded refuses to broadcast, since its inputs may belong to another transaction by then. The engine and both facade broadcast helpers set the mark; a lock serialises the lifecycle flags against a discard from another thread. - Durable stores no longer chmod an existing parent directory; only a directory they create becomes owner-only. - The file lock and the JSON journal guard release what they took when acquisition or decoding fails, so a repaired journal works without a restart. - Root .gitignore excludes .shield-swap/ (the examples write claim secrets there when run from the repository root), and the Shield Swap README's concurrent-swap snippet attaches the swap journal. * fix: split whole lots when halving would strand value below the minimum The planner halved the largest record on every split, so a record small relative to the minimum could reject a reachable target: [9, 3] towards four lots of at least 3 went 9 -> [4, 5] -> [2, 3] and raised, and 20,003 microcredits could not fund three lots of 1 although two 10,000 deductions leave exactly enough. When the two halves could no longer yield the lots still required, the split now cuts a whole number of lots instead, which keeps every lot the record can fund. Halving still wins whenever it can finish, so Veil's known-answer plans are unchanged; only plans Veil rejects differ. Closes #83. * fix: count overlapping broadcast attempts before releasing a reservation The in-flight mark was one boolean, so when the same built result was submitted twice at once, a 4xx on the second request (a duplicate, refused because the node had admitted the first) cleared the mark and cancelled the reservation while the first request was still pending. SpendCheckpoint now counts unresolved attempts: a refusal releases the inputs only when no other attempt of the spend is outstanding, success resolves them all, and anything uncertain still keeps the reservation. The engine's attempt wraps the facade's, so the count also covers that nesting. * chore: bump every package to 0.8.0 (#84) aleo-sdk, aleo-contract-abi-generator, shield-swap-sdk, and aleo-bridge-sdk move from 0.7.0 to 0.8.0 together, as before. shield-swap-sdk now imports aleo.inventory at module load, so its aleo-sdk floor rises to 0.8.0 and the import guard probes aleo.inventory instead of aleo.compliance. The bridge floor stays at 0.7.0; nothing there needs the new module.
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.
Lockstep bump from 0.7.0 (on PyPI since 2026-10-22) to 0.8.0 for
aleo-sdk,aleo-contract-abi-generator,shield-swap-sdk, andaleo-bridge-sdk. Stacked on #82, which adds the public API that motivates the minor bump (aleo.inventory,TransactionResult.checkpoint/discard(),retry=on the raw clients'submit_transaction).Files
Cargo.tomlandCargo.lockroot entries, the fourpyproject.tomlfiles,sdk/docs/source/conf.py,__version__inaleo_shield_swapandaleo_bridge, and their version tests.aleo-sdk>=0.8.0(was>=0.7.0).aleo_shield_swapimportsaleo.inventoryat module load, so an older SDK fails before the client exists; the import guard now probesaleo.inventoryand names 0.8.0 in its message. The README's stale>=0.5.1line is corrected at the same time.>=0.7.0: the bridge does not use the new module.Validation
cargo metadata --offlineresolvesaleoandaleo-abiat 0.8.0 against the committed locks.shield-swap-sdk: 541 tests pass, including the updated import-guard test.aleo-bridge-sdk: the version and import-guard tests (18) pass against the development SDK build. The bridge's own virtualenv still carries aleo-sdk 0.6.0 and its EVM extras are not in the SDK venv, so the rest of the bridge suite was not rerun here; it does not read the version.