Open mkoura opened 6 months ago
This is a dup of https://github.com/IntersectMBO/cardano-cli/issues/645
The representation of certificates in ledger has changed between Babbage and Conway. In Babbage it's a StrictSeq
allowing for duplicate certificates to be stored in the transaction body. In Conway it is OSet
which stores only unique certificates. This needs to be fixed in ledger.
This needs to be fixed in ledger.
The change to OSet
is the fix in ledger, because duplicate certificates in the same transaction are not supported.
Hopefully we'll have enough time in ledger to change for Conway the functionality of "being stripped" to "deserialization failure". This is conceptually a pretty hard task due to annotator, but we are aware of it and have some plans on how to tackle it
Proper fix for this is postponed till the next era, since that is fundamentally a much harder task to fail deserialization on duplicates with our current approach. There is a concrete plan making this happen in the next era. However, if you look at the change in CDDL from Babbage:
to the one in Conway:
You will see that certificates where changed from an array to a set. This means that according to the binary specification duplciates are not allowed. This also means by dropping duplicates we are in adherence to the specification, because CDDL leaves it up to implementation how to deal with duplicates in sets and maps.
In other words this is not a bug. That does not mean we could not make the UX a bit better, and we will in the next era by failing instead of silently dropping elements. I'll keep this ticket opened, so we don't forget to do it, but I'll change the title to reflect the actual task.
Ticket for the actual cause of this problem: #4009
Internal/External Internal
Area Other Any other topic (Delegation, Ranking, ...).
Summary In Babbage transaction, the order of certificates is retained, even when the certificates are repeated. I can eg. build a tx that contain following certs in this order
The transaction can be submitted and the stake address is registered.
Certs in Babbage tx:
However in Conway tx, the repeated certs are stripped. Therefore when submitting the tx with certificates order listed above, the stake address is not registered.
Certs in Conway tx:
Steps to reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
System info (please complete the following information):
Screenshots and attachments Conway and Babbage transactions: tx_certificates_issue.tar.gz