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

Timeout in calls to comparatively low energy consuming contracts #4311

Closed
raidshift opened this issue Feb 28, 2022 · 2 comments
Closed

Timeout in calls to comparatively low energy consuming contracts #4311

raidshift opened this issue Feb 28, 2022 · 2 comments
Assignees
Labels
topic: Smart contract VM, smart contract

Comments

@raidshift
Copy link

1. What did you do?

2. What did you expect to see?

  • function verifyProof(bytes memory proof, uint256[6] memory input) public view returns (bool)
    to be executed without errors like in any other EVM compatible Network

  • Test Parameters (for a simple test which should return the value false):
    proof = 0x0c3f55fb97b02d2c507f8c5b6b87b8f8872939f07959f0f671bd83c767d42ca52e718ff1621ebe51cc7c831d39f5a3da25d1cd7db0b4d9e49d216762a3385f14273b6f3daf5b6f3e3ed77c0508117f3d651ddd6e8ac4f2b350dfca929d005504132acfbef922dff2af5a98e4f0d2115fbd8af99a30ebe18420b85ee2961b6dc905a114775273fcccfea094fa06ca9e0325b71bae23c6830f0a2c10737a5543f52072054a099fe527a0941005a44e8d0b055aa4065df5d90bd3966f242e5ad2ec0a9227d4ecdf1fbbfde91b96110e2259fba35fda009e3eaf2126af0d4d242c912e70a7083394fee6a6bc05ebd0d78f45621caa1053bbd2c1f0efde16e90cc59f
    input = ["0","0","0","0","0","0"]

3. What did you see instead?

  • When executing via TronScan:
    class org.tron.core.vm.program.Program$OutOfTimeException : CPU timeout for 'SWAP1' operation executing

  • When executing via EtherScan:
    a valid response: false

To sum it up it seems that it is not possible to call this kind of contracts (even if there are calls to low energy cosuming precompiled ECDSA contracts within the contract) due to harsh timeout restrictions on TRON

@tronprotocol tronprotocol deleted a comment from vivian1912 Feb 28, 2022
@zhaohong zhaohong added the topic: Smart contract VM, smart contract label Feb 28, 2022
@yanghang8612
Copy link
Contributor

yanghang8612 commented Mar 1, 2022

According to the parameters you provided, we have done some tests in a typical FullNode environment. It takes about 233,806 energy and 120ms to complete your transaction execution.

But right now, TVM has a maximum execution time limit while executing a smart contract transaction, which is currently set at 80ms on the mainnet. This is due to that TRON network generates block every 3 seconds. So there is a maximum execution time limit for TVM in order to maintain the stability and high TPS of the network.

There is a discussion about adjusting the maximum execution time limit of TVM. If you are interested, you are more than welcome to join. Here is the link issue-384.

@ethan1844
Copy link
Contributor

Thanks for your contribution to java-tron, this issue will be closed because it was moved to issue-384.

Please feel free to re-open it if you still see the issue, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: Smart contract VM, smart contract
Projects
None yet
Development

No branches or pull requests

7 participants
@BlueHoopor @zhaohong @yanghang8612 @raidshift @ethan1844 and others