-
Notifications
You must be signed in to change notification settings - Fork 112
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
Proper error handling in EtherRouter #129
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elenadimitrova
force-pushed
the
maintenance/proper-exception-handling
branch
2 times, most recently
from
December 11, 2017 19:57
c1e2882
to
9684056
Compare
elenadimitrova
force-pushed
the
maintenance/proper-exception-handling
branch
2 times, most recently
from
December 11, 2017 22:22
d897c87
to
415ef53
Compare
to check the delegate call is successful
As failures don't consume all gas and so we don't test for it
elenadimitrova
force-pushed
the
maintenance/proper-exception-handling
branch
from
December 12, 2017 09:24
415ef53
to
26b1bfb
Compare
elenadimitrova
force-pushed
the
maintenance/proper-exception-handling
branch
13 times, most recently
from
December 12, 2017 16:06
cca59ad
to
dd171cf
Compare
elenadimitrova
force-pushed
the
maintenance/proper-exception-handling
branch
3 times, most recently
from
December 12, 2017 16:50
f7749e1
to
ccab8a8
Compare
elenadimitrova
force-pushed
the
maintenance/proper-exception-handling
branch
from
December 12, 2017 17:02
ccab8a8
to
3cdd8d4
Compare
elenadimitrova
force-pushed
the
maintenance/proper-exception-handling
branch
from
December 13, 2017 15:12
2caf0b0
to
7cd9eb4
Compare
elenadimitrova
force-pushed
the
maintenance/proper-exception-handling
branch
from
December 13, 2017 15:33
7cd9eb4
to
dbae55b
Compare
area
approved these changes
Dec 13, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since
delegatecall
s return a value indicates success or failure of the call, we use anassert
inEtherRouter
to check that. Since the introduction or the different validators:assert
,require
andrevert
however calls that fail the gas-efficientrevert
in contracts still consume all gas because of theEtherRouter
assert
check.Here we've switched that
assert
to arequire
which eliminates this problem returning the unspent gas in failedrequire
s and consuming all the gas still in failedasserts
down the call chain fromEtherRouter
.When using
EtherRouter
and further down the chain anassert
fails, not all sent gas is spent in the overall transaction, but ~73000
gas less than the total.Further we improve and simplify test checks for errors in two:
checkErrorAssert
andcheckErrorRevert
where both check0
(for failure)testrpc
we ensure the return error message is arevert
(fromEtherRouter
)checkErrorAssert
to differentiate fromcheckErrorRevert
Note that an upgrade of the
parity
client was required due to a fix there for openethereum/parity-ethereum#6920This takes us to Beta version 1.8.3
This PR also enables the test suite to be run under
parity
by adding a check intestHelperer.forwardTime
function that skips any tests that calls it, since this is not yet implemented inparity