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 |
Uh oh!
There was an error while loading. Please reload this page.
Summary
This proposal suggests a separate gas price for the
ContractCallQueryrequest that is relatively cheaper than theContractExecuteTransactiongas price. The goal is to better reflect the resource availability and distribution across the network nodes when calculating the gas price forContractCallQueryrequests.Motivation
Currently, the gas price for
ContractCallQueryandContractExecuteTransactionon Hedera is the same. However, these two types of requests have different resource requirements and processing characteristics. Introducing a separate gas price forContractCallQueryrequests can help better align the cost of these requests with the actual resource consumption and processing overhead.Specification
The proposed gas price formula for
ContractCallQueryrequests is:Gas price for
ContractCallQueryrequests = x * (1/N) * FWhere:
x is the gas price for
ContractExecuteTransactionrequests 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
ContractCallQueryrequests are processed by exactly 1 node, whereasContractExecuteTransactionsare usually processed by every single node,ContractCallQueryrequests are computationally cheaper thanContractExecuteTransactionby a factor of 1/N.F is a scaling factor accounting for the resource availability for
ContractCallQueryrequests.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
ContractCallQueryrequests, then setting F equal to 1/N would account for the fact that each node is only responsible for processing a fraction of the totalContractCallQueryrequests.This gives a relative gas price for
ContractCallQueryrequests ofx * (1/N) * (1/N) = x * (1/N^2)At 28 nodes this translates to
ContractCallQueryrequests having a gas price that is 784x cheaper than that ofContractExecuteTransactionor at 39 nodes 1521x cheaper. For simplicity and to meet in the middle the proposed relative gas price ofContractCallQueryrequests should be rounded to 1000x cheaper or 0.000_000_000_0569 USD/gas. For example, aContractCallQueryrequest 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
ContractCallQueryrequests while maintaining the existing gas price forContractExecuteTransactionrequests.References
1. Hedera Docs - Network Fees for Smart Contract Service
2. Hedera Docs - Gas and Fees
All reactions