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

feat: more efficient rpc queries #92

Merged
merged 1 commit into from
Jun 21, 2023
Merged

feat: more efficient rpc queries #92

merged 1 commit into from
Jun 21, 2023

Conversation

samsiegart
Copy link
Contributor

@samsiegart samsiegart commented Jun 20, 2023

refs Agoric/agoric-sdk#6870

Description

This uses the batch query client where possible, reducing rpc load by 90%+

We still need to use casting to follow wallet updates, because offer status updates are transient, so we need to watch them losslessly. However, I disabled proofs to reduce a lot of the extra queries there.

Copied the query client from dapp-inter into wallet/src/rpc because I started this already, but would like to pull that into a shared component in Agoric/ui-kit

Testing

Tested provisioning a smart wallet, doing a psm swap on ollinet

@@ -173,6 +169,7 @@ const SmartWalletConnection = ({
const followPublished = <T extends {}>(path) =>
makeFollower<T>(`:published.${path}`, leader, {
unserializer: context.fromMyWallet,
proof: 'none',
Copy link
Member

Choose a reason for hiding this comment

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

this seems reasonable for the use cases but let's develop an AttackersGuide.md for this repo to make clear what the security threats are

];
};

export const batchVstorageQuery = (
Copy link
Member

Choose a reason for hiding this comment

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

looking forward to this living in ui-kit with test coverage

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jun 20, 2023

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 44da9d0
Status: ✅  Deploy successful!
Preview URL: https://d375cfaf.wallet-app.pages.dev
Branch Preview URL: https://batch-queries.wallet-app.pages.dev

View logs

@turadg turadg mentioned this pull request Jun 20, 2023
@samsiegart samsiegart merged commit a9aee21 into main Jun 21, 2023
@samsiegart samsiegart deleted the batch-queries branch June 21, 2023 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants