Skip to content

Koios: native reference scripts are dropped #571

Description

@solidsnakedev

The Koios provider drops native reference scripts. db-sync stores no CBOR for native scripts before the Dijkstra era (cardano-db-sync Era/Shelley/Generic/Tx/Alonzo.hs:318-322). Koios therefore returns reference_script.bytes: null for timelock and multisig scripts. toUTxO requires the bytes (packages/evolution/src/sdk/provider/internal/Koios.ts:199), so the UTxO comes back with no scriptRef and no error. The type can also be multisig, which the switch there does not handle.

Fix: for native scripts with null bytes, rebuild the script from reference_script.value and check it against reference_script.hash. Keep the bytes path for Dijkstra-era outputs.

A related question: /utxo_info also returns spent outputs (files/grest/rpc/transactions/utxo_info.sql, is_spent), so getUtxosByOutRef can return them. Kupmios asks Kupo for ?unspent only, while Blockfrost returns spent outputs too. The Provider interface does not say which behavior it expects.

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions