-
Notifications
You must be signed in to change notification settings - Fork 59
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
AuxiliaryData encoding is not using uint keys #88
Comments
thanks @SebastienGllmt. Nice catch, the metadatum label should indeed be a uint instead of the current representation. Regardless of the required change, is it possible that you're using an old version of Oura / Pallas to generate the CBOR? The current version of the lib represents INT metadatum using a minicbor struct that allows up to 2^64, which should be able to accommodate the mentioned value. I've downloaded the block and decoded it. The rust representation of the auxiliary data shows me:
|
I'm using Oura 1.3 (using pallas-primitives 0.6.4) Here are all the steps more concretely: let event = input.recv()?;
let data = event.data.clone();
match data {
EventData::Block(block_record) => {
let block = alonzo::BlockWrapper::decode_fragment(block_record);
let aux_data = block
.auxiliary_data_set
.iter()
// get the specific tx mentioned in this issue from the block
.find(|(index, _)| *index as usize == idx);
let auxiliary_data = aux_data.map(|(_, a)| {
let auxiliary_data_payload = a.encode_fragment().unwrap();
println!("{:?}", hex::encode(auxiliary_data_payload));
}
}
} I noticed the fix is included in this commit, but it's just not part of Oura 1.3 |
The line here uses the type
transaction_metadata: &KeyValuePairs<Metadatum, Metadatum>
which doesn't match the Cardano binary spec. WhileMetadatum
usesint
, the spec has a special type for top-level keys calledtransaction_metadatum_label
which uses uint instead.Concretely, you can see in this transaction that the metadata representation used by Oura ends up being
82a21b12127f810d7dcee28264594554491907e53b08ef38d198e051b4a080
which gives the following cbor.me representation:As you can see, instead of the expected
17802948329108123211
key, we instead get-643795744601428404
You can see, for example, Cardano Multiplatform Lib uses the special label type here
The text was updated successfully, but these errors were encountered: