Skip to content

chore: remove reallocate step and add continuous RAV collection for long lived allocation#1181

Open
Maikol wants to merge 3 commits intomain-dipsfrom
feat/dips-continuous-collection
Open

chore: remove reallocate step and add continuous RAV collection for long lived allocation#1181
Maikol wants to merge 3 commits intomain-dipsfrom
feat/dips-continuous-collection

Conversation

@Maikol
Copy link
Copy Markdown
Member

@Maikol Maikol commented Mar 17, 2026

No description provided.

@github-project-automation github-project-automation bot moved this to 🗃️ Inbox in Indexer Mar 17, 2026
@Maikol Maikol changed the title chore: remove reallocate step and add continuous RAV collection for l… chore: remove reallocate step and add continuous RAV collection for long lived allocation Mar 17, 2026
Base automatically changed from feat/dips-on-chain-accept to feat/dips-pending-rca-consumer April 10, 2026 12:45
Base automatically changed from feat/dips-pending-rca-consumer to feat/dips-support April 10, 2026 13:12
Base automatically changed from feat/dips-support to main-dips April 10, 2026 13:21
@Maikol Maikol force-pushed the feat/dips-continuous-collection branch from 52f343d to e559039 Compare April 10, 2026 13:23
private epochSubgraph: SubgraphClient,
) {}

async hasActiveDipsAgreement(allocationId: string): Promise<boolean> {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I ran this query against network sub and got Type 'Query' has no field 'indexingAgreements' just making a note here, although likely doesnt matter anyway as we have the other subgraph. The note here is more for incase this doesnt get looked at again later.

{ allocationId: allocationId.toLowerCase() },
)
return (result.data?.indexingAgreements?.length ?? 0) > 0
} catch {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggestion: After fixing the above query, we could change catch { return false } to catch { return true } and log a warning so the failure is observable.

At the moment if the error path is hit because the query doesnt work, then we can't determine agreement status, but the unallocate action goes through anyway.

private async pendingRAVs(): Promise<ReceiptAggregateVoucherV2[]> {
return await this.models.receiptAggregateVouchersV2.findAll({
where: { last: true, final: false },
where: { final: false },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Dropping last: true also pulls in old RAVs that dont need to be collected since their value is already included in the latest RAV.

Suggested: { last: true, final: false }

markRavsAsFinal requires last = TRUE, so old RAVs can't be archived.


return await this.models.receiptAggregateVouchersV2.findAll({
where: { redeemedAt: null, final: false, last: true },
where: { final: false },
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same as above


if (isActive) {
// Active allocation: update cooldown, don't mark as redeemed
this.lastCollectedAt.set(rav.rav.collectionId.toLowerCase(), Date.now())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: lastCollectedAt entries are added for active allocations, but never removed when the allocation closes.

@github-project-automation github-project-automation bot moved this from 🗃️ Inbox to ✅ Approved in Indexer Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: ✅ Approved

Development

Successfully merging this pull request may close these issues.

2 participants