This repository was archived by the owner on Nov 16, 2023. It is now read-only.
Commit a68d28e
authored
fix: state-sync - app version stored in params (#241)
Closes: #XXX
## What is the purpose of the change
Backporting and expanding on: cosmos#11182
This is an attempt to fix app version bug related to state-sync and tendermit. More context is in the linked-above PR.
Upon backporting all relevant commits from the linked-above PR, it was discovered that some integration and simulation tests were failing. With the original design, it was difficult to find the source of the problem due to storing the protocol version in 2 database locations. Therefore, the original work was significantly redesigned to only keep the protocol version in param store.
Additionally, the protocol version was assumed to have already been set. Since we are creating a new entry in the database, it is now possible that the protocol version is non-existent at the start. As a result, mechanisms for detecting a missing protocol version were added:
- `baseapp.init(...)`
* This is called on every restart. Here, we check if the protocol version is already in db. If not, set it to 0
- `baseapp.InitChain(...)`
* This is called once at genesis. Here, we always set protocol version to 0
Then, on every upgrade the version gets incremented by 1
## Brief Changelog
- cherry-picked all relevant commits from cosmos#11182
- fixed some issues
- addressed some style comments from code review in cosmos#11182
- redesigned to only store protocol version in params store and removed logic for storing it in the upgrade keeper
- added logic for detecting missing protocol version and, if missing, setting it to 0
- unit and integration tested
- fixed all tests
## Testing and Verifying
This change is a trivial rework / code cleanup without any test coverage.
This change is already covered by existing tests, such as *(please describe tests)*.
TODO: This change needs to be manually tested
## Documentation and Release Note
- Does this pull request introduce a new feature or user-facing behavior changes? yes
- Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? no
- How is the feature or change documented? not applicable1 parent a2fcb7a commit a68d28e
File tree
19 files changed
+276
-105
lines changed- baseapp
- server/mock
- simapp
- testutil/mock
- x
- params/keeper
- simulation
- upgrade
- exported
- keeper
- spec
- types
19 files changed
+276
-105
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
110 | 119 | | |
111 | 120 | | |
112 | 121 | | |
113 | | - | |
| 122 | + | |
114 | 123 | | |
115 | 124 | | |
116 | 125 | | |
| |||
741 | 750 | | |
742 | 751 | | |
743 | 752 | | |
| 753 | + | |
744 | 754 | | |
745 | 755 | | |
746 | 756 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
113 | | - | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
| |||
114 | 116 | | |
115 | 117 | | |
116 | 118 | | |
117 | | - | |
| 119 | + | |
118 | 120 | | |
119 | 121 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | 122 | | |
125 | 123 | | |
126 | 124 | | |
| |||
132 | 130 | | |
133 | 131 | | |
134 | 132 | | |
| 133 | + | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 175 | | |
181 | 176 | | |
182 | 177 | | |
| |||
314 | 309 | | |
315 | 310 | | |
316 | 311 | | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
317 | 324 | | |
318 | 325 | | |
319 | 326 | | |
| |||
429 | 436 | | |
430 | 437 | | |
431 | 438 | | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
432 | 446 | | |
433 | 447 | | |
434 | 448 | | |
| |||
452 | 466 | | |
453 | 467 | | |
454 | 468 | | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
455 | 472 | | |
456 | 473 | | |
457 | 474 | | |
| |||
0 commit comments