Skip to content

fix(builders): count signers only for native scripts the transaction needs #596

Description

@solidsnakedev

The fee estimate adds signer placeholders for every native script carried by a reference input, and after #595 by a spent input, even when the transaction needs none of them.

Example: Bob stores his 2-of-3 treasury multisig as a reference script in a UTxO at his own key address. He later spends that UTxO to pay Carol. The transaction needs only Bob's signature, but buildFakeWitnessSet (internal/txBuilder.ts) also adds 2 placeholders for the multisig, so the fee is estimated for 3 signatures. The transaction is still valid; Bob overpays by roughly 0.009 ADA.

The ledger only runs a script when the transaction needs it for spending, minting, a certificate, a withdrawal, a vote or a proposal (Conway UTxO.hs L95-105). The fee estimate should count signers only for native scripts whose hash is in that set, and skip scripts that are only carried by an input.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions