-
Notifications
You must be signed in to change notification settings - Fork 206
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
Proposal: enable the return value of the chainid opcode optimization #527
Comments
Ok ... finally someone came up with this idea, it trapped me a lot in permit transaction. When can I test it on testnet? |
Hi I have one question, I noticed that in #tip-474 you mentioned the new return values do not conflict with any chain ID of existing EVM networks. But how can you ensure that there will not be one in the future, is there a list to record it or something to let people know the return value of TRON networks? |
@WalterBrooks It will soon be opened on the nile testnet. |
The return value of EVM networks starts from 1, in descending order by natural number. While the return value of TRON networks is a 9 to 10 digit number, it is hardly to have conflict in the future. |
I have a new question, when I look back at the TIP #474 , you were saying that: When dApp developers use tools such as metamask to access the TRON network and send transactions, this difference will cause some transactions to fail, such as permit type transactions. However, actually, I can not add TRON network in the Metamask wallet, is it due to this chainId opcode issue? If so, after this tip is enabled, can I add TRON network in Metamask? Will there be any other problems such as address transfer. |
Java-tron supports json-rpc interface, metamask still cannot access TRON, because the TRON protocol is not fully compatible with ETH json-rpc. Metamask use the json-rpc:eth_chainId to query the chainid, and then send the permit transaction to smartcontract, but the problem now is that the chainid returned by Java-tron:Json-rpc is inconsistent with the chainid obtained in the smart-contract, smart-conract can not verify the permit transaction, but I think he is assuming that metamask can connect to TRON |
Thanks to everyone's contribution to this proposal. This issue will be closed as it is already going to effect, check detail at: https://tronscan.org/#/proposal/85 |
Proposal to enable the return value of the
chainid
opcode optimizationSimple Summary
This proposal aims to optimize the return value of the
chainid
opcode. For more detailed information aboutchainid
opcode optimization, please refer to: TIP-474.Motivation
In different networks, the return values of the
chainid
opcode are as follows:mainnet
: 0x00000000000000001ebf88508a03865c71d452e25f4d51194196a1d22b6653dcnile
: 0x0000000000000000d698d4192c56cb6be724a558448e2684802de4d6cd8690dcshasta
: 0x0000000000000000de1aa88295e1fcf982742f773e0419c5a9c134c994a9059eThe return value of the
chainid
opcode shown above has the following drawbacks:The return value of the
chainid
opcode does not match the chainId value queried by thejsonrpc
interface. When dApp developers use tools such as metamask to access the TRON network and send transactions, this difference will cause some transactions to fail, such as permit type transactions.The return value of the
chainid
opcode is very large. For the javascript language that commonly used in web3 application development, the maximum integer value isNumber.MAX_SAFE_INTEGER = 2**53 - 1 = 9007199254740991
, and it is clear that the above return values exceed thatNumber.MAX_SAFE_INTEGER
.Therefore, it is necessary to optimize the return value of the
chainid
opcode.Timeline
Voting request expected to be submitted in early May.
How to Initialize the Voting Request
Open the return value of the
chainid
opcode optimization proposal.Backwards Compatibility
Firstly, the new return values proposed in this tip are consistent with some of the TRON community's protocol standards, such as tip-1193 and tip-712.
Secondly, after analyzing the bytecode of the smart contracts on the mainnet and extensive community discussions, we concluded that the proposal has no significant forward compatibility issues. See issue for related analysis and discussion.
The text was updated successfully, but these errors were encountered: