Repository navigation
Conversation
… Byron addresses Kupo v2.12 can return two responses the Kupmios provider could not handle (issue IntersectMBO#572): - /scripts/{hash} can return language "plutus:v4", which ScriptSchema rejected, so the lookup failed with an opaque schema parse error. Accept the literal and fail in getScript with a ProviderError naming the language as not supported yet, instead of throwing inside Effect.map, which would surface as a defect. - /matches can return UTxOs at Byron-era addresses, which Kupo writes in base58. CoreAddress.fromBech32 threw inside Effect.map in kupmiosUtxosToUtxos, surfacing as a defect. Decode via Effect.try and fail with a ProviderError explaining Byron addresses are not supported. Tests: four new cases in Kupmios.test.ts (Byron defect -> Fail with ProviderError, schema accepts plutus:v4, plutus:v4 script fails with a ProviderError naming it as unsupported and no parse error, plutus:v3 reference script still resolves). Full package suite: 2736 passed, 7 skipped. Changeset: patch.
Author
|
Correction to the test totals in my commit message and the PR description above: the "2,736 passed, 7 skipped" figure was wrong — it came from a background test result on this machine that was not this package's suite, and I quoted it before this run's own result landed. My mistake. The actual full-suite result for
The conclusion is unchanged — the whole suite is green — only the totals were misstated. |
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 #572.
Kupo (checked against v2.10.0 to v2.12.0 in the issue) can return two responses the Kupmios provider could not handle. Both now fail as typed
ProviderErrors — the error type every other Kupmios read path already returns — instead of an opaque parse error or an unhandled defect.PlutusV4 scripts
ScriptSchemainKupo.tsnow accepts theplutus:v4literal that/scripts/{hash}can return since Kupo v2.12, so the response decodes.getScriptEffectmatches on the language withEffect.flatMapinstead ofEffect.map. The languages the SDK models (native, PlutusV1/V2/V3) resolve as before; anything else — today that isplutus:v4— fails with aProviderErrornaming the language as not supported yet. Before, the schema rejection surfaced as a generic parse error buried in the cause chain (after five retries of a deterministic failure), and thedefault: throwin the oldEffect.mapwould have turned the newly accepted literal into a defect.Byron addresses
src/Kupo/Data/Cardano/Address.hsin Kupo).kupmiosUtxosToUtxosdecoded every returned address withCoreAddress.fromBech32insideEffect.map, so a Byron output from an output-reference or policy query threw and surfaced as a defect (Cause.Die— I reproduced exactly that). The decode now runs throughEffect.tryand fails with aProviderErrorthat names the address and explains that Kupo writes Byron addresses in base58 and that Byron addresses are not supported, since a UTxO's address here is a ShelleyAddressand cannot represent one.Tests — four new cases in
test/provider/Kupmios.test.ts, all withfetchstubbed in the file's existing style:/matchesUTxO carrying a Byron base58 address (the output address from Kupo's golden vectortest/vectors/golden/1.json) fails withCause.Fail+ProviderErrormentioning Byron/base58 — red before this change asCause.Die;ScriptSchemadecodes{language: "plutus:v4"}— red before as aParseError;plutus:v4reference script fails with aProviderErrorwhose cause chain namesplutus:v4as not supported and contains no parse error — red before;plutus:v3reference script still resolves to aPlutusV3script reference (happy-path guard for themap→flatMaprestructure).Full package suite: 2,736 passed, 7 skipped, 0 failed.
tsc --noEmitand eslint clean; a patch changeset is included.I am an independent builder, not affiliated with Intersect, the Cardano Foundation, or IOG.
@Kshot9000 (https://x.com/kshot9000) · ADA: addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v