Skip to content

build: pin platform_cxx to the SDK-backed dash-platform-cxx crate - #7669

Draft
PastaPastaPasta wants to merge 7 commits into
dashpay:developfrom
PastaPastaPasta:feat/platform-sdk-depends
Draft

build: pin platform_cxx to the SDK-backed dash-platform-cxx crate#7669
PastaPastaPasta wants to merge 7 commits into
dashpay:developfrom
PastaPastaPasta:feat/platform-sdk-depends

Conversation

@PastaPastaPasta

@PastaPastaPasta PastaPastaPasta commented Sep 8, 2026

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

Stacked on #7623 (its five commits come first; review the last commit only). Refreshes the platform_cxx pin #7623's description promised before merge, to the SDK-backed rebuild of the Platform CXX bindings: dashpay/platform#4633 (stacked on dashpay/platform#4631 and #4632). Tracking: #7512.

The maintainers' direction on the Platform side was to use the SDK rather than keep a transport-free verifier fed by a C++ transport. The measured evidence before adopting it: the full dash-sdk type-checks for every Rust target in rust_stdlib.mk plus riscv64gc-unknown-linux-gnu; a release-built C++ driver verified every query the GUI makes against live testnet through the crate (proof-verified against quorum keys exported from a synced node, corrupted keys rejected at the BLS check); a statically linked x86_64-unknown-linux-musl build of that driver ran under emulation with identical results. The dependency graph grows from 281 to 337 crates; macOS links Security + CoreFoundation (rustls reads the system trust store), Windows ws2_32 bcrypt crypt32 userenv ntdll, all within symbol-check.py's allowlists.

What was done?

How Has This Been Tested?

  • make -C depends PLATFORM_GUI=1 platform_cxx on aarch64-apple-darwin: vendors 840 crates (150 MB archive), builds the crate offline in 3 minutes, stages include/dash/platform/{ffi.h,signer.h}, include/rust/cxx.h and lib/libdash_platform_cxx.a.
  • Knob-off package set unchanged (make -C depends print-packages).
  • The stacked client library, GUI and Guix PRs build and test against this prefix.
  • Not done: a Guix run with PLATFORM_GUI=1 at this pin (the earlier two-builder reproducibility result at c9d6fbd459d9 covered the transport-free archive; the SDK archive is unknown until guix: support PLATFORM_GUI=1 release builds #7672's Guix run).

Breaking Changes

None. Everything is behind PLATFORM_GUI=1, which nothing sets by default.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

native_rust installs the pinned prebuilt Rust toolchain as a native package and rust_stdlib provides the precompiled standard library for every supported cross target; contrib/devtools/update-rust-hashes.py maintains both pins together.

funcs.mk gains a cargo environment wired to the depends cross toolchain and a per-package crate-vendoring template: any package that declares a vendored archive name and a cargo manifest gets its vendored-crate archive modeled as a real make target, created by cargo vendor when absent and required by the package's preprocess stamp and by make download, so a clean build can never reach the offline cargo build without vendored sources. Preprocessing extracts the archive and generates a rustc linker wrapper that preserves the full configured compiler command (target and sysroot flags, and any env prefix), since -C linker= takes a single executable.
…I knob

PLATFORM_GUI=1 adds mbedtls, native_protobuf, tenderdash_sources and platform_cxx to the package set. platform_cxx builds libdash_platform_cxx.a and its installed headers from a pinned dashpay/platform commit (packages/rs-platform-cxx), offline via the per-package vendored crates. config.site.in exports enable_platform_gui and PLATFORM_CXX_{CFLAGS,LIBS} discovery for the configure flag that arrives with the first C++ consumer.
…lane

The new lane builds depends with PLATFORM_GUI=1 (producing and hash-verifying the Platform CXX archive offline from vendored crates), then builds dash-qt against that prefix and runs the unit tests. The cache-sources producer generates and caches the platform-cxx vendored-crates archive, handing it to same-run consumers as an artifact on cache miss.

The --enable-platform-gui configure flag is added to this lane's BITCOIN_CONFIG by the Platform client library PR; until then the lane proves the depends knob and prefix link-compatibility. build.yml runs PR validation from the base branch (pull_request_target), so the lane first runs on push CI for this branch and takes effect for PRs after merge.
The all-target rust-std downloader wrote directly to the final source-cache path and treated any existing file as complete, so a partial file left behind by an interrupted download made every subsequent 'make PLATFORM_GUI=1 download' fail on the same archive until it was removed by hand. Verify an existing archive against the pinned hash and re-fetch it when it does not match, downloading to a temp path and only moving a verified archive into place, matching fetch_file_inner.
…ry is missing

Inside a Guix environment there are no default loader search paths, so a toolchain staged without libgcc_s/libz next to it is nonfunctional and would be cached in that state. Treat a missing required runtime library as a staging failure there, consistent with the existing fatal patchelf check; outside Guix it remains a warning since the system loader can still resolve the libraries.
The linker wrapper carries a shebang, so the lint-files check requires the executable bit; cargo invokes it through the RUSTFLAGS -C linker= path either way.
@PastaPastaPasta
PastaPastaPasta force-pushed the feat/platform-sdk-depends branch from dfc6f13 to cfc50a2 Compare September 8, 2026 19:57
…crate

dashpay/platform#4633 rebuilds the Platform CXX bindings as a thin bridge over dash-sdk: the SDK owns DAPI transport, retries and proof verification, and Core supplies endpoints, quorum keys, its ChainLock height and wallet signatures. The crate is an ordinary workspace member now, so the package vendors from the workspace root (the lockfile made vendorable by dashpay/platform#4631), builds with -p dash-platform-cxx, and installs the header tree the crate's build.rs stages plus the static archive; the nested standalone manifest and install.sh are gone with the old design.

mbedtls leaves depends: the SDK carries its own TLS stack (rustls with the system trust store), so Core no longer links a TLS library for Platform. The vendoring config gains the workspace's git sources.

Validated on aarch64-apple-darwin: make -C depends PLATFORM_GUI=1 platform_cxx vendors 840 crates (150 MB archive) and builds the crate offline in 3 minutes; the staged prefix carries include/dash/platform/{ffi.h,signer.h}, include/rust/cxx.h and lib/libdash_platform_cxx.a. The knob-off package set is unchanged.
@PastaPastaPasta
PastaPastaPasta force-pushed the feat/platform-sdk-depends branch from cfc50a2 to bece665 Compare September 8, 2026 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant