Skip to content

Forward port discard abci responses change#9286

Merged
samricotta merged 11 commits intomainfrom
f-port-abci-responses
Aug 22, 2022
Merged

Forward port discard abci responses change#9286
samricotta merged 11 commits intomainfrom
f-port-abci-responses

Conversation

@samricotta
Copy link
Contributor

Forward porting abci responses change

samricotta and others added 4 commits August 18, 2022 10:53
*backport of sam/abci-responses

Co-authored-by: William Banfield <4561443+williambanfield@users.noreply.github.com>
* update last responses key
@samricotta samricotta requested a review from ebuchman as a code owner August 18, 2022 09:08
@samricotta samricotta requested a review from a team August 18, 2022 09:08
…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>
@samricotta samricotta force-pushed the f-port-abci-responses branch from 64d9188 to 3f34caf Compare August 18, 2022 09:44
Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


### IMPROVEMENTS

- [config] \#9054 Flag added to overwrite abciresponses.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this as it's first introduced in v0.34.21

state/store.go Outdated
Comment on lines +42 to +44
var (
lastABCIResponseKey = []byte("lastABCIResponseKey")
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var (
lastABCIResponseKey = []byte("lastABCIResponseKey")
)
var lastABCIResponseKey = []byte("lastABCIResponseKey")

nit

@thanethomson thanethomson mentioned this pull request Aug 18, 2022
39 tasks

### IMPROVEMENTS

- [config] \#9054 Flag added to overwrite abciresponses.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was just saying in an above comment that perhaps a changelog is not necessary if it's in the changelog in v0.34.21

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ive changed it to what Will has suggested but I also think that Callum has a point. I think maybe kick this one out

@samricotta samricotta force-pushed the f-port-abci-responses branch 2 times, most recently from 45cebeb to 2d92ab1 Compare August 19, 2022 15:19
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))\
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would avoid this change.

Comment on lines +423 to +424
tmos.Exit(fmt.Sprintf(`LoadLastABCIResponses: Data has been corrupted or its spec has
changed: %v\n`, err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this an exit and not a panic?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@samricotta samricotta force-pushed the f-port-abci-responses branch from 2d92ab1 to 572a920 Compare August 19, 2022 15:26
Copy link
Contributor

@thanethomson thanethomson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines +423 to +424
tmos.Exit(fmt.Sprintf(`LoadLastABCIResponses: Data has been corrupted or its spec has
changed: %v\n`, err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@samricotta samricotta merged commit aa303ed into main Aug 22, 2022
@samricotta samricotta deleted the f-port-abci-responses branch August 22, 2022 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants