Skip to content

fix: resolve confirmed v2-dev bug-hunt findings - #201

Open
MuncleUscles wants to merge 2 commits into
v2-devfrom
claude/new-dev-bug-hunting-eo2cic
Open

fix: resolve confirmed v2-dev bug-hunt findings#201
MuncleUscles wants to merge 2 commits into
v2-devfrom
claude/new-dev-bug-hunting-eo2cic

Conversation

@MuncleUscles

@MuncleUscles MuncleUscles commented Jul 11, 2026

Copy link
Copy Markdown
Member

What

Adds regression coverage and fixes the 12 confirmed defects found in the v2-dev bug hunt.

The fixes cover:

  • calldata rendering and malformed-input bounds checks
  • shared-reference JSON serialization
  • chain singleton mutation during client endpoint overrides
  • strict struct and integer schema validation
  • staking identity CID round-tripping and API naming
  • vesting CID/share input validation
  • Studio transaction success detection

Validation

  • npm exec vitest run tests/bug-hunt-v2dev.test.ts — 12 passed
  • npm exec vitest run -- --typecheck — 127 passed, no type errors
  • git diff --check

The existing RLP-decoding stderr in transactions.test.ts remains benign and is covered by passing assertions.

Adds tests/bug-hunt-v2dev.test.ts: 12 tests, each reproducing a distinct
confirmed defect on the v2-dev (v0.6) integration branch. Every test is
expected to FAIL against current code and should pass once the underlying
bug is fixed. File:line and root cause are documented inline per block.

Wrong results:
- calldata toString(): map entries emitted with no separator ({"a":1"b":2})
- calldata toString(): per-byte hex not zero-padded (distinct bytes collide)
- toJsonSafeDeep(): shared (non-cyclic) references replaced with null
- createClient({endpoint}): mutates the shared chain-config singleton
- schema strictTypes: non-object accepted for struct param; float/NaN for int
- staking getValidatorInfo(): toHex() double-encodes already-hex extraCid
- vesting encodeExtraCid(): odd-length hex silently corrupted (0x123 -> 0x1230)
- isSuccessful(): always false for finalized studio/localnet transactions

Instability:
- calldata decode(): trusts attacker-supplied array/map counts (unbounded work)
- vesting exit: BigInt("") coerces empty shares to 0n and broadcasts
- staking: advertised isValidatorBelowMinStake helper missing at runtime

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017Xrmnk8SQeW3Aju4M7QHut
@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: a3b8e02c-9d5d-4d4e-af9d-430b999d4556

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-eo2cic

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 repros for confirmed v2-dev bugs (fixes to follow) fix: resolve confirmed v2-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