Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(state/store): avoid double-saving ABCI responses #13

Merged
merged 3 commits into from
Mar 8, 2024

Conversation

czarcas7ic
Copy link
Member


PR checklist

  • Tests written/updated
  • Changelog entry added in .changelog (we use unclog to manage our changelog)
  • Updated relevant documentation (docs/ or spec/) and code comments

@czarcas7ic czarcas7ic closed this Feb 27, 2024
@czarcas7ic czarcas7ic reopened this Feb 27, 2024
Comment on lines +439 to +442
if height != info.GetHeight() {
return nil, fmt.Errorf("expected height %d but last stored abci responses was at height %d", height, info.GetHeight())
}
return info.AbciResponses, nil
Copy link
Member Author

Choose a reason for hiding this comment

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

I left out the following logic branch because I don't think it matters here, but would like an ACK

	if info.FinalizeBlock == nil {
		// sanity check
		if info.LegacyAbciResponses == nil {
			panic("state store contains last abci response but it is empty")
		}
		return responseFinalizeBlockFromLegacy(info.LegacyAbciResponses), nil
	}

Copy link
Member

Choose a reason for hiding this comment

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

This is for an edge case, but I think this backports it wrong

Copy link
Member Author

Choose a reason for hiding this comment

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

I will hold off on merging this till we talk next then

Copy link
Member

Choose a reason for hiding this comment

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

oh your right we are fine without this logic branch, sorry about that.

@czarcas7ic czarcas7ic marked this pull request as ready for review February 27, 2024 04:26
Copy link
Member

@ValarDragon ValarDragon left a comment

Choose a reason for hiding this comment

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

Looks right to me!

@czarcas7ic czarcas7ic merged commit 1e9012f into osmo/v0.37.4 Mar 8, 2024
30 checks passed
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.

3 participants