-
Notifications
You must be signed in to change notification settings - Fork 212
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
fix: virtualize vPool as a facet #4707
Conversation
export const makeSinglePool = ( | ||
zcf, | ||
pool, | ||
getProtocolFeeBP, | ||
getPoolFeeBP, | ||
feeSeat, | ||
addLiquidityActual, | ||
) => { |
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.
Why can you get rid of singlePool, but not doublePool? They wrap pool.js in similar ways.
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.
There is a cycle between pool and singlePool (aka vPool). Creating a pool creates a vPool, and they point at each other. Following dependencies starting from pool.js
I didn't encounter doublePool and so have not started thinking about how to virtualize it. What would you recommend?
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.
Not sure.
doublePool
and singlePool
are polymorphic wrappers of pool
. Each pool has a single long-lived singlePool
. doublePools
connect two pool
s, and are created on demand.
I don't think it works to move singlePool's methods into
pool`.
I don't think it's necessary for singlePool
to be part of the persistent state. It would be fine for the singlePool
to be created when the pool
is created or revived.
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.
Just to clarify, can anyone outside the vat be holding a remote reference to a singlePool
? If so, are singlePool
s potentially high cardinality?
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.
Unlike vaults, clients don't hold onto any state of the AMM between transactions. All requests go through the public (or creator) interface for every request.
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.
Excellent! Then yes, I can and should simplify this. Thanks.
export const makeSinglePool = ( | ||
zcf, | ||
pool, | ||
getProtocolFeeBP, | ||
getPoolFeeBP, | ||
feeSeat, | ||
addLiquidityActual, | ||
) => { |
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.
Not sure.
doublePool
and singlePool
are polymorphic wrappers of pool
. Each pool has a single long-lived singlePool
. doublePools
connect two pool
s, and are created on demand.
I don't think it works to move singlePool's methods into
pool`.
I don't think it's necessary for singlePool
to be part of the persistent state. It would be fine for the singlePool
to be created when the pool
is created or revived.
1592e43
to
2cfe4a3
Compare
55b8df3
to
aa07f79
Compare
a4fb604
to
a68c837
Compare
@erights could you rebase this and force-push a new version? It looks like this branch includes slightly different forms of the ERTP virtualization that already landed. I did a trial rebasing locally and the only remaining change were in |
aa07f79
to
8bdf6f4
Compare
Done. But, given @Chris-Hibbert 's comments at #4707 (comment) I'm putting this back into draft status. Instead, it seems #4706 is closer to what we want, so I'm declaring #4706 Ready to Review. Everyone, please review that one instead. |
@FUDCo @warner Please look at https://github.com/Agoric/agoric-sdk/runs/5654712229?check_suite_focus=true
which looks like a GC bug. |
This has to be some kind of merge error in the rebase. Don't know what it is, but something got lost in translation. |
Done in #5187 |
Virtualize vPool as a facet
Staged on #4706
Compare with #4630 , which never worked