eos icon indicating copy to clipboard operation
eos copied to clipboard

Adding total CPU/NET quotas to get_info (or similar API)

Open aaroncox opened this issue 4 years ago • 0 comments
trafficstars

In order to determine calculation values for resource quotas, we currently need to call get_account to load an account with a high staked value (like b1) to compare the cpu_limit.max against the cpu_weight.

We currently do this here in our resources library:

https://github.com/greymass/eosio-resources/blob/da23d62ce9b425b8f8850366b84ddcbc993e38b6/src/index.ts#L64-L69

This is useful in determining estimates to convert weight to microseconds and subsequently use those values to calculate cpu_frac and net_frac during powerup transactions.

https://github.com/greymass/eosio-resources/blob/da23d62ce9b425b8f8850366b84ddcbc993e38b6/src/powerup/cpu.ts#L26-L29

From what I understand, these values also exist somewhere in a system wide state. If those values could be exposed via get_info or some other global API response, we could move away from estimating these values based on a single sample account and likely get more accurate estimates.

aaroncox avatar Apr 28 '21 18:04 aaroncox