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

Use raw queries when / if possible #41

Open
maurolacy opened this issue Aug 12, 2024 · 0 comments
Open

Use raw queries when / if possible #41

maurolacy opened this issue Aug 12, 2024 · 0 comments

Comments

@maurolacy
Copy link
Collaborator

maurolacy commented Aug 12, 2024

Raw queries are much cheaper than smart queries, as they access the storage directly. Every time a query returns an umodified value from the store, it could in principle be done through a raw query.

Since raw queries have their own problems (no encapsulation, become part of the public API, requires care, migrations, etc.) let's use them only when / if convenient. By example, when querying something regularly at each block, like is the case with:

  • BTC header info. Queried from the btc-staking contracts to the babylon-contract.
  • Finality Provider voting power. Queried from finality-provider to the btc-staking contract.
  • FP existence / data. Queried from the finality contract to the staking contract.
  • ...
SebastianElvis added a commit that referenced this issue Aug 13, 2024
The current impl based on raw queries is broken. Created #41 to address
this in a future iteration / as a future improvement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants