Skip to content

guix: support PLATFORM_GUI=1 release builds - #7672

Draft
PastaPastaPasta wants to merge 11 commits into
dashpay:developfrom
PastaPastaPasta:feat/platform-sdk-guix
Draft

guix: support PLATFORM_GUI=1 release builds#7672
PastaPastaPasta wants to merge 11 commits into
dashpay:developfrom
PastaPastaPasta:feat/platform-sdk-guix

Conversation

@PastaPastaPasta

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

Stacked on #7623#7669#7670#7671 (their commits come first; review the last commit only). Replaces #7628 for the SDK-backed archive. Tracking: #7512.

Guix release builds need to be able to produce the Platform-enabled dash-qt. The depends knob and the Platform archive are host-independent inputs that the offline build container cannot fetch itself.

What was done?

Identical to #7628 apart from the manifest: guix-build prefetches the Rust standard libraries and the platform_cxx vendored-crates archive outside the offline container (they need network and git access) and passes PLATFORM_GUI=1 through to the containerized depends build; the manifest gains patchelf and zlib for the prebuilt Rust toolchain; the Guix workflow gains workflow_dispatch with host and platform_gui inputs so a single-host Platform build can be exercised on demand. lbzip2 is no longer needed: it was for mbedtls' .tar.bz2 archive, and mbedtls left depends with the C++ transport.

How Has This Been Tested?

  • Not yet run. guix: support PLATFORM_GUI=1 release builds #7628's two-builder reproducibility result at c9d6fbd459d9 (bit-identical x86_64-linux-gnu artifacts from two aarch64 hosts) covered the transport-free archive; the SDK archive adds tokio, hyper, rustls and ring to the vendored tree, and its reproducibility across independent builders and build architectures is unknown until a PLATFORM_GUI=1 Guix run at this pin. The --remap-path-prefix hazard noted in that report applies unchanged.
  • Undraft gate: a workflow_dispatch run with platform_gui: true for x86_64-linux-gnu from two independent builders, hashes posted here.

Breaking Changes

None. Scheduled and tag builds are unchanged and never set the knob.

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.
…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.
…ble-platform-gui

The Qt-free client library dash-qt drives for DashPay: per-network parameters and system contract ids, the PlatformClient interface, DPP decoding and state-transition adapters, and the wallet record formats. Where the earlier revision (dashpay#7626) carried its own gRPC-Web/TLS transport, hand-written protobuf and CBOR encoders, per-endpoint retry and freshness tracking, and handed request/response byte pairs to a transport-free verifier, this one is a thin consumer of the Dash Platform SDK through dash-platform-cxx (dashpay/platform#4633). The SDK owns query construction, DAPI transport, retries with address banning, proof verification (GroveDB replay plus the Tenderdash quorum signature against the keys this node pushes from its LLMQ store), protocol-version tracking and the chain-id and ChainLock freshness checks; the node supplies evonode endpoints from its deterministic masternode list, the Platform quorum keys, its best ChainLock height and wallet signatures through a digest callback, so private keys never leave the wallet.

The PlatformClient interface the GUI programs against is unchanged apart from gaining an sdk() accessor; the production implementation keeps its single worker thread and callback marshalling and forwards each query to the SDK handle. Absence stays proven, never inferred: an empty result only reaches a callback after the SDK verified a proof of it. The DPP decoders and state-transition builders take the SDK handle so they build under the protocol version the SDK has seen the network run, ratcheted up from the per-network floor in params.cpp. The C++ transport, protobuf, CBOR, retry and freshness code and their unit tests are gone with the design; the DPP byte-exactness suite and the wallet key tests stay, and the fuzz harness keeps the decoder targets (proof verification is fuzzed upstream).

Validated on aarch64-apple-darwin against a depends prefix carrying the SDK-backed archive: configure detects the bindings, libdash_platform.a and test_dash build, platform_dpp_tests and platformkeys_tests pass.
createAssetLockTransaction builds and funds an asset lock paying credits to a Platform funding key, at the payload version consensus accepts: version 2 is invalid until the v24 hard fork applies to the next block, and version 1 stays valid after activation, so a transaction built at the boundary is safe either way. CommitTransaction gains an optional broadcast_error out-parameter and a matching interfaces::Wallet::commitTransaction overload: a mempool rejection is reported to the caller instead of only the log, while the transaction stays committed to the wallet so the caller may abandon it. Both seams are wallet-type-agnostic and compiled unconditionally.
The DashPay GUI: username registration (identity + DPNS), a dashboard with profile, contacts over encrypted DIP-15 xpubs, seed-only recovery and send-to-username contact payments, all inside --enable-platform-gui (default off). Carried over from dashpay#7627 unchanged apart from the seam to the client library: the service constructs the SDK-backed client with the network's Platform LLMQ type, and the state-transition builders take the client's SDK handle so transitions are built under the protocol version the SDK has seen the network run. The Qt link lines lose mbedtls, which left depends with the C++ transport.

Validated on aarch64-apple-darwin: dash-qt builds and links the SDK archive (Security + CoreFoundation frameworks only), the DashPay tab, wizard and flows compile against the unchanged PlatformClient interface.
Guix builds accept a PLATFORM_GUI knob: guix-build prefetches the Rust standard libraries and the platform_cxx vendored-crates archive outside the offline container (they are host-independent and need network and git access), and passes the knob through to the containerized depends build. The manifest gains patchelf and zlib for the prebuilt Rust toolchain and lbzip2 for bzip2 depends archives. The Guix workflow gains workflow_dispatch with host and platform_gui inputs so a single-host Platform build can be exercised on demand; scheduled and tag builds are unchanged and never set the knob.
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