Skip to content

Harden distribution withdraw address handling#3463

Merged
codchen merged 1 commit into
mainfrom
codex/distribution-withdraw-handling
May 21, 2026
Merged

Harden distribution withdraw address handling#3463
codchen merged 1 commit into
mainfrom
codex/distribution-withdraw-handling

Conversation

@codchen

@codchen codchen commented May 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • validate configured distribution withdraw recipients against bank recipient checks
  • fall back to the delegator address when a stored withdraw recipient is no longer receivable
  • add regression coverage for stale withdraw-recipient state

Tests

  • go test ./sei-cosmos/x/distribution/keeper
  • go test ./sei-cosmos/x/distribution/...
  • go test ./sei-cosmos/x/bank/keeper

@cursor

cursor Bot commented May 19, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes reward-withdraw address validation and lookup behavior, which can alter where validator/delegator rewards are sent if a previously-configured recipient becomes invalid. Logic is straightforward but touches distribution payout paths and depends on bankKeeper.CanSendTo.

Overview
Distribution withdraw recipients are hardened against non-receivable addresses. SetWithdrawAddr now rejects recipients failing bankKeeper.CanSendTo, and GetDelegatorWithdrawAddr now falls back to the delegator address when the stored withdraw address is blocked or no longer passes bank recipient checks.

This extends the distribution BankKeeper interface with CanSendTo and adds regression tests covering EVM address-mapping scenarios that make a previously-valid withdraw address become invalid (including ensuring AfterValidatorRemoved payouts don’t panic and still credit the delegator).

Reviewed by Cursor Bugbot for commit e4dc78b. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented May 19, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 21, 2026, 5:10 AM

@codecov

codecov Bot commented May 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.32%. Comparing base (823a78d) to head (e4dc78b).
⚠️ Report is 27 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3463      +/-   ##
==========================================
+ Coverage   59.29%   59.32%   +0.02%     
==========================================
  Files        2125     2125              
  Lines      175629   175636       +7     
==========================================
+ Hits       104144   104190      +46     
+ Misses      62404    62362      -42     
- Partials     9081     9084       +3     
Flag Coverage Δ
sei-chain-pr 70.28% <100.00%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-cosmos/x/bank/keeper/send.go 92.45% <ø> (ø)
sei-cosmos/x/distribution/keeper/keeper.go 87.17% <100.00%> (+0.69%) ⬆️
sei-cosmos/x/distribution/keeper/store.go 70.38% <100.00%> (+7.77%) ⬆️

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codchen codchen added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit 33a14ef May 21, 2026
44 of 45 checks passed
@codchen codchen deleted the codex/distribution-withdraw-handling branch May 21, 2026 13:41
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.

3 participants