Skip to content

Conversation

@MicBun
Copy link
Member

@MicBun MicBun commented Jan 9, 2026

resolves: resolves: https://github.com/truflation/website/issues/3041

Summary by CodeRabbit

  • Improvements

    • Withdrawal-proof retrieval now returns all confirmed epochs (newest first) and includes validator signature data for each epoch, improving completeness of proof results.
  • Chores

    • Internal modules updated to newer versions.

✏️ Tip: You can customize this high-level summary in your review settings.

@MicBun MicBun requested a review from pr-time-tracker January 9, 2026 03:50
@MicBun MicBun self-assigned this Jan 9, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 9, 2026

📝 Walkthrough

Walkthrough

Replaced a single-row RETURN with a RETURN NEXT loop in the withdrawal-proof SQL action to emit all confirmed epochs (newest first) filtered by unclaimed withdrawals. Added validator-signature insertion in two tests. Bumped two kwil-db pseudo-versions in go.mod.

Changes

Cohort / File(s) Summary
Dependency Updates
go.mod
Bumped github.com/trufnetwork/kwil-db and github.com/trufnetwork/kwil-db/core pseudo-versions.
Withdrawal Proof Migration
internal/migrations/erc20-bridge/004-withdrawal-proof-action.sql
Replaced single-row RETURN with a FOR loop emitting multiple rows via RETURN NEXT; returns all confirmed epochs (newest first) filtered by unclaimed withdrawals.
Withdrawal Proof Tests
tests/extensions/erc20/erc20_bridge_withdrawal_proof_test.go
Inserted ForTestingAddValidatorSignatureToEpoch calls after epoch finalization in two tests to ensure validator signatures exist before requesting withdrawal proofs.

Sequence Diagram(s)

(Skipped — changes do not introduce new multi-component control flow requiring a sequence diagram.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

type: feat

Suggested reviewers

  • pr-time-tracker

Poem

🐰 I hopped through diffs with a twitch and a cheer,
Bumped modules and let epochs appear,
Now proofs come in flocks instead of a drip,
Validators signed — onward the ship! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references 'fetch unclaimed withdrawal proof' which aligns with the main change in the SQL migration file that filters epochs by withdrawals (unclaimed only) and returns multiple rows instead of a single row.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f36b8c2 and 965a379.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod
🚧 Files skipped from review as they are similar to previous changes (1)
  • go.mod
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: slow-integration-tests
  • GitHub Check: acceptance-test
  • GitHub Check: lint

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 and usage tips.

@holdex
Copy link

holdex bot commented Jan 9, 2026

Time Submission Status

Member Status Time Action Last Update
MicBun ✅ Submitted 3h Update time Jan 9, 2026, 5:16 AM

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @internal/migrations/erc20-bridge/004-withdrawal-proof-action.sql:
- Around line 4-5: The migration/query currently returns all confirmed epochs by
delegating to the precompile hoodi_bridge.list_wallet_rewards(), which is
untested for multi-epoch behavior and can produce unbounded result sets; update
the SQL in withdrawal-proof-action (and any calling function) to accept an
optional integer limit parameter (e.g., limit_count) and pass it into or apply
it after hoodi_bridge.list_wallet_rewards() to cap results, add or adjust tests
to simulate multiple confirmed epochs per wallet to verify ordering and
correctness, and document the new optional limit parameter in the function
signature and comments.
🧹 Nitpick comments (1)
tests/extensions/erc20/erc20_bridge_withdrawal_proof_test.go (1)

395-402: Test robustness: consider tolerating multi-row proofs (and add a consistent error message).
Given the action now returns all confirmed epochs, asserting exactly 1 proof row can become brittle if fixtures ever create multiple matching epochs. Consider asserting “>= 1” and validating at least one row matches the expected epoch (or explicitly validating ordering and taking the newest row). Also, add the same "failed to add validator signature" message for consistency.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 79509c7 and d8166f5.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • go.mod
  • internal/migrations/erc20-bridge/004-withdrawal-proof-action.sql
  • tests/extensions/erc20/erc20_bridge_withdrawal_proof_test.go
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build and Push
  • GitHub Check: slow-integration-tests
  • GitHub Check: lint
  • GitHub Check: acceptance-test
🔇 Additional comments (2)
tests/extensions/erc20/erc20_bridge_withdrawal_proof_test.go (1)

101-108: Good: add validator signature before requesting withdrawal proofs.
This makes the signatures column meaningfully testable and prevents flakiness from “no signatures” proofs.

go.mod (1)

22-23: go.sum correctly updated for kwil-db dependency bump.
Both github.com/trufnetwork/kwil-db and github.com/trufnetwork/kwil-db/core are version-aligned at commit 1229f5f7af8c, and the corresponding go.sum entries are present. The codebase imports (crypto, testing, erc20-bridge) resolve correctly, and tests for withdrawal functionality are in place.

@MicBun MicBun merged commit cf0165a into main Jan 9, 2026
8 checks passed
@MicBun MicBun deleted the choreUnclaimed branch January 9, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants