Repository navigation
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two
getProtocolParametersdecoding 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
plutusCostModelsfromcostModelsValid, 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 requiredplutus:v1,plutus:v2andplutus:v3, so a network without one of the three failed to decode. Each language key is now optional, andtoProtocolParametersmaps a missing language to an empty cost model ({}), as the issue suggests.#559 — Ogmios v7 renamed
maxReferenceScriptsSize. Ogmios v7 calls itmaxReferenceScriptsSizePerTransactionand addsmaxReferenceScriptsSizePerBlock; the schema required the old key, so the call failed against a v7 server. That value is not mapped into the provider'sProtocolParameters, 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 — aProviderErrorfromgetProtocolParameters— before the fix):plutus:v1removed decodes, withcostModels.PlutusV1equal to{}and the V2/V3 models intact;plutusCostModels: {}decodes to three empty cost models;maxReferenceScriptsSizePerTransaction+maxReferenceScriptsSizePerBlock, old key absent) decodes.Results: Kupmios test file 19/19; full package suite 1681 passed / 75 skipped / 0 failed;
tsc --noEmitand the package build are clean. A patch changeset is included.One scope note: #568 also mentions the Ogmios v7
guardredeemer 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