Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve the CBOR representation of scripts #4537

Closed
wants to merge 3 commits into from

Conversation

LudvikGalois
Copy link
Contributor

@LudvikGalois LudvikGalois commented Oct 18, 2022

Fixes #4433

cardano-api/src/Cardano/Api/ScriptData.hs Outdated Show resolved Hide resolved
cardano-api/src/Cardano/Api/ScriptData.hs Outdated Show resolved Hide resolved
cardano-api/src/Cardano/Api/CBOR.hs Show resolved Hide resolved
cardano-api/src/Cardano/Api/ScriptData.hs Show resolved Hide resolved
@LudvikGalois LudvikGalois force-pushed the ludvikgalois/preserve-cbor branch 3 times, most recently from 2848bc8 to f792556 Compare October 24, 2022 08:36
@Jimbo4350
Copy link
Contributor

Jimbo4350 commented Oct 26, 2022

So this needs a rebase on master. Also in terms of commits, this would be a lot nicer if the commits were split as follows:

  • 1st commit: Diff wrt addition of Cardano.Api.CBOR and propagation of the new types within cardano-api
  • 2nd commit: Diff wrt propagation of the new types in cardano-cli
  • 3rd commit: Diff wrt benchmarking changes.

Linking to the issue in the description and elaborating on "Preserve the CBOR representation of scripts" in the commit message will save me having to ping you when the next release comes around and I have forgotten the specifics.

@LudvikGalois LudvikGalois force-pushed the ludvikgalois/preserve-cbor branch 3 times, most recently from c598dea to 8d3b75f Compare October 31, 2022 11:43
@github-actions
Copy link

This PR is stale because it has been open 45 days with no activity.

@github-actions github-actions bot added the Stale label Dec 16, 2022
Robert 'Probie' Offner added 3 commits December 28, 2022 12:20
In many places it's important to retain the original bytes that the user
supplied so that the hash is what they expect. This is especially
important for data sent as CBOR, since there's multiple way to represent
identical arrays.
The `ScriptData` type can be used to build Plutus scripts, but if we
store user supplied script data in it directly we will lose their
original encoding of the data. `HashableScriptData` attempts to fix this
issue by pairing `ScriptData` with the bytes used to represent it.

In an attempt to minimise the breakage to code which depends on the API,
functions which depended on the value of `ScriptData`, but doesn't need
the original bytes now accept both `ScriptData` and `HashableScriptData`
via the new `IsScriptData` class.
@Jimbo4350
Copy link
Contributor

Subsumed by: #4886

@Jimbo4350 Jimbo4350 closed this Feb 17, 2023
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.

[BUG] - Possible corruption of datum by CLI
2 participants