Repository navigation
Commit 8269937
config: disable state proofs by default (#4573)
## Summary
Disables deprecated ABCI `/store` state proofs by default while keeping
a per-node escape hatch for the v6.8 rollout. The proof code stays in
place, but `Store.Query` now rejects proof requests unless the operator
sets `state-commit.sc-enable-state-proof = true`.
- `sei-db/config/sc_config.go`: adds `EnableStateProof` to
`StateCommitConfig`. The default is `false`, so a node with no new
config key rejects state proof requests.
- `sei-db/config/toml.go`: renders `sc-enable-state-proof = false` in
app.toml. The comment says the option is temporary and will be removed
with the proof code.
- `app/seidb.go`: adds `FlagSCEnableStateProof` and reads it with the
same presence guard as the other SC keys. An absent key keeps the
in-code default.
- `app/config_register.go`: declares the new state-commit key in the
config registry, so generated config, parsed config, and registered keys
stay in sync.
- `sei-cosmos/storev2/rootmulti/store.go`: stores the resolved flag on
`Store` and checks it in `admitProofQuery`, at the proof choke point
after `needProof := req.Prove && rootmulti.RequireProof(subPath)`. A
rejection returns `ErrNotSupported` (code 37), so clients can tell it
apart from the pruned-height error (code 18). Unproven queries keep
their existing path. `/subspace` queries keep their existing limits. The
gate runs before the historical-proof permit, so rejected requests do
not use it.
- `sei-cosmos/storev2/rootmulti/metrics.go`: adds
`state_proof_rejected`, a counter for proof requests rejected by the
default-off gate. It has a `store` attribute and a `latest` attribute,
so the rollout shows which module state callers still prove, and at
which heights. The store set is bounded, because `Query` rejects unknown
store names before the gate.
- `CHANGELOG.md`: documents the v6.8 default-off behavior, the temporary
operator override, and the affected clients: `sei-tendermint/light/rpc`
(always sets `prove=true`), the light proxy built on it, and
`sei-cosmos/client` queries with `Prove` set.
## Test plan
- `sei-cosmos/storev2/rootmulti/store_test.go`:
- default config rejects `Prove: true` for latest and historical `/key`
queries with `ErrNotSupported`;
- default config still serves the same latest and historical queries
without proof;
- on a node with SS enabled, default config still serves `Prove: true`
on `/subspace` unproven, because only `/key` produces a proof (a node
without SS refuses `/subspace` since #4572);
- `EnableStateProof = true` returns `ProofOps` at latest and historical
heights;
- existing proof-path tests opt in to `EnableStateProof`.
- `sei-cosmos/storev2/rootmulti/flatkv_helpers_test.go`: flatkv query
tests opt in through the shared SC test config, so they still cover the
proof path.
- `app/seidb_test.go`: absent `sc-enable-state-proof` keeps `false`;
explicit `true` enables proofs; explicit `false` disables proofs.
- `app/config_register_test.go`,
`app/config_register_agreement_test.go`, and
`sei-db/config/toml_test.go`: the new key is registered, read, and
rendered by the app.toml template.
- `app/upgrade_offline_harness_test.go`: both harness constructors open
apps with `offlineUpgradeAppOpts`, which turns proofs on, so
`requireOfflineUpgradeStoreProof` still checks committed store
membership. The key is a string literal, because CI also compiles this
file into the source release worktree, which does not have
`FlagSCEnableStateProof`.
- Verification run:
- `make fmtcheck`
- `scripts/ramtest.sh ./sei-cosmos/storev2/... ./sei-db/config/...`
- `scripts/ramtest.sh ./app/ -run
'TestParseSCConfigs|ConfigRegister|Offline'`
- `make upgrade-test-vet`
- `make upgrade-test-offline FROM_REF=release/v6.7 TO_REF=HEAD` (v6.7 ->
v6.8 boundary)
- `make lint`
- Harbor (4 validators + 2 RPC nodes, image `7e83763`, before the
`ErrNotSupported` change and before #4572):
- default validator: `prove=false` returns the value at latest and
historical heights; `prove=true` is rejected at both heights;
`/subspace` with `prove=true` succeeds;
`sei_chain_state_proof_rejected_total{store="bank"}` counts the
rejections with `latest="true"` and `latest="false"`;
- RPC node with `sc-enable-state-proof = true`: `prove=true` returns
`ics23:iavl` + `ics23:simple` proof ops at latest and historical
heights, and the rejection counter stays empty.
---------
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 1736cc3 commit 8269937
14 files changed
Lines changed: 185 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| |||
198 | 199 | | |
199 | 200 | | |
200 | 201 | | |
| 202 | + | |
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
128 | 129 | | |
129 | 130 | | |
130 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
171 | 175 | | |
172 | 176 | | |
173 | 177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| |||
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
112 | 133 | | |
113 | 134 | | |
114 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
120 | | - | |
121 | | - | |
| 123 | + | |
| 124 | + | |
122 | 125 | | |
123 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
124 | 132 | | |
125 | 133 | | |
126 | 134 | | |
| |||
188 | 196 | | |
189 | 197 | | |
190 | 198 | | |
191 | | - | |
| 199 | + | |
192 | 200 | | |
193 | 201 | | |
194 | 202 | | |
| |||
230 | 238 | | |
231 | 239 | | |
232 | 240 | | |
233 | | - | |
| 241 | + | |
234 | 242 | | |
235 | 243 | | |
236 | 244 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
91 | 92 | | |
92 | 93 | | |
93 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
67 | 73 | | |
68 | 74 | | |
69 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| |||
1030 | 1032 | | |
1031 | 1033 | | |
1032 | 1034 | | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
1033 | 1040 | | |
1034 | 1041 | | |
1035 | 1042 | | |
| |||
1099 | 1106 | | |
1100 | 1107 | | |
1101 | 1108 | | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
1102 | 1122 | | |
1103 | 1123 | | |
1104 | 1124 | | |
| |||
0 commit comments