Summary
Trusted mining behavior diverges from the contract in three places:
- Interval mining does not produce empty blocks when no tx is pending.
- Explicit mine calls ignore the second
intervalSeconds argument.
- Interval-mining setter treats input as milliseconds and rounds, while contract defines seconds.
Why this matters
Mining cadence and timestamp progression semantics are part of the public contract and directly affect tests, replay determinism, and tooling behavior.
Normative contract
docs/specs/json-rpc-contract.md:866-868 interval mode should produce empty blocks when idle.
docs/specs/json-rpc-contract.md:876-879 explicit mine supports [count, intervalSeconds].
docs/specs/json-rpc-contract.md:749 zevm_setIntervalMining parameter is seconds.
Evidence
Interval loop exits when pool is empty:
src/rpc/node_handler.zig:1148-1150
if (self.node_runtime.pool.pendingCount() == 0) {
return;
}
Explicit mine only parses first arg (count) and ignores second arg:
src/rpc/node_handler.zig:439-443
const count = parseOptionalFirstU64(params, 1) ...
while (i < count) {
...
}
Interval setter converts provided value as milliseconds to seconds:
src/rpc/node_handler.zig:402-410
const interval_millis = parseOptionalFirstU64(params, 0) ...
const interval_seconds = @max(@as(u64, 1), (interval_millis + 999) / 1000);
Suggested scope
- Remove pending-pool gate in interval loop so empty ticks can seal empty blocks.
- Parse and apply explicit mine second arg (
intervalSeconds) for per-call timestamp stepping.
- Align interval setter units with contract seconds semantics.
- Add end-to-end tests for:
- interval mode empty-block production,
- multi-block explicit mine with timestamp increments,
- unit-correct interval configuration.
Summary
Trusted mining behavior diverges from the contract in three places:
intervalSecondsargument.Why this matters
Mining cadence and timestamp progression semantics are part of the public contract and directly affect tests, replay determinism, and tooling behavior.
Normative contract
docs/specs/json-rpc-contract.md:866-868interval mode should produce empty blocks when idle.docs/specs/json-rpc-contract.md:876-879explicit mine supports[count, intervalSeconds].docs/specs/json-rpc-contract.md:749zevm_setIntervalMiningparameter is seconds.Evidence
Interval loop exits when pool is empty:
src/rpc/node_handler.zig:1148-1150Explicit mine only parses first arg (
count) and ignores second arg:src/rpc/node_handler.zig:439-443Interval setter converts provided value as milliseconds to seconds:
src/rpc/node_handler.zig:402-410Suggested scope
intervalSeconds) for per-call timestamp stepping.