Skip to content

fix: Add gas budget tracker with configurable limits#13

Open
ledgerpilot wants to merge 2 commits intokcolbchain:mainfrom
ledgerpilot:ledgerpilot/fix-5
Open

fix: Add gas budget tracker with configurable limits#13
ledgerpilot wants to merge 2 commits intokcolbchain:mainfrom
ledgerpilot:ledgerpilot/fix-5

Conversation

@ledgerpilot
Copy link
Copy Markdown
Contributor

Closes #5

What changed

This fix introduces a GasTracker utility class to manage cumulative gas spending with hourly and daily limits, pausing operations when budgets are exhausted. The GasTracker ensures thread-safe operations and uses mockable time for robust testing. It provides methods to record gas usage, check if a transaction can be sent, and determine if the tracker is currently paused. New pytest tests are i

Files modified

  • switchboard/gas_tracker.py
  • tests/test_gas_tracker.py

Draft PR — please review before merging.

@ledgerpilot ledgerpilot marked this pull request as ready for review April 9, 2026 05:39
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.

Add gas budget tracker with configurable limits

1 participant