Skip to content

Align distribution withdraw recipient checks#3535

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

Align distribution withdraw recipient checks#3535
codchen wants to merge 1 commit into
mainfrom
codex/distribution-withdraw-blocked-addr

Conversation

@codchen
Copy link
Copy Markdown
Collaborator

@codchen codchen commented Jun 3, 2026

Summary

  • include bank-level recipient block checks when validating distribution withdraw recipients
  • use the same recipient eligibility path when reading stored withdraw recipients
  • add coverage for stored recipient state that should fall back to the delegator address

Tests

  • go test ./sei-cosmos/x/distribution/keeper -run 'Test(SetWithdrawAddr|AfterValidatorRemovedFallsBackFor.*WithdrawAddress)'
  • 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 Jun 3, 2026

PR Summary

Medium Risk
Changes reward/commission payout recipient resolution in the distribution module; scope is narrow but affects fund routing when stored withdraw addresses are bank-blocked.

Overview
Distribution now treats bank-level blocked recipients the same as the keeper’s static blocklist when validating and resolving withdraw addresses.

SetWithdrawAddr rejects withdraw targets that bankKeeper.BlockedAddr marks blocked (same unauthorized error as the existing blockedAddrs check), in addition to CanSendTo. canReceiveWithdrawAddr / GetDelegatorWithdrawAddr use the same rule, so a stored withdraw address that is bank-blocked (e.g. coinbase-style prefix) is ignored and payouts fall back to the delegator—covered by new tests for set-withdraw failure and validator-removal commission payout.

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedJun 3, 2026, 2:26 AM

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.28%. Comparing base (2151ba0) to head (b0acf67).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3535      +/-   ##
==========================================
- Coverage   59.12%   58.28%   -0.85%     
==========================================
  Files        2213     2140      -73     
  Lines      182814   174435    -8379     
==========================================
- Hits       108096   101664    -6432     
+ Misses      64993    63725    -1268     
+ Partials     9725     9046     -679     
Flag Coverage Δ
sei-chain-pr 64.47% <100.00%> (?)
sei-db 70.41% <ø> (ø)
sei-db-state-db ?

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

Files with missing lines Coverage Δ
sei-cosmos/x/distribution/keeper/keeper.go 87.80% <100.00%> (+0.62%) ⬆️

... and 73 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