Skip to content

fix(provider): accept Ogmios variants in Kupmios protocol parameters - #625

Open
Kshot3000 wants to merge 1 commit into
IntersectMBO:mainfrom
Kshot3000:fix/kupmios-ogmios-params-variants
Open

Kshot3000 wants to merge 1 commit into
IntersectMBO:mainfrom
Kshot3000:fix/kupmios-ogmios-params-variants

Conversation

@Kshot3000

@Kshot3000 Kshot3000 commented Oct 14, 2026 •

Copy link
Copy Markdown

Fixes two getProtocolParameters decoding failures in the Kupmios provider, both reproduced first as failing tests against the preprod protocol-parameters fixture.

#568 — a missing cost model language fails the call. Ogmios builds plutusCostModels from costModelsValid, so it sends only the languages that have a cost model, and its JSON schema for the map has no required keys. The schema here required plutus:v1, plutus:v2 and plutus:v3, so a network without one of the three failed to decode. Each language key is now optional, and toProtocolParameters maps a missing language to an empty cost model ({}), as the issue suggests.

#559 — Ogmios v7 renamed maxReferenceScriptsSize. Ogmios v7 calls it maxReferenceScriptsSizePerTransaction and adds maxReferenceScriptsSizePerBlock; the schema required the old key, so the call failed against a v7 server. That value is not mapped into the provider's ProtocolParameters, so all three spellings are now optional and either server generation decodes.

Tests (three new cases in test/provider/Kupmios.test.ts, in the file's stub-fetch style, each verified red — a ProviderError from getProtocolParameters — before the fix):

  • the fixture with plutus:v1 removed decodes, with costModels.PlutusV1 equal to {} and the V2/V3 models intact;
  • the fixture with plutusCostModels: {} decodes to three empty cost models;
  • the fixture with the v7 keys (maxReferenceScriptsSizePerTransaction + maxReferenceScriptsSizePerBlock, old key absent) decodes.

Results: Kupmios test file 19/19; full package suite 1681 passed / 75 skipped / 0 failed; tsc --noEmit and the package build are clean. A patch changeset is included.

One scope note: #568 also mentions the Ogmios v7 guard redeemer purpose. I left that out — the issue itself says it belongs with Dijkstra support, and no current network sends it.


Independent builder — not affiliated with IntersectMBO, the Cardano Foundation or IOG.

@Kshot9000 (https://x.com/kshot9000) · ADA: addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v

Two protocol-parameter decoding failures in the Kupmios provider
(issues IntersectMBO#568 and IntersectMBO#559):

- Ogmios builds plutusCostModels from costModelsValid, so it sends
  only the languages that have a cost model, and its JSON schema has
  no required keys. ProtocolParametersSchema required plutus:v1,
  plutus:v2 and plutus:v3, so getProtocolParameters failed on any
  network without one of the three. Each language key is now optional
  and a missing one maps to an empty cost model in toProtocolParameters.
- Ogmios v7 renamed maxReferenceScriptsSize to
  maxReferenceScriptsSizePerTransaction and added
  maxReferenceScriptsSizePerBlock. The schema required the old key, so
  getProtocolParameters failed against an Ogmios v7 server. The value
  is not mapped into the provider's ProtocolParameters, so all three
  spellings are now optional and either server generation decodes.

Tests: three new cases in Kupmios.test.ts (one cost model language
missing, no cost models at all, Ogmios v7 renamed keys), each verified
failing with a ProviderError before the fix. Kupmios file 19/19; full
package suite 1681 passed / 75 skipped / 0 failed; tsc --noEmit and
build clean. Changeset: patch.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant