Chunk the funding index maps to get for each vault subaccount to reduce the amount of rows scanned. Heights to get funding index maps for will be separated into chunks that cover 250k blocks each (number of blocks per chunk can be configured).
Updated funding index map query to limit searches to both a min and max block height.
Additional fixes:
updated function to get vault subaccounts to filter out vaults for non-existent clob pairs
Test Plan
Existing unit tests.
Author/Reviewer Checklist
[ ] If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
[ ] If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
[ ] If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
[ ] If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
[ ] If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
[ ] Manually add any of the following labels: refactor, chore, bug.
Summary by CodeRabbit
New Features
Introduced a new configuration parameter for vault settings, enhancing customization options.
Added a method for retrieving funding index maps in a chunked manner to optimize database load.
Improvements
Enhanced logging capabilities for vault operations, improving error tracking and observability.
Implemented performance measurements to monitor the duration of key operations.
Refined filtering criteria for funding index updates to ensure more accurate data retrieval.
Added a new variable to improve SQL query filtering for funding index updates.
This is an automatic backport of pull request #2525 done by Mergify.
Changelist
Chunk the funding index maps to get for each vault subaccount to reduce the amount of rows scanned. Heights to get funding index maps for will be separated into chunks that cover 250k blocks each (number of blocks per chunk can be configured). Updated funding index map query to limit searches to both a min and max block height.
Additional fixes:
Test Plan
Existing unit tests.
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.Summary by CodeRabbit
New Features
Improvements
This is an automatic backport of pull request #2525 done by Mergify.