Skip to content
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

Explorer node: Allow ordering hdrs data and mixing crel and cabs #1982

Closed
dbadol opened this issue Jun 15, 2024 · 1 comment
Closed

Explorer node: Allow ordering hdrs data and mixing crel and cabs #1982

dbadol opened this issue Jun 15, 2024 · 1 comment

Comments

@dbadol
Copy link
Contributor

dbadol commented Jun 15, 2024

Current situation
The new feature in 'hdrs' requests allows selecting the data to be provided (with the new 'cabs' and 'crel' parameters). However, it always provides the data in the same order, whatever the order the codes below are actually passed (e.g. 'crel=dfkoOiIC' gives the same result as 'crel=dfkCioIO'). As a consequence, any explorer GUI must reorder the received data in order to have it in the same order as it was requested.

'd' = Difficulty
'f' = Fee
'k' = Kernels
'o' = MwOutputs
'i' = MwInputs
'u' = MwUtxos
'O' = ShOutputs
'I' = ShInputs
'c' = ContractsActive
'C' = ContractCalls
's' = SizeCompressed
'S' = SizeArchieve

Remark: Block height, timestamp and hash are always provided, as first data.

Solution we propose

  1. We propose to have the node explorer provide the data in the same order that was passed in the request (e.g. 'dfkoOiIC' would get the data in an order, while 'dfkCioIO' would get the same data, but in a different order).

  2. Also, we propose to then merge 'crel' and 'cabs' as a single parameter so that the sequence of data can mix relative and absolute (cumulative) values, in whatever requested order.

  3. Finally, to differentiate relative and absolute values, we propose to use lowercase letters only for the relative values, and their uppercase equivalent for the absolute values. Thus we propose the following adjustment to the codes:

'd' = Difficulty
'f' = Fee
'k' = Kernels
'i' = MW Inputs
'o' = MW Outputs
'u' = MW UTXOs
'p' = Shielded Inputs
'q' = Shielded Outputs
'a' = Contracts Active
'c' = Contract Calls
'z' = Size Compressed
's' = Size Archive

The uppercase equivalents (DFKIOUPQACZS) would then represent the absolute values of the above parameters.

An example of request mixing both relative and absolute values AND defining the order for the data to be provided, could be: 'dDfkioUpqcZS'

  1. The default data and order (after block height, timestamp and hash), when no specific request is done, would be "kiopqc" (which represent the most basic information a normal use would need).
@dbadol
Copy link
Contributor Author

dbadol commented Jun 15, 2024

Complement: #1983

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants