cardano-multiplatform-lib icon indicating copy to clipboard operation
cardano-multiplatform-lib copied to clipboard

Fix header group encoding

Open SebastienGllmt opened this issue 3 years ago • 2 comments

I don't know why, but these fields were skipping the array encoding and instead only serializing the content

More specifically, you can see for example in this block header cbor the operational certificate is inside an array(4), yet CML was excluding this

image

I disabled the old test since it also had the improper header encoding (presumably since the incorrect cbor was itself generated from CML). However, maybe I'm missing something

I should add that the block cbor comes from Pallas so it should be taken with a huge grain of salt, but it seems to match what I would expect from the binary spec

SebastienGllmt avatar Aug 08 '22 01:08 SebastienGllmt

If this is the case then there could be some other areas affected i.e.. anywhere using pool_params but maybe they handle those cases where it's in a group choice correctly like with certificate / relay whose variants use basic groups, as I imagine we would have noticed it if certificates were not encoded correctly. It's worth looking into though.

rooooooooob avatar Aug 08 '22 17:08 rooooooooob

@rooooooooob @SebastienGllmt have you checked if this is the case when parsing a raw cbor block via a direct blockfetch to the node?

scarmuega avatar Aug 09 '22 00:08 scarmuega

@SebastienGllmt I'm going to close this at least for now. It modifies the legacy code and while it allows parsing for babbage, it will break deserialization for all other eras. We have #246 that does this for babbage only in the current codebase.

rooooooooob avatar Aug 03 '23 23:08 rooooooooob