-
Notifications
You must be signed in to change notification settings - Fork 678
Undocumented breaking change in update to 2.2.1 #161
Comments
@wbt Thanks for reporting this! Unfortunately, I don't believe the breaking change. I'm not quite sure how your steps worked in a prior version per the following math:
So given the reproduction steps you've provided, you do not have enough funds for that transaction. Am I missing something? Further, you say the upfront cost would be |
In semver, changes are breaking if the public interface is structurally changed in such a way as to render programs which connect to said interface inoperable. Changes which impact the output of a given method for a given input but which don't impact the structure of the method are generally considered nonbreaking. In this case we improved the accuracy of Semver also accounts for changes which are semantically breaking, which is when a method's name and structure remain the same but the meaning is changed to the point where it is now conveying a completely different idea. When this happens a major version bump is warranted. However in this case we've adjusted It's impossible for us to guarantee that logic changes won't break somebody's code, as we can't begin to account for what assumptions everyone has encoded into their own logic. If we tried doing that, literally every non-additive change would need to be a major version, and that's just not very reasonable. I'm closing this issue because there's nothing to be done. However if we do slip up in the future I do encourage you to raise issues for the sort of breaking changes I describe above. |
I do think an update to the release notes/documentation would be appropriate, describing the condition and how a user may need to fix their code so it won't break with the update. I don't think guarantees are necessary but including release notes about what has changed in the software and how users need to accommodate those changes are generally appropriate. When something is missing in those notes and this is pointed out, modifying the release notes seems appropriate. |
@seesemichaelj "the amount you don't want to send" is useful for paying gas for sending the rest. I'm also not 100% sure how the math worked out that it worked before (nor did it matter a lot as it's not production code), but if you don't believe me you can download v1.2.1, run it fresh, and include these lines in a migration file:
For Truffle.js you can use something like:
That's not the core issue here, though, which is documentation. I would still like to see the issue reopened until the documentation has been updated to let people know that this can be an issue requiring code changes to run with the updated Ganache. |
@wbt. Thanks for the test case. I've tracked down where this issue is stemming from. Just to clarify, the gasPrice specified in your In Sorry for the headache this may have caused you. I'll go ahead and update the |
This is an issue again with the next update. Allowing 180000000000000 wei was enough to cover the cost of a balance transfer after upgrading to Ganache 1.2.2, but in Ganache 1.2.3, that same code produces Error: sender doesn't have enough funds to send tx. The upfront cost is: 100001620000000000000 and the sender's account only has: 100000000000000000000 Can I propose a new rule that any changes affecting gas cost calculation, up or down, be documented as a breaking change, in notes and semver? |
Adjustments to gas costs are bug fixes, and our current position is that bug fixes are not breaking changes. Do you call With that said, the above error you are describing sounds like a bug unrelated to gas estimation; do you mind opening a new issue with some details about the transaction itself as well as any transaction made prior to the failing transaction? |
Yes, I do have a strong position on it and would like to discuss further. A breaking change is when something that used to work, no longer works. If it is possible to get it working again, doing so requires some change to other application code that uses the same base technology. If I run code fully successfully with a dependency at 1.2.2, and update the dependency to 1.2.3 with no other changes, I expect the code to continue to run successfully as it did before. When it doesn't, I think there's been an error in semantic versioning. When the release notes for the new version contain no documentation saying that something changed which I might be able to guess could cause that outcome from updating, but the update does in fact change behavior not mentioned anywhere in the release notes that causes something previously working to no longer work, I think both the release notes documentation AND the semantic versioning are broken. I also generally stop updating as frequently as I otherwise might because I can no longer trust the release notes to inform me if what used to work is going to stop working. In the cases where this is observed, I am starting with a freshly restarted Ganache, and use
In the very next transaction, I attempt to transfer |
From the original point 5 of this post, I think its author would agree. Two weeks ago, I thought that made sense, and based on experience in this Issue I'd have thought only increases in gas costs could be breaking changes. However, following the experience with Constantinople around a gas cost decrease, which turned out to be a very serious issue, I think it would be a fair new rule to label any gas cost adjustments as breaking changes. |
Prompted by the interface, I recently updated Ganache from v1.2.1 to v1.2.2 "Bug Fixes" which I thought would be a minor update fixing some bugs that I may not have even yet encountered.
Expected Behavior
I expected that my code would continue working as it did in v1.2.1. I expected the only notable changes to be those described in the release notes (maybe some performance improvement, new "clear logs" button, better UI in small windows) and even clicking through to the ganache-core 2.2.1 release notes I did not see anything that seemed likely to interfere with the function of my code.
Current Behavior
After upgrade, a transaction that sends most of an account's value reports Error: sender doesn't have enough funds to send tx. Since I had a script with a transaction like this, it breaks the script.
Steps to Reproduce (for bugs)
FORMER/EXPECTED RESULT: Transfer succeeds.
ACTUAL RESULT:
Error: sender doesn't have enough funds to send tx. The upfront cost is: 100000179999999900000 and the sender's account only has: 100000000000000000000
Possible Solution
If the transfer should not have worked before, the documentation change is more appropriate.
Generally changes that break code and require adaptation in order to integrate should be documented so that people have a better idea what to expect when upgrading. Such changes should maybe get a more significant version number updated instead of the patch field at the end.
Your Environment
Misc
I previously thought this was related to #156 ("Add tests for gas estimate for simple value transfer between accounts") and reported it there. After some discussion I see this as a separately tracked Issue. Adding tests still seems like a good idea, including tests to prevent recurrence of this Issue.
The text was updated successfully, but these errors were encountered: