-
Notifications
You must be signed in to change notification settings - Fork 63
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
ife stop eating wrong side bond #585
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, leaving two comments, but deferring the final review to others, if there aren't any surprises here.
{ | ||
for (uint16 i = 0; i < PaymentTransactionModel.MAX_INPUT_NUM(); i++) { | ||
PaymentExitDataModel.WithdrawData memory withdrawal = exit.inputs[i]; | ||
if (token == withdrawal.token && exit.isInputPiggybacked(i)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be up to the wording (and possibly require a clarifying comment), but I'm assuming here that invalid and challenged piggybacks won't return the bond, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for pointing this out. I just double checked the challenge piggyback code. So if it challenged, it would return the bond immediately and delete the piggyback flag. So this implementation is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I definitely have the wrong impression in my mind when making the code change....I thought challenge piggyback would end up changing the piggyback bond owner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, maybe consider leaving a comment about challenged piggybacks - that this is taken care of b/c isInputPiggybacked
returns false
.
@@ -464,6 +465,14 @@ contract('PaymentProcessInFlightExit', ([_, ifeBondOwner, inputOwner1, inputOwne | |||
expect(postBalance).to.be.bignumber.equal(expectedBalance); | |||
}); | |||
|
|||
it('should return piggyback bond to the output owner', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there testing that a challenged invalid piggyback doesn't return the bond? Also are both canonicity-cases covered in here?
This commit change the behavior to be returning piggyback bond no matter it is on the right side of canoncity or not. issue: #584
9b0d5b9
to
15dffd9
Compare
plasma_framework/contracts/src/exits/payment/controllers/PaymentProcessInFlightExit.sol
Outdated
Show resolved
Hide resolved
plasma_framework/contracts/src/exits/payment/controllers/PaymentProcessInFlightExit.sol
Outdated
Show resolved
Hide resolved
by PR review suggestion Co-Authored-By: Kevin Sullivan <[email protected]>
Also format the README file a bit.
- run `npm version patch -m` - update changelog
for PR review Co-Authored-By: Kevin Sullivan <[email protected]>
plasma_framework/contracts/src/exits/payment/controllers/PaymentProcessInFlightExit.sol
Outdated
Show resolved
Hide resolved
Although the inputs and outputs storage is defined to be exactly the max size of payment tx inputs/outputs. However, using the length itself makes the code more self explaining.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Note