Repository navigation
Commit 4bd3c9e
authored
Reject empty and non-min-deposit-denom governance deposits (#4708)
`Keeper.AddDeposit` accepts any amount in any denomination. An empty
`MsgDeposit` still writes a deposit record, and a deposit can carry
denominations that never count towards the minimum deposit, so each
extra denomination adds a coin that has to be burned or refunded later.
Once incremental tally is enabled, `AddDeposit` now returns early for an
empty amount without moving funds or writing a record, and rejects with
`ErrInvalidCoins` any amount whose denominations are not all in the
proposal's minimum deposit (`GetMinimumDeposit`). The check lives in
`AddDeposit`, so the native deposit and submit paths and the gov
precompile all go through it. Proposals can still be submitted with no
initial deposit.
This breaks the app hash: it changes which deposits are accepted and
their tx results. It is gated on `IncrementalTallyEnabled`, like the
existing voting-period check in `AddDeposit`, so it activates with the
v6.8 upgrade. Covered by a keeper test for empty, foreign-denom and
mixed-denom deposits; the existing gov and precompile tests pass
unchanged.1 parent 2fc6c1b commit 4bd3c9e
2 files changed
Lines changed: 41 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
116 | 126 | | |
117 | 127 | | |
118 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
244 | 245 | | |
245 | 246 | | |
246 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
247 | 278 | | |
248 | 279 | | |
249 | 280 | | |
| |||
0 commit comments