Skip to content

set chunk size to 2000 for events#61

Merged
dmytrotkk merged 1 commit into
developfrom
set-chunk-size
May 5, 2026
Merged

set chunk size to 2000 for events#61
dmytrotkk merged 1 commit into
developfrom
set-chunk-size

Conversation

@dmytrotkk

Copy link
Copy Markdown
Contributor

This pull request introduces a new configuration option to control the size of block ranges used when querying event logs, and updates the codebase to use this new setting. This change allows for more flexible and efficient event fetching by making the chunk size configurable.

Configuration improvements:

  • Added a new events_chunk_size option to the [agent] section in config.toml.example to specify the block range size for event log queries.
  • Updated the Agent model in configs.py to include the new events_chunk_size configuration with a default value of 2000.

Event fetching logic update:

  • Modified the distribute_credits_for_source function in main.py to pass the configurable chunk_size parameter when fetching payment received events, improving control over event log query performance.

Copilot AI review requested due to automatic review settings May 5, 2026 12:37
@dmytrotkk dmytrotkk requested a review from DimaStebaev as a code owner May 5, 2026 12:37
@dmytrotkk dmytrotkk self-assigned this May 5, 2026
@dmytrotkk dmytrotkk linked an issue May 5, 2026 that may be closed by this pull request
@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.84%. Comparing base (b1d3cf5) to head (01b66c0).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #61   +/-   ##
========================================
  Coverage    84.84%   84.84%           
========================================
  Files            5        5           
  Lines           99       99           
  Branches        17       26    +9     
========================================
  Hits            84       84           
  Misses          15       15           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR makes the credit-distributor’s event log fetch window configurable, so the agent can tune how many blocks it scans per RPC query when reading PaymentReceived events from source CreditStation contracts.

Changes:

  • Added agent.events_chunk_size to the distributor config model with a default of 2000.
  • Documented the new option in config.toml.example.
  • Wired the configured chunk size into distribute_credits_for_source() when fetching payment events.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
credit-distributor/src/main.py Passes the configured chunk size into payment event retrieval.
credit-distributor/src/configs.py Adds the new agent config field and default value.
credit-distributor/config.toml.example Documents the new optional events_chunk_size setting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread credit-distributor/src/main.py
@dmytrotkk dmytrotkk merged commit ecbcb4a into develop May 5, 2026
10 of 11 checks passed
@dmytrotkk dmytrotkk deleted the set-chunk-size branch May 5, 2026 13:56
@github-actions github-actions Bot locked and limited conversation to collaborators May 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable customizable CREDIT amounts per purchase

3 participants