Skip to content

[#5366] Record the block-metadata gas limit's measured hook time, the conditions on registered hooks, and monitorCycleEnd's measured capacity ceilings - #102

Merged
isaacdoidge merged 3 commits into
issue-5339from
issue-5366
Dec 3, 2026
Merged

isaacdoidge merged 3 commits into
issue-5339from
issue-5366

Conversation

@isaacdoidge

@isaacdoidge isaacdoidge commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Entropy-Foundation/smr-moonshot#5366. Stacked on #99 (base issue-5339). smr-moonshot PR: Entropy-Foundation/smr-moonshot#5402, which pins this branch.

What

Documentation only; BlockMeta's deployed bytecode under the production profile is unchanged.

  • DEFAULT_BLOCK_METADATA_GAS_LIMIT's doc records why the limit stays at 2^24: a registered hook that reads only state it touches in every block and spends the whole single-entry budget took at most about 0.76 s, measured with smr-moonshot's consensus/execution/benches/block_prologue_time.rs, and a 2–3 s slowdown per block while a misconfigured hook is corrected is tolerated.
  • BlockMeta.sol: a "Registered hooks" section in the contract's NatSpec, and @dev notes on register and updateExecutionOrder: the owner registers a hook only after testing it, and only a hook whose call reads state the hook touches in every block.
  • configs.rs and AUTOMATION_REGISTRY_GAS_GUIDE.md: the extrapolated ~1,070-task ceiling is replaced with the measured ceilings for monitorCycleEnd registered as a BlockMeta entry with the whole single-entry budget (16,228,524 gas): 1,056 tasks with the ordered list at the scan bound (1,057 fail) and 2,528 with only live tasks (2,529 fail). Foundry's 2,656 is for a direct call with 2^24; an entry has less, and the diamond's DELEGATECALL keeps 1/64. The guide adds the measured execution time of the cycle end at 200, 1,056 and 2,528 tasks.

Why

Review of #99 on Entropy-Foundation/smr-moonshot#5339 asked whether the limit should be configurable. Entropy-Foundation/smr-moonshot#5366 measured blockPrologue()'s execution time per workload and records the decision to keep the fixed limit.

Verification

  • FOUNDRY_PROFILE=production forge inspect BlockMeta deployedBytecode is byte-identical before and after.
  • cargo fmt --all --check; typos on the changed files.
  • The smr-moonshot PR builds and tests against this branch (cargo build --workspace --all-targets --all-features --locked, clippy with and without evm, 680 tests in execution, evm-spec, evm-root-accounts and the CLI docs).

🤖 Generated with Claude Code

isaacdoidge and others added 2 commits December 2, 2026 23:13
…ditions on registered hooks, and monitorCycleEnd's measured capacity ceilings

- DEFAULT_BLOCK_METADATA_GAS_LIMIT's doc records what a hook that spends
  the whole single-entry budget takes on mainnet-rpc-7: about 0.29 s
  when it computes or touches state it touches in every block, 0.76 s
  with the slowest precompile, 4.1 to 6.5 s when it reads state no
  recent block read; and that a 2 to 3 s slowdown per block while a
  misconfiguration is corrected is tolerated, so the limit stays 2^24.
- BlockMeta's header, register and updateExecutionOrder state the
  conditions on a registered hook: tested before registration, and its
  call reads only state the hook touches in every block. NatSpec only;
  the production deployed bytecode is unchanged.
- configs.rs and the gas guide replace the extrapolated ~1,070 with the
  measured ceilings for monitorCycleEnd as a BlockMeta entry registered
  with the whole single-entry budget: 1,056 at the scan bound and 2,528
  with only live tasks, and add its warm and cold execution times.

Entropy-Foundation/smr-moonshot#5366.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ne execution time per registry shape in the gas guide

- DEFAULT_BLOCK_METADATA_GAS_LIMIT's doc states the bound for any hook
  that reads only state it touches in every block: at most about 0.76 s
  for the whole single-entry budget, whatever operations or precompiles
  it spends the gas on.
- The gas guide keeps monitorCycleEnd's execution time after a block
  that ran the same call, and drops the second column, whose method
  reopens the store and does not model a running or restarted node.

Entropy-Foundation/smr-moonshot#5366.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@isaacdoidge
isaacdoidge added this pull request to stack #103 December 3, 2026 10:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@isaacdoidge
isaacdoidge merged commit 2b57879 into feature/revm-43-sync Dec 3, 2026
21 checks passed
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.

1 participant