Skip to content

Show scheduled enactment for approved tech referenda - #140

Open
n13 wants to merge 2 commits into
mainfrom
show-approved-referenda-enactment
Open

Show scheduled enactment for approved tech referenda#140
n13 wants to merge 2 commits into
mainfrom
show-approved-referenda-enactment

Conversation

@n13

@n13 n13 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

quantus tech-referenda status already printed phase and enactment estimates for ongoing referenda (#132 / #133), but Approved still only said "check the scheduler". This fills that gap.

What's new

  • Approved enactment block: look up Scheduler::Lookup for the pallet-referenda enactment task (blake2_256(("assembly", "enactment", index))) and print the actual scheduled block + ETA
  • Already executed: if the task is no longer in the scheduler, say so instead of guessing
  • Past-block UTC time: format_block_eta now includes an absolute UTC timestamp for blocks in the past, matching the future-block format (e.g. block 797055 (~46min ago, ≈ 2026-08-10 12:21 UTC))

Related older work that this is not a duplicate of:

Tests

  • enactment_task_name_matches_pallet_referenda_formula
  • format_block_eta_includes_absolute_time_for_past_and_future

Approved status used to print the approval block and tell the user to
check the scheduler. Look up Scheduler::Lookup for the pallet-referenda
enactment task so status prints the actual enactment block and ETA, or
that it already executed. Also include an absolute UTC time for past
blocks, matching the future-block format.

@n13 n13 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST_CHANGES — the new terminal status can report a failed or cancelled enactment as executed.

Blocking finding

  • [P1] Do not infer execution from a missing scheduler lookup (src/cli/tech_referenda.rs:960): Scheduler::Lookup is removed for every terminal scheduler outcome, not only successful dispatch. The runtime metadata includes Canceled, CallUnavailable, and PermanentlyOverweight, and a Dispatched event can itself contain an error, while the referendum record remains Approved. In each of those cases this None arm tells the operator already executed, even when the approved call was never enacted. Please either resolve the matching scheduler outcome/result from events or use neutral wording such as no longer scheduled; execution outcome unavailable.

Validation

  • cargo +nightly fmt --all -- --check — passed
  • SKIP_CIRCUIT_BUILD=1 cargo test --locked tech_referenda::tests — passed (4 library + 4 binary tests)
  • SKIP_CIRCUIT_BUILD=1 cargo clippy --all-targets --locked -- -D warnings — passed
  • All six GitHub CI jobs are green at 8288db768e018e54ca2035bfb11aba141caef07e

The task-name formula and pending-enactment lookup otherwise match the chain implementation.

…scheduled

A missing Scheduler::Lookup entry does not imply successful dispatch —
the lookup is also removed for Canceled, CallUnavailable, and
PermanentlyOverweight outcomes. Report the outcome as unavailable
instead of claiming the enactment was already executed.

Addresses review on #140

@n13 n13 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE — the prior scheduler-outcome blocker is resolved and no blocking findings remain.

The new head replaces the unsupported already executed inference with the accurate neutral status no longer scheduled; execution outcome unavailable. I rechecked the complete base-to-head diff: the enactment task-name derivation matches pallet-referenda, the pending block is read from Scheduler::Lookup at the same chain state as the referendum, and the past/future ETA formatting remains sound.

Validation

  • Reviewed intervening commit 8288db7..c97c471 and full diff f0a6432...c97c471
  • git diff --check f0a6432...c97c471 — passed
  • cargo +nightly fmt --all -- --check — passed
  • SKIP_CIRCUIT_BUILD=1 cargo test --locked tech_referenda::tests — passed (4 library + 4 binary tests)
  • All six GitHub CI jobs passed at c97c47119fa4897887a6b86ef51d47a34e044cd0

No blocking findings.

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