Skip to content

fix: resolve confirmed v0.40-dev bug-hunt findings#395

Open
MuncleUscles wants to merge 2 commits into
v0.40-devfrom
claude/new-dev-bug-hunting-10dn6v
Open

fix: resolve confirmed v0.40-dev bug-hunt findings#395
MuncleUscles wants to merge 2 commits into
v0.40-devfrom
claude/new-dev-bug-hunting-10dn6v

Conversation

@MuncleUscles

@MuncleUscles MuncleUscles commented Jul 11, 2026

Copy link
Copy Markdown
Member

What

Adds regression coverage and fixes all 13 failures from the v0.40-dev bug hunt.

The fixes cover:

  • safe contract argument parsing for floats, blank strings, and malformed byte hex
  • one-shot browser transaction labels
  • strict browser bridge JSON/address validation
  • network configuration cloning to prevent singleton mutation
  • vesting identity CID passthrough
  • preserving confirmed validator-exit success when a cosmetic epoch read fails

Address fixtures in the existing wallet-session tests were updated to valid EVM addresses so they exercise the stricter validation path correctly.

Validation

  • npm run build
  • npm test -- --run --reporter=dot — 805 passed
  • git diff --check

Adds intentionally-failing unit tests under tests/bugs/ that reproduce real
instability / wrong-result bugs found in the v0.40-dev line. Each test pins the
correct behavior and documents the source location, root cause, a concrete
reproduction, and a suggested fix direction. A follow-up change should fix the
underlying bug in src/ so these go green.

Bugs covered:
- contracts/index.ts arg parsing: crash on non-integer numeric args
  (BigInt("1.5")); empty-string arg becomes number 0; odd-length b# hex drops
  the last nibble; JSON args containing a float silently degrade to a raw
  string (structure lost).
- wallet/browserSend.ts: nextLabel is cleared only on success, so a failed send
  leaks its signing label onto the next transaction.
- wallet/browserBridge.ts: POST /api/connected accepts an empty/malformed body
  and marks the bridge connected with an empty-string address.
- staking/StakingAction.ts: --staking-address without --network mutates the
  shared BUILT_IN_NETWORKS singleton, leaking the address process-wide.
- vesting/validatorSetIdentity.ts: --extra-cid 0x... is UTF-8 re-encoded instead
  of hex passthrough, corrupting on-chain identity bytes.
- staking/validatorExit.ts: a confirmed exit is reported as "Failed to exit"
  when the cosmetic post-exit getEpochInfo() read transiently fails.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ja7QCkNnYByMDLou3qah6H
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2eca7e77-70b1-4983-9327-d2fd233ce09b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/new-dev-bug-hunting-10dn6v

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MuncleUscles MuncleUscles changed the title test: failing reproductions for v0.40-dev bugs (instability + wrong results) fix: resolve confirmed v0.40-dev bug-hunt findings Jul 25, 2026

Copy link
Copy Markdown
Member Author

/run-e2e default v0.6

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.

2 participants