Repository navigation
fix(verify): clamp transient backoff exponent, floor poll_interval; release 0.8.0 - #22
Conversation
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
BerryManifold
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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).
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_verificationmultipliedpoll_intervalby2 ** (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.0andtransient_backoff_max=0.0: after 1024 consecutive transient errors,0.0 * 2**1024raisesOverflowErrorinstead of timing out.What changed:
transient_backoff(poll_interval, transient_errors, transient_backoff_max)caps the exponent at 30.poll_intervalnow has a 5 ms minimum,MIN_POLL_INTERVAL. This matchesMIN_POLL_INTERVAL_MSin @citratelabs/sdk (fix(verify): DEPLOY_FAILED on revert, bounded backoff (#41); release 0.4.0 citrate-sdk-js#42).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.pygoes from 37 to 40 tests.ruff checkandmypy .are clean in the locked environment.Release 0.8.0 (17c7aae)
The latest
citrate-labs-sdkon PyPI is 0.7.0. Everything in Unreleased is new API:verify_contract,deploy_and_verify,deploy_contract, optionalchain_id, and the backoff options. Nothing is removed or changed incompatibly, so this is a minor bump to 0.8.0. The bump touchespyproject.toml,citrate_sdk.__version__and the editable entry inuv.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 buildproducescitrate_labs_sdk-0.8.0.tar.gzandcitrate_labs_sdk-0.8.0-py3-none-any.whl.twine check: PASSED.uv lock --check: clean.test_publish_metadata: 11/11.Hold: publish only after the CitrateScan verify v2 API is live. To publish, run
publish.ymlfrom main withpublish_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