-
Notifications
You must be signed in to change notification settings - Fork 100
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
remove tx fee #743
remove tx fee #743
Conversation
What's the problem? |
We use the rpc method calculate tx fee mostly, so the fake tx fee is not necessay. |
My concern here is that removing a field from the interface might cause some chaos to other services who rely on it. Maybe we should mark it as deprecated for a while, instead of removing it directly. |
As I know some dapps relying on it has been blocked already by this sysfee as it's 0 before, now it's using MaxGasInvoke... |
If you say so. |
Sorry but still don't understand the problem, the invocation is with this limited gas, so what's the problem if someone extract the tx and find the same gas? |
Just like this . var totalGas = tx.SystemFee + tx.NetworkFee;
var estimateGases = (BigInteger[])Contract.Call(RouterContract, "getAmountsOut", CallFlags.All, amountIn, tokenPath);
var estimateGas = estimateGases[^1];
Assert(estimateGas > totalGas, "EstimateGas is not enough", estimateGas, totalGas); |
I see, but this case it's too specific, another project can check the SystemFee and if is it 0, return. I think that it's better to add something to allow to detect if it's a test or a real invocation. |
Any progress of this pull request? I think some contract invocation are blocked because of this change |
I think that it's a very specific case. We should think in another solution, for example, configure the dummy transaction in a json |
And in a real transaction, the fee has been paid. Even if an exception is thrown, the fee cannot be refunded. So it doesn't make sense to make such an assert here. |
Even after removed the assert, we still block by the default 20 gas here var receiverAmount = amountOut - totalGas - charges;
if (receiverAmount > 0)
{
SafeTransfer(GAS.Hash, me, sender, receiverAmount);
}
else
{
onNotEnough(sender, amountOut, totalGas);
} Because the 20 gas is too big, most transactions will run into "else" in pre-execution condition and get a wrong estimate system fee, when the real tx is persist, they will go into "if" and fault. |
Then I prefer Shargon‘s solution.
|
Any detailed solution? Actually, my dapp is currently stuck because of this.. |
I haven't thought of a good way yet. |
|
I agree. Then we can't set fee to |
One solution I can think of is two test executions per transaction. The first time the fee is set to |
How about the network fee? Any static value there will also be wrong. What I'd do here is merge this PR as is to solve the problem some dApps have now and create a new issue for additional discussion. The behavior was changed, this change broke some (buggy) contracts, reverting it won't affect good contracts (they don't care about fees), but will restore the old behavior and make contracts that depend on it work. Then we can try to fix contracts/create a better solution for 3.4.1. |
We can merge it first and consider #746 in the next release. |
No description provided.