Comments (12)
If I do the same call on any public eth rpc that I find, I get a valid result. So its a bit hard to believe that this should not be the standard.
https://ethereum-sepolia.publicnode.com public RPC endpoint behaviour aligns exactly the same as our node.
Does this call return something else on your side? If I call it, it returns a valid gas estimate:
curl https://ethereum-sepolia.publicnode.com \
-H 'Content-Type: application/json' \
--data '{
"jsonrpc":"2.0","method":"eth_estimateGas",
"params":[
{
"from":"0x4790b73359B393a10D4201371563795001f17977",
"to":"0x347D48fB3907B71089945Aee7cafEe75d5F30EBc",
"data":"0xa9059cbb000000000000000000000000dac0ebb0b5ed7ffd9441509acb40f06a529500000000000000000000000000000000000000000000000107ad8f556c6c0000"
}],
"id":1
}'
returns {"jsonrpc":"2.0","id":1,"result":"0x5512"}
Would be really helpful if the community could continue pointing out any integration issues with external web3 applications :)
Thats what I am trying to do here.
from ain.
This is the correct behaviour. Estimate gas RPC aligns with geth, and you will see the exact same behaviour on Ethereum. If the from address has no DFI, and it is trying to make a transaction, the RPC will propagate this error since you cant make transactions without any DFI. If you would like to create a state override setting to test a specfic context, please pass the state override set with the address-to-state mapping in the optional parameter in the eth_estimateGas RPC.
from ain.
thx. @sieniven it might be according to geth. but reality for exchanges is different it seems.
doing the call for any ethereum rpc on https://ethereumnodes.com/ with the address that is also empty on ETH, it always returns the estimated gas.
So this difference makes it harder for anyone to reuse existing eth tools.
from ain.
@kuegi that is not true. Please verify again on your end that you are directly interacting with an ethereum node. With any ethereum node, the default behaviour returns an invalid response: "error": { "code": -32000, "message": "insufficient funds for transfer" }
. Often times these public endpoints, for example Alchemy, may provide an additional layer on top of nodes which differ from node behaviours. We choose to align ourselves as much as we can to geth, and implement behaviours that make sense in our context.
In addition, as mentioned above, please note that our node supports the addition state override set customization in our eth calls RPC. In this specific context, it does not make sense to return a default gas transfer used in this RPC when the address is zero. That would actually make the RPC faulty and unreliable. Please pass the state override if you would like to set a defined context on your RPC call.
from ain.
@sieniven Account DFI amount is not enough will also report an error?
from ain.
@kuegi that is not true. Please verify again on your end that you are directly interacting with an ethereum node. With any ethereum node, the default behaviour returns an invalid response:
"error": { "code": -32000, "message": "insufficient funds for transfer" }
. Often times these public endpoints, for example Alchemy, may provide an additional layer on top of nodes which differ from node behaviours. We choose to align ourselves as much as we can to geth, and implement behaviours that make sense in our context.In addition, as mentioned above, please note that our node supports the addition state override set customization in our eth calls RPC. In this specific context, it does not make sense to return a default gas transfer used in this RPC when the address is zero. That would actually make the RPC faulty and unreliable. Please pass the state override if you would like to set a defined context on your RPC call.
thx for the reply. In the end, the issue is that we make it really hard for externals right now to integrate DMC as it behaves different. If its not an issue on the node itself, its an issue on the blockscouts?
What can we do, to make it easier for exchanges to integrate DMC?
If I do the same call on any public eth rpc that I find, I get a valid result. So its a bit hard to believe that this should not be the standard.
from ain.
@LXHLeaner Yup. https://www.quicknode.com/docs/ethereum/eth_estimateGas - you can check out the optional state override parameter that our node supports.
from ain.
If I do the same call on any public eth rpc that I find, I get a valid result. So its a bit hard to believe that this should not be the standard.
https://ethereum-sepolia.publicnode.com public RPC endpoint behaviour aligns exactly the same as our node.
What can we do, to make it easier for exchanges to integrate DMC?
We have been making multiple PRs and fixes to fix all endpoints to align ourselves as much as we can with geth. geth is the most largest client with the most widespread user base. Actually the node has been making active steps to stability and full integration (PRs #2633, #2736, #2784, #2788, etc), more to come. Would be really helpful if the community could continue pointing out any integration issues with external web3 applications :)
from ain.
@kuegi Thanks for providing the context. This is much more useful, and this is indeed a bug when calling eth_estimateGas with a populated data field in the call context. Will be re-opening this issue.
from ain.
https://ethereum-sepolia.publicnode.com public RPC endpoint behaviour aligns exactly the same as our node.
I run a public BSC Node without some additional layers and Version: instance=Geth/v1.3.8-c6aeee20-20240123/linux-amd64/go1.21.6
Have the same behavior, Request works and result is the estimate Gas as expected, only Defichainnode returns an incorrect result.
from ain.
@sieniven @Stonygan @ldenman @kuegi When will this Defichainnode problem be solved?
from ain.
This issue will be resolved once the PR #2808 is merged.
from ain.
Related Issues (20)
- History for Vault Withdraw not correct on tiny amounts HOT 1
- node crashes and corrupts DB on heavy usage HOT 17
- getaccount regression
- Tracer tracker HOT 1
- Zertificate of the webpage https://api.defichain.io/v1/stats is no more valid HOT 2
- "refreshing UTXOs" never finishes in ver. 4.0.9 HOT 1
- Mixed vaults may not convert their vault to DUSD-only collateral with active loans. HOT 1
- Defichain desktop wallet for windows only gets to splash screen, then stops HOT 1
- EVM token split: intrinsic.migrateToken does not create tokentransfers HOT 2
- Non-upgradeable proxy contract HOT 1
- EVM: Deploy smart contract with salt and bytecode not possible! HOT 3
- 4.0.9 crashes after "[ain_evm::services] Starting tokio waiter" on x86_64-apple-darwin HOT 8
- EVM: token transfers on stock split (upgradeToken) misses inflow HOT 1
- 4.1.0 defid.exe crashes on Windows HOT 7
- Testnet Seeds in Code out of date HOT 1
- 4.1.0 fails by using non existing default path HOT 1
- block.timestamp is not strictly ascending HOT 2
- released sha256sum have the wrong path in it HOT 1
- walletimport: doesn't understand erc55 addresses in the dump format
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ain.