-
Notifications
You must be signed in to change notification settings - Fork 125
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
hash_plutus_data
returning a new hash for the same PlutusData
instance - 11.0.0-rc.6
#483
Comments
If possible, it would be nice if you could post the data, post the hash you get and also post what you think the expected hash should be |
Yes of course! RAW Datum:
expected hash: new hash: |
hash_plutus_data
returning a new hash for the same PlutusData
instance - 11.0.0-rc.6
hash_plutus_data
returning a new hash for the same PlutusData
instance - 11.0.0-rc.6
@abdelkrimdev , I am getting hash If you have got a hash |
Hey @vsubhuman 😄 the CBOR is the same the only thing I changed is the serialization lib version.
|
@abdelkrimdev, ah yes, if you mean a version before Still, though, in the version This code snippet:
Produces This happens because the behaviour were incorrect before the version In any version before This means that you have been using a datum with indefinite arrays, but the hashes been created for datum with definite arrays. Which is a really unfortunate side-effect of using CBOR in general which allows same information to be encoded in multiple different forms. You should be able to fix your issue by taking your datums and converting them to CBOR with definite arrays and then they will match the used hashes exactly. One of the ways to do it would be to take the library version
Just parsing a datum from bytes and then putting them right back into bytes will produce the different CBOR for you, which will match the hashes that were incorrectly created in that library version. For example, the datum that you have specified above is converted into this:
Which is the same exact information but with definite arrays: And executing this code snippet:
Gives the same hash |
Can you guys let me know if my understanding is correct.
My assumption is that we should be using plutus_alonzo_cost_model because tokens were locked before vasil hardfork era. please correct me if i'm wrong |
After upgrading to the latest version of the CSL
11.0.0-rc.6
I noticed that I'm getting a new hash when calling thehash_plutus_data
function which is breaking the backward compatibility and make it impossible to unlock old assets from the scriptThe text was updated successfully, but these errors were encountered: