Commit 18cc4d8
committed
fix(app): reconciliation saveUnbalancedBlockHeight store-key mismatch (MOCA-670)
saveUnbalancedBlockHeight resolved the reconciliation commit store with a
freshly built storetypes.NewKVStoreKey, but rootmulti keys its store map by
StoreKey identity (rs.stores[key]). The fresh key is absent, so GetCommitStore
returns nil and the (*iavl.Store) assertion panics:
"interface conversion: types.CommitStore is nil, not *iavl.Store".
getUnbalancedBlockHeight already uses the mounted app.GetKey; align save with
it (and drop the now-unused storetypes import).
The panic is masked when inter-block-cache is enabled (the default): the
cache's Unwrap resolves by name and returns the underlying store. It only bites
nodes with inter-block-cache=false, where a reconciliation imbalance then halts
consensus with the opaque panic instead of the intended graceful
"unbalanced state at block height N, please use hardfork to bypass it".
Reproduced on the test-box: unit test (no cache) + single-node and 4-node
localnets with inter-block-cache=false. Adds a regression test that panics
before the fix and round-trips after.
Signed-off-by: puneetmahajan <59960662+puneet2019@users.noreply.github.com>1 parent df98706 commit 18cc4d8
2 files changed
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
160 | 159 | | |
161 | 160 | | |
162 | 161 | | |
163 | | - | |
| 162 | + | |
164 | 163 | | |
165 | 164 | | |
166 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments