Skip to content

fix: run check_timeout outside debug_assert! - #1616

Closed
feafel wants to merge 1 commit into
circlefin:mainfrom
feafel:fix/debug-assert-side-effect
Closed

feafel wants to merge 1 commit into
circlefin:mainfrom
feafel:fix/debug-assert-side-effect

Conversation

@feafel

@feafel feafel commented Nov 6, 2026

Copy link
Copy Markdown

Summary

Fixes #1610: State::check_timeout is not a pure check — it sets the PROPOSE_BIT in ScheduledTimeouts. Two call sites wrapped it in debug_assert!, which is compiled out in release builds, so the scheduled-timeout bookkeeping behaved differently in debug and release builds.

Changes

  • code/crates/core-state-machine/src/state_machine.rs: call check_timeout unconditionally and assert on its result, at both call sites (propose_valid_or_get_value and schedule_timeout_propose)

This matches the fix suggested in the issue. Running the test suite in release mode in CI would catch similar cases.

Closes #1610

🤖 Generated with Claude Code

State::check_timeout mutates the scheduled-timeout bookkeeping, so
wrapping it in debug_assert! compiled the side effect out in release
builds, leaving debug and release behavior inconsistent.

Closes circlefin#1610
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

⚠️ Unsigned Commits Detected

The following commits are missing a verified signature:

  • 0e6a9af by Frank

How to fix: Sign your commits.

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

Hi @feafel,

Thank you for your interest in contributing to Malachite.

This PR has been automatically closed because you are not assigned to issue #1610. We require contributors to be explicitly assigned to an issue before submitting a PR.

To contribute properly:

  1. Comment on issue core-state-machine: side effect inside debug_assert! — propose timeout not marked as scheduled in release builds #1610 requesting assignment
  2. Wait for maintainer approval
  3. Only submit a PR after you have been assigned

Please see our CONTRIBUTING.md for more details.

@github-actions github-actions Bot added the need-triage This issue needs to be triaged label Nov 6, 2026
@github-actions github-actions Bot closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need-triage This issue needs to be triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core-state-machine: side effect inside debug_assert! — propose timeout not marked as scheduled in release builds

1 participant