fix: audit findings batch — TTL, blocked status, execution/metrics/docs (8 issues) - #1222
Merged
Maki-Zeninn merged 3 commits intoAug 29, 2026
Conversation
…event - Maki-Zeninn#1201: set_role_limits silently rewrote a 0 cap to the compile-time defaults, making a full role-system lockdown inexpressible (the enforcement paths already honor a real zero via >=). Store both caps as-is and update the doc comment: 0 now means lockdown. - Maki-Zeninn#1202: set_role_limits was the only state-changing admin function that never emitted an event (router-common had no EVENT_ROLE_LIMITS_SET at all). Publish role_limits_set with (caller, max_roles, max_grants_per_role) so indexers and dashboards can track config changes. Fixes Maki-Zeninn#1201 Fixes Maki-Zeninn#1202
…ns as Queued - Maki-Zeninn#1205: the timelock never called extend_instance_ttl, so its instance entries (Admin, MinDelay, MaxPendingOps, every queued Op and Deps list) would eventually be archived from inactivity, bricking the contract. Adds the same TTL constants and per-entry-point extension used by router-core/router-execution, covering all seventeen entry points. - Maki-Zeninn#1206: get_operation_status (and the Ready branches of get_operation_count_by_status / get_operations_by_status) reported Ready for operations whose dependency was cancelled — execute() always fails with DependencyNotExecuted for those. Ready is now gated on require_dependencies_executed, matching what execute() actually enforces; blocked operations report Queued instead. Fixes Maki-Zeninn#1205 Fixes Maki-Zeninn#1206
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.
Fixes #1205
Fixes #1206
#1205 — instance storage TTL never extended
router-timelockcontained zero calls torouter_common::extend_instance_ttl, so its instance entries (Admin,MinDelay,MaxPendingOps, every queuedOp, everyDepslist) would eventually be archived from inactivity — bricking the timelock (queue/execute of governance operations included) until a manual restore.Adds the same
INSTANCE_TTL_THRESHOLD/INSTANCE_TTL_EXTEND_TOconstants used byrouter-core/router-executionand callsextend_instance_ttlnear the top of all seventeen entry points (mutators and getters), matching the established pattern.#1206 — Ready reported for permanently blocked operations
get_operation_status,get_operation_count_by_status, andget_operations_by_statuscomputed Ready purely from the operation's own eta/grace/executed/cancelled fields. An operation whose dependency was cancelled can never passrequire_dependencies_executed, yet all three functions reported it asReadyonce past eta — dashboards/automation would attempt (and always fail) execution.The
Readybranches now gate onrequire_dependencies_executed(...).is_ok(), matching whatexecute()enforces; blocked operations reportQueuedinstead (the conservative option — no enum change). The same gate is applied consistently across all three status-query functions.Verification
Both changes are pattern-matched against
router-core/router-execution(same helper, same constants, same placement). Rust toolchain not available in this environment — compile check will run in CI. No behavioral change for operations without dependencies.Fixes #1205, Fixes #1206.