Skip to content

fix: configurable allocation batch size, gas limit multiplier, and multicall bisection#1193

Open
cargopete wants to merge 2 commits intographprotocol:mainfrom
cargopete:feat/allocation-batch-size-gas-limit-multiplier
Open

fix: configurable allocation batch size, gas limit multiplier, and multicall bisection#1193
cargopete wants to merge 2 commits intographprotocol:mainfrom
cargopete:feat/allocation-batch-size-gas-limit-multiplier

Conversation

@cargopete
Copy link
Copy Markdown
Contributor

@cargopete cargopete commented Apr 16, 2026

Summary

  • Adds --auto-allocation-max-batch-size default of 50 (was unbounded), capping the number of allocation operations per multicall transaction. Post-Horizon SubgraphService operations cost ~500–630K gas each; the previous unbounded default causes estimateGas to revert on indexers with large allocation sets.
  • Adds --gas-limit-multiplier (env: INDEXER_AGENT_GAS_LIMIT_MULTIPLIER, default 1.5) to make the hardcoded estimateGas buffer configurable.
  • Adds automatic multicall batch bisection: if estimateGas reverts due to gas exhaustion the agent splits the batch in half and retries each half recursively, making it self-healing against block gas limit changes without requiring operator intervention. Known contract error selectors (e.g. SubgraphServiceInvalidPaymentType) are excluded from bisection and surfaced immediately.

Backwards compatibility

All defaults preserve existing behaviour. Operators currently failing due to oversized batches recover automatically on upgrade with no config change required.

@github-project-automation github-project-automation Bot moved this to 🗃️ Inbox in Indexer Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🗃️ Inbox

Development

Successfully merging this pull request may close these issues.

1 participant