Skip to content

Harden distribution withdraw address handling#3463

Open
codchen wants to merge 1 commit into
mainfrom
codex/distribution-withdraw-handling
Open

Harden distribution withdraw address handling#3463
codchen wants to merge 1 commit into
mainfrom
codex/distribution-withdraw-handling

Conversation

@codchen
Copy link
Copy Markdown
Collaborator

@codchen codchen commented May 19, 2026

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
Copy link
Copy Markdown

cursor Bot commented May 19, 2026

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
Copy link
Copy Markdown

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 19, 2026, 3:27 AM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.32%. Comparing base (823a78d) to head (e4dc78b).
⚠️ Report is 9 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.

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.

1 participant