Two related workarounds in contracts/smart-account/src/doc.rs exist because of gaps in what's actually consumable from perch today. Both are worth revisiting once perch's own releases close them (raised during PR #207 review — thanks @elizabethengelman).
1. perch-smart-account trait crate is not consumed
It's unpublished, unbuildable as a git dependency (bakes git-ignored fetched wasm artifacts at build time via include_str!/registry_contract!), and its storage/install helpers are private. doc.rs mirrors the trait's surface (apply_doc, applied_doc_hash) and install shape manually at the wire level (CompiledDoc/CompiledRule) instead of depending on it.
Revisit when: perch-smart-account is published in a form that's buildable as a normal crate dependency without baking in git-ignored artifacts.
2. Cap-capable compiler wire types are hand-mirrored, not perch-sourced
The deployed testnet doc-compiler predates perch's cap-lowering feature — its CompiledRule has five fields (no cap), and it refuses capped documents at compile time (CapUnsupported). doc.rs hand-transcribes the wire types from stellar contract fetch/stellar contract info interface of the deployed artifact rather than consuming perch's own compiled types, because consuming the perch-doc-compiler crate at a source revision previously produced six-field types that didn't match the deployed five-field compiler and caused every live apply_doc call to trap.
Revisit when: the deployed testnet compiler is upgraded to a cap-capable build, at which point the pin can be bumped and the cap field re-added to the local mirror (the lowering branch already exists in history, just currently unreachable).
Neither is urgent — the current on-chain behavior is correct and tested — but both are manual-maintenance surfaces that should shrink as perch's own releases mature.
Two related workarounds in
contracts/smart-account/src/doc.rsexist because of gaps in what's actually consumable from perch today. Both are worth revisiting once perch's own releases close them (raised during PR #207 review — thanks @elizabethengelman).1.
perch-smart-accounttrait crate is not consumedIt's unpublished, unbuildable as a git dependency (bakes git-ignored fetched wasm artifacts at build time via
include_str!/registry_contract!), and its storage/install helpers are private.doc.rsmirrors the trait's surface (apply_doc,applied_doc_hash) and install shape manually at the wire level (CompiledDoc/CompiledRule) instead of depending on it.Revisit when:
perch-smart-accountis published in a form that's buildable as a normal crate dependency without baking in git-ignored artifacts.2. Cap-capable compiler wire types are hand-mirrored, not perch-sourced
The deployed testnet doc-compiler predates perch's cap-lowering feature — its
CompiledRulehas five fields (nocap), and it refuses capped documents at compile time (CapUnsupported).doc.rshand-transcribes the wire types fromstellar contract fetch/stellar contract info interfaceof the deployed artifact rather than consuming perch's own compiled types, because consuming the perch-doc-compiler crate at a source revision previously produced six-field types that didn't match the deployed five-field compiler and caused every liveapply_doccall to trap.Revisit when: the deployed testnet compiler is upgraded to a cap-capable build, at which point the pin can be bumped and the
capfield re-added to the local mirror (the lowering branch already exists in history, just currently unreachable).Neither is urgent — the current on-chain behavior is correct and tested — but both are manual-maintenance surfaces that should shrink as perch's own releases mature.