-
Notifications
You must be signed in to change notification settings - Fork 208
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
Allow multiple redemptions per epoch #1009
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!
waiting to approve until the unit test is in here
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.
Looking good! Added one question. Waiting until integration and unit tests to approve.
Just pushed up a unit test. I also tested manually and it worked as expected I think adding this to our long standing integrations tests is actually not as straightforward as it seems. But imo, I think the unit test is sufficient coverage |
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.
One other issue - the record is key'd by just stride address. So if someone redeems twice with the same stride address, but a different receiver address, the second address will get ignored
I think this leaves us with the original attack vector.
First solution that comes to mind is the change the URR key, but that will require a painful migration. Curious if you guy can think of a better solution
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.
Looks great to me! We should add integration tests on top of the unit test, then I'm all signed off 🙂
Happy to add the integration tests too if that would be helpful!
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed if no further activity occurs. Thank you! |
Co-authored-by: riley-stride <104941670+riley-stride@users.noreply.github.com>
@sampocs is this unittest sufficient, or should I add more?
I think where we landed was to replace the sender address with the receiver - @sampocs did you happen to take notes on that call? |
Imo, it's sufficient - was there something else you thought should be included though?
Yeah we landed on replacing sender with receiver. This is done in #1035 Notes from that call are at the bottom of the PFM + Autopilot doc and are in the upgrade channel. |
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!
Context and purpose of the change
Currently, and address can only redeem once per epoch. This was simpler to implement, but multiple redemptions per epoch are required to add redemptions to autopilot.
Brief Changelog
UserRedemptionRecord
(instead of creating a new one)UserRedemptionRecord
ID to theHostZoneUnbonding
The rest of the logic should work without being changed, but please review this carefully and think about potential ways it could break.
TODOs