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

[Bug]: ABCIListeners not receiving FinalizeBlock request and response #18485

Closed
1 task done
MSalopek opened this issue Nov 16, 2023 · 0 comments · Fixed by #18486
Closed
1 task done

[Bug]: ABCIListeners not receiving FinalizeBlock request and response #18485

MSalopek opened this issue Nov 16, 2023 · 0 comments · Fixed by #18486
Assignees
Labels

Comments

@MSalopek
Copy link
Contributor

MSalopek commented Nov 16, 2023

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

While we upgrading ICS to v0.50.1 we noticed that our ABCIListener hooks were not getting any FinalizeBlock updates even though ListenFinalizeBlock was implemented. ListenCommit is working correctly.

Upon further inspection, we found that the issue lies in baseapp/abci.go.
The issue likely arose when Begin/EndBlock operations got superseded by FinalizeBlock.

Previosly, in v0.47.x we can see that BeginBlock and EndBlock calls would pass the abci req/res to registered ABCI listeners.

// BeginBlock implements the ABCI application interface.
func (app *BaseApp) BeginBlock(req abci.RequestBeginBlock) (res abci.ResponseBeginBlock) {
	// ...

	// call the hooks with the BeginBlock messages
	for _, streamingListener := range app.abciListeners {
		if err := streamingListener.ListenBeginBlock(app.deliverState.ctx, req, res); err != nil {
			panic(fmt.Errorf("BeginBlock listening hook failed, height: %d, err: %w", req.Header.Height, err))
		}
	}

	return res
}

// EndBlock implements the ABCI interface.
func (app *BaseApp) EndBlock(req abci.RequestEndBlock) (res abci.ResponseEndBlock) {
	// ...

	// call the streaming service hooks with the EndBlock messages
	for _, streamingListener := range app.abciListeners {
		if err := streamingListener.ListenEndBlock(app.deliverState.ctx, req, res); err != nil {
			panic(fmt.Errorf("EndBlock listening hook failed, height: %d, err: %w", req.Height, err))
		}
	}

	return res
}

In FinalizeBlock this does not happen.

Credits for finding the issue: @tbruyelle

Cosmos SDK Version

0.50.1

How to reproduce?

Register an ABCIListener and check if ListenFinalizeBlock is ever executed.
ListenCommit works without issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant