Skip to content

The contract doc still licenses believing one peer's height, which chia-query 0.12 now refuses #20

Description

@MichaelTaylor3d

Task

results.rs:563-566 and :620-623 document a contract that licenses:

if coin.created_height.is_some() { record_did() }

That doc is now actively misleading, and it got worse rather than better. chia-query 0.12.0 (PR #29, MVP ticket https://github.com/DIG-Network/dig_ecosystem/issues/2462) makes a positive coin answer's heights corroborated across independent peers — so the crate underneath now refuses the read the doc still promises.

Why this is worth fixing ahead of the consumer work

Before 0.12.0 the doc was optimistic. Now it describes behaviour the layer beneath it declines to provide, and a reader following it writes a consumer that fails at runtime for a reason the documentation says cannot happen.

The specific hazard in that snippet: created_height.is_some() treats the presence of a height as proof of an on-chain fact, when the height may be a single untrusted peer's claim. NC-12 says every dialled peer is untrusted, and a height decides whether money is treated as settled — so believing one peer's word here makes a surface report settled money as unconfirmed (inviting a second send) or unconfirmed money as settled.

Scope

Correct the contract text so it describes what chia-query 0.12.0 actually provides:

  • a positive answer is Found only when corroborated;
  • UncorroboratedFound / UncorroboratedPresence exist and mean unknown, not absent and not present;
  • a contradiction from any peer outranks any amount of agreement — the read fails rather than resolving by majority, which is what stops attacker slots out-voting an honest peer;
  • absence and unknown remain distinguishable, and a consumer must not collapse them.

Fix the doc; do not weaken the crate to match it. The corroboration is the correct behaviour and the documentation is the stale half.

Related, and deliberately separate

The dig-node, dig-node-control-interface and dig-app halves of #2462 are consumer adoptions and remain open in their own repos. This ticket is only the contract text, and it should land first — a consumer written against the current wording inherits the defect.

Evidence

Someone reading results.rs:563-566 cold can tell, without opening chia-query, that a height alone is not proof and that an uncorroborated answer is neither presence nor absence.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind:businessa person can DO something new, or money moves, or a shipped surface stops lying to them

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions