Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

dot_chain_block_number: Parse block number as scale encoded integer #4

Open
mxinden opened this issue Mar 10, 2020 · 3 comments
Open

Comments

@mxinden
Copy link

mxinden commented Mar 10, 2020

As far as I can tell chain_getBlock returns the block height as a scale encoded integer. For all block number values within the range [0, 2^6) one can ignore the fact that it is SCALE encoded (given that it would be within the single byte mode) and can parse it as a HEX. Once one exceeds the before mentioned range one can not ignore the fact that it is scale encoded.

m.append({
'name': 'dot_chain_block_number',
'prop': { 'block': 'finalized' },
'value': int(chain_FinalizedHeadBlock['block']['header']['number'], 16)
})

@mxinden
Copy link
Author

mxinden commented Mar 11, 2020

@gabreal any thoughts on this? Not sure it is worth fixing given that Substrate now exposes its metrics directly.

@gabreal
Copy link
Contributor

gabreal commented Mar 11, 2020

Not sure whether the dotexporter will be useful in the future. I'm happy to implement it though if it's not taking huge efforts. Do you have an idea how this can be achieved in python?

@mxinden
Copy link
Author

mxinden commented Mar 13, 2020

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

No branches or pull requests

2 participants