Commit 5f6b2f2
cisco
fix(keeper): distinguish storage failures from validation errors in SubmitPocValidationsV2
## Problem
`SubmitPocValidationsV2` used `LogWarn + continue` for all `SetPocValidationV2` errors,
treating infrastructure-level storage failures the same as expected validation errors
(e.g. invalid bech32 addresses). A transient storage failure would silently drop votes
and return success to the caller — leaving consensus state inconsistent with no observable signal.
## Fix
Replace `LogWarn + continue` with `LogError + return error` for `SetPocValidationV2` failures.
This is safe because `HasPocValidationV2` (called earlier in the same loop iteration)
already validates bech32 addresses for both participant and validator. Any error reaching
`SetPocValidationV2` is therefore definitively a storage-layer failure, not invalid input.
- Storage failure: `LogError` + abort batch via `return nil, fmt.Errorf(...)`.
Cosmos SDK rolls back the full transaction, preventing partial writes.
- Invalid address: caught by `HasPocValidationV2` → `LogWarn + continue`.
Partial-success design preserved. `TestSubmitPocValidationsV2_PartialSuccess` passes.
Adds `TestSubmitPocValidationsV2_StorageError_AddressPreValidation` documenting the
address pre-validation invariant that makes this distinction possible.
## Impact
- Storage failures are now observable (LogError, tx rollback) instead of silent
- Partial-success behavior for invalid addresses unchanged (design intent preserved)
- Closes #10121 parent ec8f455 commit 5f6b2f2
File tree
2 files changed
+33
-2
lines changed- inference-chain/x/inference/keeper
2 files changed
+33
-2
lines changedLines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
185 | 210 | | |
186 | 211 | | |
187 | 212 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
140 | 144 | | |
141 | | - | |
| 145 | + | |
142 | 146 | | |
143 | 147 | | |
| 148 | + | |
144 | 149 | | |
145 | | - | |
| 150 | + | |
| 151 | + | |
146 | 152 | | |
147 | 153 | | |
148 | 154 | | |
| |||
0 commit comments