pyquarkchain
pyquarkchain copied to clipboard
gas_price() estimate function may not return expected value for multi-native token
https://github.com/QuarkChain/pyquarkchain/blob/d470e13a26c64875652b3b1665eb58895baeb4ab/quarkchain/cluster/shard_state.py#L1777
The current estimation will estimate based on the historical gas price of the same token id, which may be empty or small if the token id is not frequently used. A better way may still estimate the price for QKC first and then convert to the price for token id.
Further, returning MIN_TX_POOL_GAS_PRICE for other token ids other than QKC may be wrong.
We may also need to add a jsonrpc that accepts:
- chain id
- token id
- gas price and outputs
- gas price in QKC
lower the priority since it's not consensus-critical.