tip: 397
title: Raise limit of the 13th network parameter
author: [email protected]
discussions to: https://github.com/tronprotocol/TIPs/issues/384
status: Final
type: Standards Track
category: VM
created: 2022-04-06
Raise the limit of the 13th(MAX_CPU_TIME_OF_ONE_TX) network parameter.
The 13th network parameter now ranges from 10 to 100 ms. This range currently greatly limits developers from designing more diverse and complex applications such as DeFi, GameFi, etc.
Therefore the purpose of this TIP is to extend the limit of the range of the 13th network parameter.
After the ALLOW_HIGHER_LIMIT_FOR_MAX_CPU_TIME_OF_ONE_TX
takes effect, the limit for the 13th network parameter will change from 100 ms to 400
ms.
TRON network generates block every 3 seconds. According to the design of the TRON's DPOS consensus mechanism, the time range for SR to produce blocks is 450 to 1500 ms.
The timeout
calculation algorithm is shown in the following code which link is at DposTask.java.
...
long timeout =
pTime + BLOCK_PRODUCED_INTERVAL / 2 * dposService.getBlockProduceTimeoutPercent() / 100;
...
The range of getBlockProduceTimeoutPercent()
is set in the following code which link is at Args.java.
...
if (PARAMETER.blockProducedTimeOut < 30) {
PARAMETER.blockProducedTimeOut = 30;
}
if (PARAMETER.blockProducedTimeOut > 100) {
PARAMETER.blockProducedTimeOut = 100;
}
...
Therefore the time range for SR to produce blocks can be calculated by 3000 / 2 * 30 / 100 ~ 3000 / 2 * 100 / 100 = 450 ~ 1500
According to the above analysis, SR can set its own block production time to a minimum of 450ms. Then assuming that the 13th network parameter is set to a value greater than 450ms, it means that the SR cannot package any other system contract transaction after it packages a smart contract transaction that exceeds 450ms.
This is a breaking change given proposal to set the 13th network parameter to a new value greater than 100 will be legal. So need a hard fork to achieve.
There are no known security considerations issues.