-
Notifications
You must be signed in to change notification settings - Fork 229
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
Use a single atomicRearrange for liquidityPool repay #11059
base: master
Are you sure you want to change the base?
Conversation
79403f6
to
abe4a95
Compare
Deploying agoric-sdk with
|
Latest commit: |
6973a09
|
Status: | ✅ Deploy successful! |
Preview URL: | https://b581cbf3.agoric-sdk.pages.dev |
Branch Preview URL: | https://cth-atomicrepay.agoric-sdk.pages.dev |
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.
a few notes
[fromSeat, feeSeat, { ContractFee }, { USDC: ContractFee }], | ||
]), | ||
); | ||
zcf.atomicRearrange([ |
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.
I could swear zcf throws when this harden(...)
is missing. But maybe only the individual parts need to be hardened?
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.
done.
Do you believe that even though tests all passed?
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.
I think fast-usdc.contract.test.ts
is sufficiently high fidelity that if the tests pass, the code would work on chain without harden(...)
.
const actual = repayCalc( | ||
shareWorth, | ||
fromSeatAllocation, | ||
amounts, | ||
encumberedBalance, | ||
poolStats, | ||
); | ||
const actual = repayCalc(shareWorth, amounts, encumberedBalance, poolStats); |
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.
getting these all on one line makes me happy 🥇
Description
Repaying the liquidity pool was being done with two sequential calls to
zcf.atomicRearrange()
. This refactors so that each of the calls onrepay()
includes a TransferPart to indicate the source of the funds. There was no need to rearrange the funds into matching keywords with a separate rearrange.Security Considerations
None.
Scaling Considerations
None
Documentation Considerations
Could we have done a better job of explaining
atomicRearrange()
?Testing Considerations
Cleaned up existing tests.
settler.test.js
does extensive tracing, and records and verifies many calls, so this had to be updated, since a call toatomicRearrange
was dropped, and the signature ofrepay()
changed.Upgrade Considerations
There is no urgency to getting this change onto master. The behavior should be interchangeable for all successful transactions.