Skip to content

fix: audit findings batch — TTL, blocked status, execution/metrics/docs (8 issues) - #1222

Merged
Maki-Zeninn merged 3 commits into
Maki-Zeninn:mainfrom
gebibd00-jpg:fix/timelock-ttl-and-blocked-status
Aug 29, 2026
Merged

fix: audit findings batch — TTL, blocked status, execution/metrics/docs (8 issues)#1222
Maki-Zeninn merged 3 commits into
Maki-Zeninn:mainfrom
gebibd00-jpg:fix/timelock-ttl-and-blocked-status

Conversation

@gebibd00-jpg

Copy link
Copy Markdown
Contributor

Fixes #1205
Fixes #1206

#1205 — instance storage TTL never extended

router-timelock contained zero calls to router_common::extend_instance_ttl, so its instance entries (Admin, MinDelay, MaxPendingOps, every queued Op, every Deps list) 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_TO constants used by router-core/router-execution and calls extend_instance_ttl near 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, and get_operations_by_status computed Ready purely from the operation's own eta/grace/executed/cancelled fields. An operation whose dependency was cancelled can never pass require_dependencies_executed, yet all three functions reported it as Ready once past eta — dashboards/automation would attempt (and always fail) execution.

The Ready branches now gate on require_dependencies_executed(...).is_ok(), matching what execute() enforces; blocked operations report Queued instead (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.

…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
@gebibd00-jpg gebibd00-jpg changed the title fix(router-timelock): extend instance TTL, report dependency-blocked ops as Queued fix: audit findings batch — TTL, blocked status, execution/metrics/docs (8 issues) Aug 28, 2026
@Maki-Zeninn
Maki-Zeninn merged commit dc98e9e into Maki-Zeninn:main Aug 29, 2026
8 of 14 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

2 participants