Skip to content

Commit 5753dd3

Browse files
committed
Update to unified kth/0.78.0 Conan 2 package + modern CI
The standalone c-api/<ver>@kth/stable recipe was rolled into a single unified `kth` package; this branch updates py-native to consume it, modernizes the build pipeline, brings the C bindings up to date with the C-API drift accumulated over the last ~4 years, and replaces the deprecated CI workflow with a cibuildwheel-based one. Build pipeline: - conanfile.py: Conan 2 syntax (requirements()/generate()), pins kth/0.78.0 with currency=BCH and db=dynamic, stages headers and static libs from kth and ALL transitive deps into ./kth/. - setup.py: drop dead Conan 1.x Conan.factory() path; shell out to `conan install` instead. BuildExtCommand discovers staged libs at build time and wraps them in -Wl,--start-group/--end-group so the linker resolves circular deps regardless of glob order. C++23, explicit -lstdc++. run_conan_install() also reads KTH_MARCH_ID and KTH_CURRENCY from env (CLI flags still win) so CI can override. - Move .sh helpers to scripts/, drop .bat, .travis/, .appveyor.yml, AUTHORS, residual __init__.py. C-API drift fixes (Python signatures changed accordingly — py-api will need matching updates): - block/header/transaction factory_from_data: drop `version` arg - block/header serialized_size, header_to_data: drop `version` arg - output_point_construct_from_hash_index: takes kth_hash_t const* now - chain_script_construct -> chain_script_construct_from_bytes - wallet_payment_address_encoded split into _legacy / _cashaddr (with token_aware bool) / _token (the BCH-only ones gated by KTH_CURRENCY_BCH) - transaction_hash_sighash_type removed (no longer in C-API) - node_get_chain -> node_chain - node.cpp: explicitly include kth/capi/node_info.h (no longer pulled in transitively by kth/capi.h) Settings struct sync: - DatabaseSettings: drop flush_writes/file_growth_rate/ index_start_height; add db_mode (kth_db_mode_t enum: 0=pruned, 1=normal, 2=full_indexed). - BlockchainSettings: drop gauss_activation_time/ descartes_activation_time; add bch_gauss/bch_descartes/ bch_lobachevski/bch_galois bools and the new leibniz_activation_time (2026) / cantor_activation_time (2027). module.c quality pass: - Replace 8 functions full of `int res2 = ...; res2 = ...; res2 = ...` (set-but-never-checked) with KTH_TRY_SETATTR macro that Py_DECREFs the half-built object and returns NULL on the first failure, propagating the Python exception correctly. The macro name is provisional; flagged for the cleanup pass. Tests: - test_config.py rewritten with shared `_assert_common_*` helpers (mainnet and testnet4 share ~80 asserts), named constants (DB_MODE_NORMAL, LEIBNIZ_ACTIVATION_TIME, CANTOR_ACTIVATION_TIME), loops over BIP/BCH flag families instead of 30 copy-pasted lines, and `>=` bounds instead of exact-equality on things that grow organically (checkpoint count, seed count). Covers the new db_mode and bch_* fields, drops the removed gauss/descartes ones. - test_node.py: rename node_get_chain -> node_chain. All 3 tests pass against a real Knuth v0.78.0 node startup on mainnet (32+32 threads, march_id=ZLm9Pjh). CI (replaces the old knuth.yml): - The old workflow was a Frankenstein of npm/node-pre-gyp/twine/ Docker-custom across three shells, pinned to ubuntu-20.04 (deprecated by GitHub) and node-pre-gyp paths that don't even apply to a Python package. Replaced wholesale. - New ci.yml: sdist job + cibuildwheel matrix on Linux x86_64 (manylinux container) and macOS arm64 (macos-latest is Apple Silicon now). cp39-cp313, no PyPy, no musllinux, no 32-bit. - Conan installed in CIBW_BEFORE_ALL, kth remote registered, and CIBW_BEFORE_BUILD pre-installs the build deps so we can run pip with --no-build-isolation (our setup.py shells out to `conan install`). - Smoke test inside each built wheel: `import kth_native` + pytest. - publish job scaffolded for Trusted Publishing on tag pushes, gated behind `if: false` until PyPI auth is wired up. - KTH_MARCH_ID/KTH_CURRENCY pinned at workflow level so the build flavor lives in exactly one place. - Concurrency group cancels superseded PR runs to save minutes. - Windows is intentionally out of this pass — the old workflow's Windows path was 100% npm/node-gyp/node-pre-gyp and never built a Python wheel in the first place. Add `windows-latest` later as a follow-up once Linux/macOS is green.
1 parent 0c71a98 commit 5753dd3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1735
-1603
lines changed

.appveyor.yml

Lines changed: 0 additions & 131 deletions
This file was deleted.

0 commit comments

Comments
 (0)