Skip to content

fix: dedup target deposits returned from status api#780

Merged
shaspitz merged 1 commit intomainfrom
fix-dm-status
Sep 25, 2025
Merged

fix: dedup target deposits returned from status api#780
shaspitz merged 1 commit intomainfrom
fix-dm-status

Conversation

@shaspitz
Copy link
Copy Markdown
Contributor

@shaspitz shaspitz commented Sep 6, 2025

Previously the deposit_manager_status endpoint would return a target deposit object in its response for every target deposit event that had been emitted on-chain. However this is incorrect and we should be returning the current/effective/latest target deposit w.r.t each provider. This PR dedups the target deposits returned from the api.

@shaspitz shaspitz marked this pull request as ready for review September 6, 2025 01:44
blockNum uint64
index uint
})
for iterator.Next() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am not clear why we have to go through all the events here. Can you refresh my memory a bit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yea essentially we need to obtain all the target deposit events that have ever been emitted for a specific bidder's instance of the DepositManager contract. We then dedup these events and only keep track of the final/effective target deposit value for each provider. This is how we display the effective target deposits to the bidder.

We can have the bidder node continuously listening to these events. But due to #777 not yet being addressed I thought a good short term solution is just to query the events directly in this api handler

@shaspitz shaspitz merged commit b06c865 into main Sep 25, 2025
5 checks passed
@shaspitz shaspitz deleted the fix-dm-status branch September 25, 2025 19:15
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