Repository navigation
[#5366] Record the block-metadata gas limit's measured hook time, the conditions on registered hooks, and monitorCycleEnd's measured capacity ceilings - #102
Merged
Conversation
…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>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'sconsensus/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@devnotes onregisterandupdateExecutionOrder: the owner registers a hook only after testing it, and only a hook whose call reads state the hook touches in every block.configs.rsandAUTOMATION_REGISTRY_GAS_GUIDE.md: the extrapolated ~1,070-task ceiling is replaced with the measured ceilings formonitorCycleEndregistered as aBlockMetaentry 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 deployedBytecodeis byte-identical before and after.cargo fmt --all --check;typoson the changed files.cargo build --workspace --all-targets --all-features --locked, clippy with and withoutevm, 680 tests inexecution,evm-spec,evm-root-accountsand the CLI docs).🤖 Generated with Claude Code