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

refactor: Vaults get price updates continuously #7351

Merged
merged 1 commit into from
Apr 8, 2023

Conversation

Chris-Hibbert
Copy link
Contributor

closes: #6946

Description

VaultManagers were already channeling a subscription to the priceAuthority in order to store it off chain. This uses that feed instead of requesting a fresh price when needed.

Security Considerations

None

Scaling Considerations

slight improvement.f

Documentation Considerations

No impact on docs.

Testing Considerations

updated existing tests.

@Chris-Hibbert Chris-Hibbert added Inter-protocol Overarching Inter Protocol Vaults VaultFactor (née Treasury) labels Apr 6, 2023
@Chris-Hibbert Chris-Hibbert added this to the Vaults EVP milestone Apr 6, 2023
@Chris-Hibbert Chris-Hibbert self-assigned this Apr 6, 2023
@Chris-Hibbert Chris-Hibbert requested a review from turadg April 7, 2023 00:24
Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

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

A good improvement but requesting we resolve observeNotifier problems before landing

@@ -23,7 +23,7 @@ const { quote: q, Fail } = assert;

const { StorageNodeShape } = makeTypeGuards(M);

const trace = makeTracer('IV', false);
const trace = makeTracer('Vault', false);
Copy link
Member

Choose a reason for hiding this comment

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

fwiw this was for InnerVault but this change lgtm

E(storageNode).makeChildNode('quotes'),
marshaller,
);
let storedCollateralQuote;
observeNotifier(quoteNotifier, {
Copy link
Member

Choose a reason for hiding this comment

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

This observeNotifier will fail upgrade. #6791 the ticket to make this contract upgradable, so this PR doesn't have to be upgradable but we should at least have a sketch of how this will be upgraded.

Also it will consume heap so I want to hear from @mhofman on whether landing this would complicate his research.

Copy link
Member

Choose a reason for hiding this comment

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

Would this result a per-vault heap object? Or does this happen only after some trigger for a vault?

We should definitely hunt down any patterns that result in high cardinality heap objects.

Copy link
Member

Choose a reason for hiding this comment

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

Per-manager heap object. There are order 10 managers.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds like we don't need to worry about the heap usage. The upgrade aspect I'll taclke in #6791.

If you do another push, consider moving this observeNotifier call to finish() with the other one.

E(storageNode).makeChildNode('quotes'),
marshaller,
);
let storedCollateralQuote;
observeNotifier(quoteNotifier, {
Copy link
Member

Choose a reason for hiding this comment

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

Sounds like we don't need to worry about the heap usage. The upgrade aspect I'll taclke in #6791.

If you do another push, consider moving this observeNotifier call to finish() with the other one.

@Chris-Hibbert Chris-Hibbert added the automerge:rebase Automatically rebase updates, then merge label Apr 7, 2023
closes: #6946

VaultManagers were already channeling a subscription to the
priceAuthority in order to store it off chain. This uses that feed
instead of requesting a fresh price when needed.
@Chris-Hibbert Chris-Hibbert force-pushed the 6946-vaultContinuousUpdate branch from 8ddbee4 to df6575b Compare April 7, 2023 23:56
@mergify mergify bot merged commit 0db9680 into master Apr 8, 2023
@mergify mergify bot deleted the 6946-vaultContinuousUpdate branch April 8, 2023 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:rebase Automatically rebase updates, then merge Inter-protocol Overarching Inter Protocol Vaults VaultFactor (née Treasury)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vaults subscribe to price updates continuously
3 participants