fix: dedup target deposits returned from status api#780
Merged
Conversation
b674076 to
2d2f01c
Compare
aloknerurkar
reviewed
Sep 9, 2025
| blockNum uint64 | ||
| index uint | ||
| }) | ||
| for iterator.Next() { |
Collaborator
There was a problem hiding this comment.
I am not clear why we have to go through all the events here. Can you refresh my memory a bit.
Contributor
Author
There was a problem hiding this comment.
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
2d2f01c to
4268cd2
Compare
4268cd2 to
d2636d2
Compare
d2636d2 to
fdb7663
Compare
aloknerurkar
approved these changes
Sep 25, 2025
rose2221
pushed a commit
that referenced
this pull request
Sep 29, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously the
deposit_manager_statusendpoint 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.