Skip to content
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

FutureSwap endpoints - deployment resiliency check #1355

Open
fuxingloh opened this issue Apr 18, 2022 · 0 comments
Open

FutureSwap endpoints - deployment resiliency check #1355

fuxingloh opened this issue Apr 18, 2022 · 0 comments
Labels
area/packages kind/feature New feature request triage/accepted Triage has been accepted

Comments

@fuxingloh
Copy link
Contributor

fuxingloh commented Apr 18, 2022

As part of our workflow, it includes a resiliency check before deploying a new RPC via Ocean RPC Router. We will check the performance behavior of said endpoint complexity. This includes "down to the wire" and "computational" complexity.

https://github.com/DeFiCh/jellyfish/blob/a38e7f7cf50169d3fa1f7782071da0e062e27d56/apps/whale/src/module.api/rpc.controller.ts#L19-L21

1. "listpendingfutureswaps"

This RPC sends the entire "futureswap" waiting to execute over the wire without pagination - which doesn't scale well when there is an increased amount of future swap required to send over the wire.

2. "getpendingfutureswaps"

This RPC (also described in DeFiCh/ain#1202) isn't using a performant index structure for address lookup of futureswaps. It doesn't scale well when there is an increased amount of "futureswap". Once we release future swap on ocean infrastructure, we can expect an uptake un usage which might create a unhealthy feedback loop towards the index performance.

3. "lazy reward can't be used for FutureSwap"

Unrealized lazy rewards within "futureswap" can't be automatically realized when performing future swap. See DeFiCh/ain#1194


The alternative would be for the jellyfish ecosystem to index "FutureSwap" data. However, due to the sheer complexity of "gov var" that can trigger events within the FutureSwap, the amount of work required would be significant and put an extra load on our indexers to track consensus data. Similar to "Vault", it would only make sense for us to get the data out from defid directly. Or via an event stream with a pub/sub.

/triage accepted
/area packages
/priority important-soon

@fuxingloh fuxingloh added the kind/feature New feature request label Apr 18, 2022
@defichain-bot defichain-bot added triage/accepted Triage has been accepted area/packages priority/important-soon Will be important soon labels Apr 18, 2022
@fuxingloh fuxingloh self-assigned this Jun 2, 2022
@fuxingloh fuxingloh removed the priority/important-soon Will be important soon label Sep 22, 2022
@fuxingloh fuxingloh removed their assignment Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/packages kind/feature New feature request triage/accepted Triage has been accepted
Projects
None yet
Development

No branches or pull requests

2 participants