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

Break down approx hint search into multiple smaller calls #94

Merged
merged 3 commits into from
Nov 17, 2020

Conversation

danielattilasimon
Copy link
Collaborator

When the number of troves is huge, we might need more trials than
possible on a provider like Infura (~4900 max trials) to get a
good quality approx hint.

Modify getApproxHint to make the search resumable, and do it in
multiple rounds.

Fixes #2.

@danielattilasimon
Copy link
Collaborator Author

danielattilasimon commented Nov 13, 2020

Still need to update tests and write new tests that exercise the new middleware code (somehow).

When the number of troves is huge, we might need more trials than
possible on a provider like Infura (~4900 max trials) to get a
good quality approx hint.

Modify getApproxHint to make the search resumable, and do it in
multiple rounds.

Fixes #2.
Use chai-spies to substitute the real contracts, since it takes too
long to create a million Troves for testing.
@danielattilasimon danielattilasimon requested review from RickGriff and bingen and removed request for RickGriff and bingen November 17, 2020 05:12
@danielattilasimon danielattilasimon changed the title WIP: Break down approx hint search into multiple smaller calls Break down approx hint search into multiple smaller calls Nov 17, 2020
@danielattilasimon danielattilasimon self-assigned this Nov 17, 2020
Copy link
Collaborator

@RickGriff RickGriff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Copy link
Collaborator

@bingen bingen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -5,6 +5,8 @@ const th = testHelpers.TestHelper
const dec = th.dec
const moneyVals = testHelpers.MoneyValues

let latestRandomSeed = 31337
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😂

@danielattilasimon danielattilasimon merged commit 0ca240e into main Nov 17, 2020
@danielattilasimon danielattilasimon deleted the find_hints_when_many_troves branch November 17, 2020 23:25
@github-actions
Copy link

🎉 This PR is included in version @liquity/lib-ethers-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make getApproxHint scalable
3 participants