-
Notifications
You must be signed in to change notification settings - Fork 62
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
String reverts not working #173
Comments
@xcantera Do you mean the contract never reverts? Or the contract reverts but not report any reason string? Not found transaction from contract xdc4de3fb29288452474948d16296128048e5dbc700 . |
@gzliudan if you check what I sent you will be able to see it. First thing: The reverts dont send any error message. Second thing: xdc4de3fb29288452474948d16296128048e5dbc700 If you check it on polygon, its working perfect. As I said, if you check my examples you can easy see what its happening |
Would you please deploy the same contracts to test chain apothem ? Yes, ploygon chain works very well. There are some problems on xinfin chain. I will check if it works on test chain first. |
I cant do it right now. You have the smartcontract codes (smartcontract are
verifie), copy the code and put it on the testnet
…On Sat, Aug 20, 2022, 6:48 AM Daniel Liu ***@***.***> wrote:
Would you please deploy the same contracts to test chain apothem ?
—
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKGG72XEHISKLN6FPRUYVTV2BPR5ANCNFSM56ZCZLTA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
I deployed it on testnet just now: https://explorer.apothem.network/address/xdcb08ba7324663840621dd587e0a70a0eafff37e87#readContract and https://explorer.apothem.network/address/xdc7f3de014bfd22d06ec1852b0b179da1edda139d5#readContract with different solidity compiler version. The problem is same. |
I see it. As you can see, you cant write transactions.
…On Sat, Aug 20, 2022, 7:42 AM Daniel Liu ***@***.***> wrote:
I deployed it on testnet just now:
https://explorer.apothem.network/address/xdcb08ba7324663840621dd587e0a70a0eafff37e87#readContract
—
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKGG74NA3JN3VCYGZY3UBDV2BV2RANCNFSM56ZCZLTA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
The stake function you mentioned belongs to which contract? Would you please post the address and code? |
… On Sat, Aug 20, 2022, 7:51 AM Daniel Liu ***@***.***> wrote:
The stake function you mentioned belongs to which contract? Would you
please post the address and code?
—
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKGG73ATJFGT6SW36KACATV2BW73ANCNFSM56ZCZLTA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
I checked the failed transations before 3-6 days ago, the fail reason messages are below:
Maybe these error messages are caused by the bug of RPC node. It seems the require commands in contract are executed right. |
Ok, please fix it.
…On Sat, Aug 20, 2022, 8:09 AM Daniel Liu ***@***.***> wrote:
I checked the failed transations before 3-6 days ago, the fail reason
messages are below:
missing trie Node 7f2218d7f466aa5718812126428017753d2b68e24365197fce244a6eb7ebb3c1 (path )
missing trie Node f869c6e34823b8a14f8c33f0fdeb7fb2c42936fb6fe9fc9a2d036baee5a5a325 (path )
missing trie Node 5ba03ac903a1c8eb1d5d42c9ca55225708e18dd73ab2ab9615c76a40614cf9ea (path )
missing trie Node b4b069586810a654cb73a04bacfa5d4cf5c10d0c9fe53c2a70fc8cf6df5cc4a7 (path )
missing trie Node 3d9ffa7c545c145880d1e7ab5e9a7ad9fb39498d2ec7fc5513b8918949daf446 (path )
missing trie Node b7ee0ce15752c5385e3320a39da93eef8949ef11fe435fb5deac4d640f8366a1 (path )
missing trie Node 0417cc06299708cba750a6519f120b977ee586fcd2b6ff56a15ef8b7e8cebb13 (path )
missing trie Node 2d57b886fb1f2b65ad1219e4b9c5b219c8e3eac0fae392354db8cd70db7e0900 (path )
Maybe these error messages are caused by the bug of RPC node's. It seems
the require commands in contract are executed right.
—
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKGG74JUCC4EBRP7IXDXQTV2BZB3ANCNFSM56ZCZLTA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Check the other example also. You see that you cant interact with
smartcontract using xdc. But you can interact with the smartcontract using
polygon
On Sat, Aug 20, 2022, 8:11 AM ARTURO CANTERA CARRASCO ***@***.***>
wrote:
… Ok, please fix it.
On Sat, Aug 20, 2022, 8:09 AM Daniel Liu ***@***.***> wrote:
> I checked the failed transations before 3-6 days ago, the fail reason
> messages are below:
>
> missing trie Node 7f2218d7f466aa5718812126428017753d2b68e24365197fce244a6eb7ebb3c1 (path )
> missing trie Node f869c6e34823b8a14f8c33f0fdeb7fb2c42936fb6fe9fc9a2d036baee5a5a325 (path )
> missing trie Node 5ba03ac903a1c8eb1d5d42c9ca55225708e18dd73ab2ab9615c76a40614cf9ea (path )
> missing trie Node b4b069586810a654cb73a04bacfa5d4cf5c10d0c9fe53c2a70fc8cf6df5cc4a7 (path )
> missing trie Node 3d9ffa7c545c145880d1e7ab5e9a7ad9fb39498d2ec7fc5513b8918949daf446 (path )
> missing trie Node b7ee0ce15752c5385e3320a39da93eef8949ef11fe435fb5deac4d640f8366a1 (path )
> missing trie Node 0417cc06299708cba750a6519f120b977ee586fcd2b6ff56a15ef8b7e8cebb13 (path )
> missing trie Node 2d57b886fb1f2b65ad1219e4b9c5b219c8e3eac0fae392354db8cd70db7e0900 (path )
>
> Maybe these error messages are caused by the bug of RPC node's. It seems
> the require commands in contract are executed right.
>
> —
> Reply to this email directly, view it on GitHub
> <#173 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AIKGG74JUCC4EBRP7IXDXQTV2BZB3ANCNFSM56ZCZLTA>
> .
> You are receiving this because you modified the open/close state.Message
> ID: ***@***.***>
>
|
We found 2 problems now:
The second issue maybe has something to do with RPC node. |
Yes, exactly
…On Sat, Aug 20, 2022, 8:16 AM Daniel Liu ***@***.***> wrote:
We found 2 problems now:
1. Can't call write function on explorer web site
2. The failed transation report error message: missing trie Node
—
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKGG75E3LPOY7RNZASEV4TV2BZ35ANCNFSM56ZCZLTA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
I'll forword the information to XinFin blockchain development team. |
Awesome, thanks!
…On Sat, Aug 20, 2022, 8:22 AM Daniel Liu ***@***.***> wrote:
I'll forword the information to XinFin blockchain development team.
—
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKGG7ZVUAQLICVYI5RCYULV2B2TJANCNFSM56ZCZLTA>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
I found you are using ABDK Libraries. I opened a issue just now: abdk-consulting/abdk-libraries-solidity#23.
|
@BlocksScanIO Yes, the error message can be showed on blockscan exploer now. But the write functions can't be showed and called on blockscan exploer still now! |
Thank you for confirmation @gzliudan , Does write function for this contract work on remix ? |
Write functions work for other verified contracts, We would analyse the given contract and get back to you with the required solution. Tested Write function:- https://xdc.blocksscan.io/address/xdc1f37bbbfa244f6a39f8447e342dfcd3c651ce73e#readContract |
Cool! I see our smartcontract now show the error msg on Blocksccan. I will let you if it works with our interface |
The page of |
Yes @gzliudan, it should show function buttonClick() and claimPrize() in the above example contracts. |
Hey, guys @gzliudan the error is still the same. Now you need to force a failing tx to see the error on Blocksscan. We don't want to make people force the transaction when it's going to fail 100%. I did test here: https://explorer.xinfin.network/address/xdc4b4336ec39321ab030459b51f256e2f00b960405#transactions As you can see the revert is not working if you don't force the tx. |
Which transaction is not work as you expected? What's your error now? |
@gzliudan you need to force all the tx to get a revert. The revert should show the information before force the tx |
@gzliudan just try on your own. Use remix and use a smart contract with reverts. You will see that you don't see any information before forcing the tx. |
Please check the VIDEO: 2022-09-15.18-47-20.mp4 |
I caught what you mean. If you execute a transaction which should be failed:
|
XDC blockchain didn't show the revert error before sending the tx with no
one wallet/interface(metamask, XDCpay, Remix...). There is no way to see
the error before sending the transaction.
As I explained on the video this is a big problem.
See the video complete please.
…On Fri, Sep 16, 2022, 1:49 AM Daniel Liu ***@***.***> wrote:
I caught what you mean. If you execute a transaction which should be
failed:
- If use xdc blockchain: MetaMask didn't warn, GAS is lost after you
send the transtion.
- If use other blockchains.: MetaMask warn you that this transation
will be reverted before send transaction, you can cancel the transaction if
you see the waring, both of gas and time are saved.
—
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKGG76JBEPS3TOITDNNGBDV6OYWZANCNFSM56ZCZLTA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I did some tests today. When I send a fail transaction with remix, the below results occurred:
I think both of metamask and xdcpay maybe alter or not alter user when send a transaction which will revert. And metamask alter me that a transaction will fail but it is executed successfully in fact last year. Both of them are not absolutely right at any time. |
Use remix. As I show you in the video, Remix show you the error before
sending the transaction.
We only care about before sending the transaction.
The network should tell you before sending the transaction if is going to
fail and the error message(revert). Like polygon do in the video.
In our interface mint.primenumbers.es we need this information. Right now,
we only getting the generic error what you see on the video. We need the
revert error before sending a tx to tell the user what is going on and why
he shouldn't do the tx.
…On Fri, Sep 16, 2022, 10:52 AM Daniel Liu ***@***.***> wrote:
I did some tests today. When I send a fail transaction with remix, the
below results occurred:
- Metamask does not alert user sometimes when use metamask + mumbai
- xdcpay alert when use xdcpay + apothem
I think both of metamask and xdcpay maybe alter or not alter user when
send a transaction which will revert. And metamask alter me that a
transaction will fail but it is executed successfully in fact last year.
Both of them are not absolutely right at any time.
—
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKGG746ESOWV5HAYOIJSSDV6QYNJANCNFSM56ZCZLTA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Again, you shouldn't send a tx to see the error message. You need to know
the error before sending the transaction.
On Fri, Sep 16, 2022, 11:02 AM ARTURO CANTERA CARRASCO ***@***.***>
wrote:
… Use remix. As I show you in the video, Remix show you the error before
sending the transaction.
We only care about before sending the transaction.
The network should tell you before sending the transaction if is going to
fail and the error message(revert). Like polygon do in the video.
In our interface mint.primenumbers.es we need this information. Right
now, we only getting the generic error what you see on the video. We need
the revert error before sending a tx to tell the user what is going on and
why he shouldn't do the tx.
On Fri, Sep 16, 2022, 10:52 AM Daniel Liu ***@***.***>
wrote:
> I did some tests today. When I send a fail transaction with remix, the
> below results occurred:
>
> - Metamask does not alert user sometimes when use metamask + mumbai
> - xdcpay alert when use xdcpay + apothem
>
> I think both of metamask and xdcpay maybe alter or not alter user when
> send a transaction which will revert. And metamask alter me that a
> transaction will fail but it is executed successfully in fact last year.
> Both of them are not absolutely right at any time.
>
> —
> Reply to this email directly, view it on GitHub
> <#173 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AIKGG746ESOWV5HAYOIJSSDV6QYNJANCNFSM56ZCZLTA>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Metamask and xdcpay only say the tx is going to fail. The reason???? You
need to send a fail tx to see it.
We dont care about metamask, XDCpay, Trezor, ledger, culopay....
We care about the network and the network is not telling you the revert
before you send the tx.
And the other networks tell you the revert before sending the tx.
…On Fri, Sep 16, 2022, 11:14 AM Daniel Liu ***@***.***> wrote:
Yes, I use remix to do tests. What I checked is metamask and xdcpay
whether alert user before send transaction.
—
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKGG7644MR25DY3WUKHHFLV6Q26LANCNFSM56ZCZLTA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
We will investigate this problem in detail and work out a better solution. It seems that RPC nodes need to be optimized. I deployed a test contract to mumbai and apothem chains: // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract TestRevert {
uint256 public value = 0;
function setValue(uint256 newValue) external {
require(newValue < 10, "newValue >= 10");
value = newValue;
}
} test with mumbai RPCcode: https://mumbai.polygonscan.com/address/0x135cd8b7002c345b3da3e7712b77cae17d58b38e#code Requestcurl -X POST -H "Content-Type: application/json" https://rpc.ankr.com/polygon_mumbai -d '
{
"jsonrpc":"2.0",
"method":"eth_estimateGas",
"params":[
{
"from":"0xD4CE02705041F04135f1949Bc835c1Fe0885513c",
"to":"0x135cd8b7002c345b3da3e7712b77cae17d58b38e",
"data": "0x55241077000000000000000000000000000000000000000000000000000000000000000a",
"value":"0x0"
}
],
"id":1
}' Response{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": 3,
"message": "execution reverted: newValue >= 10",
"data": "0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000e6e657756616c7565203e3d203130000000000000000000000000000000000000"
}
} test with apothem RPCcode: https://explorer.apothem.network/address/xdc41cfa4c7c764c39237a765788eb0596c4b7a05ba#readContract Request:curl -X POST -H "Content-Type: application/json" https://rpc.apothem.network -d '
{
"jsonrpc":"2.0",
"method":"eth_estimateGas",
"params":[
{
"from":"0xD4CE02705041F04135f1949Bc835c1Fe0885513c",
"to":"0x41cfa4c7c764c39237a765788eb0596c4b7a05ba",
"data": "0x55241077000000000000000000000000000000000000000000000000000000000000000a",
"value":"0x0"
}
],
"id":1
}' Response{
"jsonrpc": "2.0",
"id": 1,
"error": {
"code": -32000,
"message": "gas required exceeds allowance or always failing transaction"
}
} conclusionFail reason:
Yes, ploygon blockchain outputs better reason, xinfin blockchain needs some improvement. |
All the tx with a revert. The network should send the error message before
force the tx
…On Wed, Aug 31, 2022, 7:21 PM Daniel Liu ***@***.***> wrote:
Which transaction is not work as you expected?
—
Reply to this email directly, view it on GitHub
<#173 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIKGG7ZN4H2YKKM3UUZEHP3V36ICLANCNFSM56ZCZLTA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @xcantera , I would suggest you test Apothem RPC where we have applied the latest v1.4.6 to fix the reported issue. Apothem TestNet RPC :- https://rpc.apothem.network {"jsonrpc":"2.0","id":1,"error":{"code":-32000,"message":"execution reverted: newValue \u003e= 10"}} |
Hi, the error messages didn't seem to pop up on the remix for xinfin. You can check the video attachment for the same when tried with XDCPay. 2023-02-27.22-20-33.mp4However, it does pop up an error while using Metamask 2023-02-27.22-24-33.mp4 |
@nitishpatel Do you mean the following result ?
|
@gzliudan Yes, Also It behaves similarly on dapp, XDCPay does return an error but with no string. Context this error comes because I have a check before any transaction is done to see if it's likely to fail.
One can also check if its failing by just doing a |
Hello, @nitishpatel Does XDCPay 2.0 Work for you with remix.xinfin.network ? |
|
Closing the issues as it was resolved |
hot fix for EstimateGas and Call handle revert error XinFinOrg/XDPoSChain#173
We found a critical error on the network that makes a lot of code useless and can be a huge security problem.
The main network not working with "String reverts", for example when you have a revert on the smart contract. The network doesn't indicate what revert happened. (This is mandatory to fix it or most of the applications will not work if a revert happens)
This is a code example.
`function stake(uint256 tokenId, uint256 amountToStake) public nonReentrant {
}`
We can see the next example with more details:
Im creating a jackpot smartcontract on the XDC network.
https://xdc.blocksscan.io/address/xdc4de3fb29288452474948d16296128048e5dbc700 - > Smartcontract on XDC
https://polygonscan.com/address/0x22568f35016a8bc0c61b21b5360f7340e46ead1e - > Smartcontract on Polygon
As you can see, you cant write the smartcontract with Blockscan(You cant write also with remix). Im doing the play buttons(functions) with requires.
We know XDC network have a problem and require().... is not working in the network.
On polygon works perfect, on xdc network is not working.
You can get the smartcontract code from the explorers, its verified!
The text was updated successfully, but these errors were encountered: