Skip to content

Conversation

@niran
Copy link

@niran niran commented Dec 2, 2025

  • Add execution time limits to resource metering that cap the total execution time per block/batch
  • Add metrics and logging when transactions are excluded due to execution time limits
  • Add --builder.enforce-resource-metering flag to control whether limits are enforced or just observed

niran added 14 commits December 1, 2025 13:42
Bundle Base-specific execution state into dedicated types in base/execution.rs
to reduce inline modifications to upstream-mirrored files. The upstream
is_tx_over_limits() signature is preserved (with one additional parameter for
DA footprint override), and Base-specific limit checking is added after the
upstream check via is_tx_over_base_limits().
Extract execution time limit tracking into separate types in the
base/ module to minimize diffs against upstream:
- BaseBuilderCtx: block-level execution time limit
- BaseFlashblocksCtx: per-batch execution time tracking
- BaseExecutionState: cumulative execution time state

This keeps modifications to existing files minimal and additive.
Avoids needing to re-export FlashblocksConfig from the private
flashblocks module by having new() accept the computed value directly.
Add BaseMetrics to track when transactions are excluded due to
execution time limits. Metrics include tx execution time, remaining
budget, exceeded amount, tx gas, and remaining gas at the point of
rejection. Also logs tx_hash with each rejection warning.
When false (default), transactions that exceed execution time limits
are logged and metrics recorded, but not rejected. Only the first
transaction to exceed the limit triggers logging/metrics.

When true, transactions exceeding limits are marked invalid and
excluded from the block.
Also fix tests to set enforce_resource_metering=true for tests that
expect transactions to be rejected due to execution time limits.
Add tests verifying that when enforce_resource_metering=false,
transactions exceeding execution time limits are still included
(for both standard and flashblocks builders).
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.

3 participants