Sync to kth/0.80.0 + full v2 regeneration of py-native bindings - #6
Merged
Conversation
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.
Summary
Moves py-native off
kth/0.79.0and regenerates every Python wrapper through the v2 generator against the current C-API surface. Three layers in one PR because they cannot land separately without leaving the tree in a non-building intermediate state (bumping conan alone breaks the build, regenerating alone doesn't relinkmodule.c, fixingchain.cppalone doesn't compile against the renamed types…).1. Conan + build plumbing
conanfile.py→kth/0.80.0(was0.79.0).setup.pysources list now reflects the full generated surface (binary + new chain classes + new wallet classes).src/chain/history.cppis out ofsources— the generator covers that surface viahistory_compact+history_compact_list.chain.cppstays (async-callback bridge tosafe_chain, doesn't fitClassConfig).scripts/build-nix.sh— new NixOS-only wrapper: resolvesgcc.cc.libintoLD_LIBRARY_PATH, provisions a local.venvso editable installs have a writable prefix, scrubs stalebuild//kth// conan artefacts before every run, and runs the pytest suite at the end (skippable with--no-tests). Non-NixOS devs keep usingscripts/build.shunchanged.2. Regenerated surface (~70 files)
Full
generate_capi_v2.py --all --target python --write:primitives.hsplit (kth_*_mut_t/_const_t), the*_simpleconvention on flag-aware overloads, theleak/leak_if_validadjustment on types withoutoperator bool, and the owned-copy policy for scalar-value list accessors (short_ids,mnemonics).history_compact{,_list},double_spend_proof{,_spender},get_blocks,get_headers,operation{,_list},prefilled_transaction{,_list},token_data,utxo{,_list}on the chain side, andec_private,ec_public,hd_private,hd_public,payment_address_list,wallet_dataon the wallet side.kth_native.pyiandsrc/module.cpicked up the splice updates for every class above.3. Hand-fixes in the surviving hand-written wrappers
Where the regen doesn't reach and the C-API renames broke the build:
src/chain/chain.cpp—kth_merkleblock_t→kth_merkle_block_mut_t, and the matching_mut_tadjustments onhistory_compact_list,stealth_compact_list,compact_block,payment_address;kth_wallet_payment_address_construct_from_string→_construct_from_address.src/chain/history.cpp— list / element handle renames to*_mut_t. The file is kept for its async surface but is out ofsetup.py sources; the generator covers the sync side.src/module.c— dropped 50 lines of stalePyMethodDefentries (formerkle_block,history_compact{,_list},compact_block,stealth_compact{,_list},payment_address) that pointed at pre-regen function names. Every class on that list is now registered through the AUTO-generatedPyModule_AddFunctionsblock further down.Test plan
scripts/build-nix.shbuilds the.socleanly on NixOS.89 passed in 1.23s.Follow-up
End-to-end pytest cases for the ~30 newly-generator-driven classes (
double_spend_proof,get_blocks,get_headers,operation,prefilled_transaction,token_data,utxo,history_compact,ec_private,ec_public,hd_private,hd_public,wallet_data, and the matching_listtypes). They compile, link and import today; dedicated Python-side tests will land in a separate PR.Summary by CodeRabbit
New Features
Improvements
Bug Fixes
Tests