-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: cost tracking #146
feat: cost tracking #146
Conversation
Co-authored-by: Ahmed Sagdati <[email protected]>
@rymnc let me know if this will work on the core side. Regarding the fields Instead of requesting the n last bundles I've went with a different approach where you tell us up until which height you have data and the committer respond with whatever came after. |
hmm, we could track cc'ing: @MitchTurner @xgreenx |
@MujkicA On a connected note, it sounds like you aren't making any guarantees to the decompression guys about the order in which the blocks are recorded. I'm not sure what our conversation was before, but I think it might (with some small modifications) be fine for us to receive things out of order... however, that complicates what we query for. |
@MitchTurner Note that both of these scenarios are edge-cases and since bundles usually consist of multiple fragments they're even less likely to be finalised out of order. The api will only report the cost for a block range if the corresponding bundle was marked as finalized (meaning all transactions carrying it's fragments have settled). I guess this doesn't absolve you from having to implement support for it but i maybe the details have some relevance to you. Alternatively, we could only report back costs up until we have a contiguous range. This would cause a delay in reporting more recent costs in those edge cases so it's up to you. At any rate, I'll deploy whatever version you prefer to the test networks so that we can test the integration. |
I'd rather receive them ASAP than in order. |
Clippy seems to be complaining about something 👀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it doesn't compile, some merge broke it? @MujkicA ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work
Closes #110
This PR introduces cost tracking and retrieval of bundle cost information through the api.
Implementation
The cost contributions of each transaction belonging to a bundle are incrementally accumulated each time a transaction is finalized. This is done to avoid computing the total cost of transactions on every api call and avoid inefficient response times.
Response Object
Method
Endpoint
GET /v1/costs?from_block_height=<HEIGHT>&limit=<LIMIT>