Replies: 1 comment 3 replies
-
I disagree that the cost should scale down with more nodes. The burden on a node doesn't get easier for a specific call because there are more nodes that could handle the call. The resource burden on the node is the same per call even if the aggregate amount of calls may change. The costs to the node consist of time gossiping the event, CPU time computing the execution, resources spent reading state, and resources spent writing and committing state. A local execution still has to use the CPU time computing execution and spend resources reading the state. This is independent of the number of nodes in the network. I would recommend a fixed value for |
Beta Was this translation helpful? Give feedback.
-
Summary
This proposal suggests a separate gas price for the
ContractCallQuery
request that is relatively cheaper than theContractExecuteTransaction
gas price. The goal is to better reflect the resource availability and distribution across the network nodes when calculating the gas price forContractCallQuery
requests.Motivation
Currently, the gas price for
ContractCallQuery
andContractExecuteTransaction
on Hedera is the same. However, these two types of requests have different resource requirements and processing characteristics. Introducing a separate gas price forContractCallQuery
requests can help better align the cost of these requests with the actual resource consumption and processing overhead.Specification
The proposed gas price formula for
ContractCallQuery
requests is:Gas price for
ContractCallQuery
requests = x * (1/N) * FWhere:
x is the gas price for
ContractExecuteTransaction
requests priced in USD/gas which is currently fixed at 0.000_000_0569 USD/gas.N is the total number of consensus nodes in the network. Currently, Hedera has 28 consensus nodes run by council members, with a limit of 39. Since
ContractCallQuery
requests are processed by exactly 1 node, whereasContractExecuteTransactions
are usually processed by every single node,ContractCallQuery
requests are computationally cheaper thanContractExecuteTransaction
by a factor of 1/N.F is a scaling factor accounting for the resource availability for
ContractCallQuery
requests.Reasoning for F being 1/N
Setting F equal to 1/N is a reasonable approach when considering the following:
If all N nodes in the network are equally load balanced and have equal availability and capacity to process
ContractCallQuery
requests, then setting F equal to 1/N would account for the fact that each node is only responsible for processing a fraction of the totalContractCallQuery
requests.This gives a relative gas price for
ContractCallQuery
requests ofx * (1/N) * (1/N) = x * (1/N^2)
At 28 nodes this translates to
ContractCallQuery
requests having a gas price that is 784x cheaper than that ofContractExecuteTransaction
or at 39 nodes 1521x cheaper. For simplicity and to meet in the middle the proposed relative gas price ofContractCallQuery
requests should be rounded to 1000x cheaper or 0.000_000_000_0569 USD/gas. For example, aContractCallQuery
request with the gas set to the maximum of 15 million would cost:Backwards Compatibility
This proposal is expected to be backwards compatible, as it only introduces a separate and cheaper gas price for
ContractCallQuery
requests while maintaining the existing gas price forContractExecuteTransaction
requests.References
1. Hedera Docs - Network Fees for Smart Contract Service
2. Hedera Docs - Gas and Fees
Beta Was this translation helpful? Give feedback.
All reactions