Closed AngelCastilloB closed 1 year ago
@AngelCastilloB notice how pool_params
is defined:
pool_params = ( operator: pool_keyhash
, vrf_keyhash: vrf_keyhash
, pledge: coin
, cost: coin
, margin: unit_interval
, reward_account: reward_account
, pool_owners: set<addr_keyhash>
, relays: [* relay]
, pool_metadata: pool_metadata / null
)
pool_params
is a basic group (it is NOT encoded as an array - notice the (
and )
not [
and ]
) which means the fields will be inserted into pool_registration
.
Hi @rooooooooob I see now, thanks for the information and the quick reply!.
If you want more info about basic groups and the behavior check out section 2.1 of the CDDL RFC (groups and composition). Keep in mind in babbage.cddl
(and ONLY in babbage - previous eras seem to correctly follow the basic group insertion for operational certs/versions) we seem to have the babbage.cddl
spec possibly incorrect regarding basic groups (input-output-hk/cardano-ledger#3559). The currently published CML hasn't been updated regarding this but the next version should have that fix (#246). It's only an issue if you're working with babbage blocks/block headers though.
This is really useful @rooooooooob thanks
The pool registration certificate is defined in the CDDL as:
pool_registration = (3, pool_params)
I would expect this to be serialized to something like: [ 03, [ pool param data ] ] (array of 2 elements with a nested array of 9 elements for pool params), or in CBOR:
However the CML is serializing this certificate as [ 03 + pool param data] (single flat array of 10 elements), or in CBOR:
This is different that how the other structures are serialized, in which each sub structure is encoded as is as a single entry in the parent array, is there any reason why this particular case is different?