feat(settlement): emit a batch-summary event from settle_all - #321
Merged
mikewheeleer merged 1 commit intoJul 28, 2026
Merged
Conversation
settle() and settle_all() already emit a settled(agent, service_id, requests, billed) event per settlement — settle_all publishes one per service in the sweep. This adds a single settl_all(agent, count, total_billed) event after the loop, so indexers can track a full settle_all drain without summing every per-service settled event themselves. count is the number of services swept (including zero-billed ones, matching settle_all's existing "drain and stamp even when usage is zero" contract); total_billed saturates at i128::MAX like every other lifetime counter in this contract. No topic collision: settl_all (9 chars, within the symbol_short! limit) does not match any existing topic.
Contributor
|
looks good @thlpkee20-wq — well scoped and easy to review. merging 👍 |
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.
Closes #302
`settle()` and `settle_all()` already emit a
`settled(agent, service_id, requests, billed)` event per settlement —
`settle_all` publishes one per service in the sweep. This adds a single
`settl_all(agent, count, total_billed)` event after the loop, so
indexers can track a full `settle_all` drain without summing every
per-service `settled` event themselves.
matching `settle_all`'s existing "drain and stamp even when usage is
zero" contract).
counter in this contract.
limit) doesn't match any existing topic.
Test plan
pre-existing, unrelated test covered by fix(test): correct cross-call event-count assumption in ownership-transfer test #315.