Skip to content

Conway transactions drop the treasury field when it has content #26

Closed

Description

@carbolymer

The Conway transaction encoder leaves out the treasury field exactly when it has something to show, because its omission rule is inverted:

OmitWhen drops a field when its predicate is true, and this predicate is true when the transaction states the current treasury value or makes a donation. So a Conway transaction with a treasury donation or a stated treasury value has no treasury key at all, and every other Conway transaction gets an empty "treasury": {}. A client that reads treasury donations from nextBlock never sees one, and the JSON schema accepts both shapes, so schema validation does not catch it. The test vectors regenerated in PR 22 show the pattern: none of the Conway transactions has a treasury key, while all 39 Dijkstra transactions from the same generators have one.

The bug came in with the commit that added the field, on 2024-08-15:

Upstream fixed it on 2026-06-15 and shipped the fix in v7.0.0, whose changelog says "The treasury field on transaction was sometimes ommitted when it should've been present; this is now fixed." The same commit also stops empty outputs and validityInterval fields from showing, in the Allegra to Conway encoders, and updates the JSON schema to match:

This fork branched from upstream on 2025-12-03, before the fix, and its master still has every line that the fix changes. The Dijkstra encoder added in PR 22 already uses the corrected rule:

I'd suggest porting the upstream commit and regenerating the test vectors. Some hunks need adapting, because the fork's Allegra and Dijkstra encoders differ from upstream's. Conway transactions would then carry their treasury value and donation as the schema describes, and the fork would match upstream for all three fields.

Activity

  1. added
    bug
    on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions