Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIP-397: Raise limit of the 13th network parameter #397

Closed
yanghang8612 opened this issue Apr 6, 2022 · 1 comment
Closed

TIP-397: Raise limit of the 13th network parameter #397

yanghang8612 opened this issue Apr 6, 2022 · 1 comment

Comments

@yanghang8612
Copy link
Contributor

yanghang8612 commented Apr 6, 2022

tip: 397
title: Raise limit of the 13th network parameter	
author: yanghang8612@163.com
discussions to: https://github.com/tronprotocol/TIPs/issues/384
status: Draft
type: Standards Track
category: VM
created: 2022-04-06

Abstract

Raise the limit of the 13th(MAX_CPU_TIME_OF_ONE_TX) network parameter.

Motivation

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.

Specifications

After the RAISE_PROPOSAL(TBD) takes effect, the limit for the 13th network parameter will change from 100 ms to 400 ms.

Rationale

The time range for SR to produce blocks

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

Why the limit cannot exceed 450ms

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.

Backwards Compatibility

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.

Security Considerations

There are no known security considerations issues.

@yanghang8612 yanghang8612 changed the title TIP-395: Raise limit of the 13th network parameter TIP-397: Raise limit of the 13th network parameter Apr 6, 2022
@ethan1844
Copy link
Collaborator

Close this issue as it is implemented by GreatVoyage-v4.5.0.
Check TIP detail at TIP-397
Check implementation PR at tronprotocol/java-tron#4375

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants