Forward port discard abci responses change#9286
Conversation
* update to toml
* update last responses key
…on (#9275) * config: Move discard_abci_responses flag into its own storage section Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update config comment to highlight space saving tradeoff Signed-off-by: Thane Thomson <connect@thanethomson.com> Signed-off-by: Thane Thomson <connect@thanethomson.com>
64d9188 to
3f34caf
Compare
cmwaters
left a comment
There was a problem hiding this comment.
Looks good however there's a lot of formatting changes which makes this PR hard to read.
If there is formatting changes it's best do be done in a separate PR. Make sure you're using go 1.18
CHANGELOG_PENDING.md
Outdated
|
|
||
| ### IMPROVEMENTS | ||
|
|
||
| - [config] \#9054 Flag added to overwrite abciresponses. |
There was a problem hiding this comment.
I don't think we need this as it's first introduced in v0.34.21
state/store.go
Outdated
| var ( | ||
| lastABCIResponseKey = []byte("lastABCIResponseKey") | ||
| ) |
There was a problem hiding this comment.
| var ( | |
| lastABCIResponseKey = []byte("lastABCIResponseKey") | |
| ) | |
| var lastABCIResponseKey = []byte("lastABCIResponseKey") |
nit
CHANGELOG_PENDING.md
Outdated
|
|
||
| ### IMPROVEMENTS | ||
|
|
||
| - [config] \#9054 Flag added to overwrite abciresponses. |
There was a problem hiding this comment.
Can we give a slightly broader explanation of what this does? "Configuration flag added to permit Tendermint to discard all ABCIResponses except for the most recent."
There was a problem hiding this comment.
Was just saying in an above comment that perhaps a changelog is not necessary if it's in the changelog in v0.34.21
There was a problem hiding this comment.
Ive changed it to what Will has suggested but I also think that Callum has a point. I think maybe kick this one out
45cebeb to
2d92ab1
Compare
libs/json/doc.go
Outdated
| // times emitted as "0001-01-01T00:00:00Z" as with encoding/json): | ||
| // | ||
| // time.Date(2020, 6, 8, 16, 21, 28, 123, time.FixedZone("UTC+2", 2*60*60)) | ||
| // time.Date(2020, 6, 8, 16, 21, 28, 123, time.FixedZone("UTC+2", 2*60*60))\ |
There was a problem hiding this comment.
I would avoid this change.
| tmos.Exit(fmt.Sprintf(`LoadLastABCIResponses: Data has been corrupted or its spec has | ||
| changed: %v\n`, err)) |
There was a problem hiding this comment.
why is this an exit and not a panic?
There was a problem hiding this comment.
tbh I cannot remember exactly why this was an exit rather than a panic. What would be the reasoning to change it to a panic just so im clear
There was a problem hiding this comment.
I see that there are 5 such calls throughout the state/store.go file and Exit has been the convention in this file for more than 5 years now. I'd be very interested in knowing what the reasoning here was originally.
Looking at all the places this is called from, it doesn't seem as though there are any defers prior to where these functions are called, but at first glance it seems a little dangerous to have Exits embedded within the code instead of panics.
It may be worth a follow-up investigation here after this PR - perhaps a codebase-wide audit of where Exit's used instead of panic to see whether it's still applicable, and where it is applicable we should document why it's applicable in comments colocated with the Exit calls.
2d92ab1 to
572a920
Compare
thanethomson
left a comment
There was a problem hiding this comment.
Minor nits, but otherwise LGTM.
| the tooling will reindex until the latest block height(inclusive). User can omit | ||
| either or both arguments. | ||
|
|
||
| Note: This operation requires ABCIResponses. Do not set DiscardABCIResponses to true if you |
There was a problem hiding this comment.
| Note: This operation requires ABCIResponses. Do not set DiscardABCIResponses to true if you | |
| Note: This operation requires ABCI responses. Do not set DiscardABCIResponses to true if you |
state/store.go
Outdated
| } | ||
|
|
||
| type StoreOptions struct { | ||
|
|
| tmos.Exit(fmt.Sprintf(`LoadLastABCIResponses: Data has been corrupted or its spec has | ||
| changed: %v\n`, err)) |
There was a problem hiding this comment.
I see that there are 5 such calls throughout the state/store.go file and Exit has been the convention in this file for more than 5 years now. I'd be very interested in knowing what the reasoning here was originally.
Looking at all the places this is called from, it doesn't seem as though there are any defers prior to where these functions are called, but at first glance it seems a little dangerous to have Exits embedded within the code instead of panics.
It may be worth a follow-up investigation here after this PR - perhaps a codebase-wide audit of where Exit's used instead of panic to see whether it's still applicable, and where it is applicable we should document why it's applicable in comments colocated with the Exit calls.
Forward porting abci responses change