Closed dodinhvit23f closed 1 year ago
@dodinhvit23f
Thanks. Please see my comments inline below.
How could we know that protocol parameters are mapping properly ?
The CurrentProtocolParams local query returns an array. As it's about "current" protocol prams, the array content changes based on the era. So the deserialization logic in the CurrentProtocolParamsQuery.class is specific to Babbage era.
Unfortunately, there is no standard CDDL for this and it is only defined in Haskell code.
Fyi, here are the links to Haskell code for the same.
Alonzo protocol params Haskell code : https://github.com/input-output-hk/cardano-ledger/blob/da48c5ba96b72426a51f36507d49604505fc96a7/eras/alonzo/impl/src/Cardano/Ledger/Alonzo/PParams.hs#L290
Babbage protocol params Haskell code: https://github.com/input-output-hk/cardano-ledger/blob/da48c5ba96b72426a51f36507d49604505fc96a7/eras/babbage/impl/src/Cardano/Ledger/Babbage/PParams.hs#L226
So could you change some thing via Query.class that tell cardano node return a Map like the protocol_param_update describe below
As I mentioned above, node returns an array in case of current protocol params query. I don't think we can change the node behavior through query.
However, as you mentioned, protocol_param_update is a part of the transaction object and is defined as a map in CDDL.
It would be great if we have to query protocol parameters for each epoch starting from shelley
While doing local query, you first need to acquire a snapshot at a particular point. If you provide a too old point, node returns "ACQUIRE_FAILURE_POINT_TOO_OLD". So I am not sure if you will be able to query protocol params from shelley era through node to client.
Creating different Query class like ShelleyProtocolParamsQuery or AlonzoProtocolParamsQuery is possible, but it may not work due to point too old error.
For historical protocol params, you may need to keep track of protocol_params_update map in the transactions. So start with protocol params defined in shelley or alonzo genesis files and track all protocol update transactions.
How could we know that protocol parameters are mapping properly ?
CurrentProtocolParamsQuery.class line 48 return an array of data items . But because the data items result is an array so it really hard for us to tracking the index that what was mapped and it would change if come to other era or not.
for example: with mainnet and Babbage era I don't see decentralization at index 12 instead of major version
So could you change some thing via Query.class that tell cardano node return a Map like the protocol_param_update describe below
It would be great if we have to query protocol parameters for each epoch starting from shelley