Skip to content

fix(verify): clamp transient backoff exponent, floor poll_interval; release 0.8.0 - #22

Merged
SaulBuilds merged 2 commits into
mainfrom
fix/verify-backoff-clamp
Nov 9, 2026
Merged

SaulBuilds merged 2 commits into
mainfrom
fix/verify-backoff-clamp

Conversation

@SaulBuilds

Copy link
Copy Markdown
Contributor

This is the P3 from the round-2 review of #21. Two commits: the fix, then the 0.8.0 version bump. The bump is folded into this PR, as #20 did for 0.7.0.

Fix (fb692b0)

Before this change, wait_for_verification multiplied poll_interval by 2 ** (transient_errors - 1) with no limit on the exponent:

  • poll_interval=0: the delay stayed at 0, so the loop retried with no pause. Locally that was about 1000 explorer calls in 0.3 s.
  • poll_interval=0.0 and transient_backoff_max=0.0: after 1024 consecutive transient errors, 0.0 * 2**1024 raises OverflowError instead of timing out.

What changed:

Red → green

On a6063d3, the 3 new tests failed:

  • test_zero_poll_interval_and_backoff_max_still_back_off: 1023 calls where at most 65 are allowed.
  • test_zero_poll_interval_backoff_doubles_to_the_cap: 852 calls where fewer than 12 are allowed.
  • test_transient_backoff_is_finite_and_capped: the helper did not exist yet.

All 3 pass now. tests/test_verify.py goes from 37 to 40 tests. ruff check and mypy . are clean in the locked environment.

Release 0.8.0 (17c7aae)

The latest citrate-labs-sdk on PyPI is 0.7.0. Everything in Unreleased is new API: verify_contract, deploy_and_verify, deploy_contract, optional chain_id, and the backoff options. Nothing is removed or changed incompatibly, so this is a minor bump to 0.8.0. The bump touches pyproject.toml, citrate_sdk.__version__ and the editable entry in uv.lock. It also adds a dated CHANGELOG section, [0.8.0] - 2026-11-08. The README install line (pip install citrate-labs-sdk) has no version pin, so it is unchanged.

Local gates:

  • python -m build produces citrate_labs_sdk-0.8.0.tar.gz and citrate_labs_sdk-0.8.0-py3-none-any.whl.
  • twine check: PASSED.
  • Key-share wheel tripwire: PASSED (citrate_sdk 0.8.0).
  • uv lock --check: clean.
  • test_publish_metadata: 11/11.
  • Local-CI pre-push hook: all replicable checks pass.

Hold: publish only after the CitrateScan verify v2 API is live. To publish, run publish.yml from main with publish_version=0.8.0, or publish a GitHub release. This PR does not do either.

🤖 Generated with Claude Code

https://claude.ai/code/session_01FPJzHN7kVR6UzVEJDEY9Yc

SaulBuilds and others added 2 commits November 8, 2026 18:59
wait_for_verification doubled poll_interval per consecutive transient
error with an unbounded exponent. With poll_interval=0 the delay stayed
0 (a tight retry loop: ~1000 explorer calls in 0.3 s locally), and with
poll_interval=0.0 and transient_backoff_max=0.0, 0.0 * 2**1024 raises
OverflowError after 1024 errors instead of timing out.

transient_backoff() clamps the exponent at 30 and poll_interval is
floored at MIN_POLL_INTERVAL (5 ms), matching @citratelabs/sdk.

Red first: 3 new tests failed on a6063d3 (1023 and 852 calls where
<= 65 / < 12 are allowed; transient_backoff missing); all pass now.

Signed-off-by: Larry Klosowski <larryklosowski@proton.me>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPJzHN7kVR6UzVEJDEY9Yc
Minor: verify_contract / deploy_and_verify / deploy_contract are new
API (chain_id optional), nothing removed or changed incompatibly. 0.7.0
is the latest release of citrate-labs-sdk on PyPI. Bumps pyproject.toml,
citrate_sdk.__version__ and the uv.lock editable entry; CHANGELOG 0.8.0
section dated 2026-11-08. Publish only once the CitrateScan verify v2
API is live.

Local gates: python -m build -> citrate_labs_sdk-0.8.0 sdist + wheel,
twine check PASSED, keyshare wheel tripwire PASSED (citrate_sdk 0.8.0),
uv lock --check clean, test_publish_metadata 11/11.

Signed-off-by: Larry Klosowski <larryklosowski@proton.me>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FPJzHN7kVR6UzVEJDEY9Yc
@SaulBuilds
SaulBuilds requested a review from a team as a code owner November 9, 2026 03:03

@BerryManifold BerryManifold left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Automated Codex static review of 17c7aae7b862de9f99a8bd3746242d2ac4b58d77 is complete. Result: clean; 0 finding(s). Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.

@Matr0xshka Matr0xshka left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated Codex static review of 17c7aae7b862de9f99a8bd3746242d2ac4b58d77 is complete. Result: clean; 0 finding(s). Details and coverage limits are recorded in the project's private review log. No tests were executed by this reviewer. Both account submissions represent the same Codex review, not independent reviews.

@Matr0xshka Matr0xshka left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

MAC independent reviewer agent, not Codex, not DGX, not a human reviewer.
Reviewed 17c7aae. No P1. Python 3.12: 913 passed, 8 skipped (economics simulation deselected); ruff and mypy clean. The 0.8.0 sdist and wheel pass twine check. The public API compared with PyPI 0.7.0 has additions only. Revert check: the zero-interval tests fail when the fix is reverted. P3: in-flight request not cut at the deadline (JS parity).

@SaulBuilds
SaulBuilds merged commit 82eaa0b into main Nov 9, 2026
10 checks passed
@SaulBuilds
SaulBuilds deleted the fix/verify-backoff-clamp branch November 9, 2026 06:42
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.

3 participants