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

IBC testing code runs outside of abci lifecycle with TestChain #6024

Open
3 tasks
damiannolan opened this issue Mar 19, 2024 · 0 comments
Open
3 tasks

IBC testing code runs outside of abci lifecycle with TestChain #6024

damiannolan opened this issue Mar 19, 2024 · 0 comments
Labels
needs discussion Issues that need discussion before they can be worked on testing Testing package and unit/integration tests type: bug Something isn't working as expected

Comments

@damiannolan
Copy link
Contributor

Summary of Bug

When actions are performs when using the ibctesting library and a msg is sent to the desired chain we generally call NextBlock on the test chain which invokes the abci callback method FinalizeBlock.

With the introduction of FinalizeBlock in abci++, the following legacy abci methods are composed into the one step:

  • PreBlock (added post abci++)
  • BeginBlock
  • DeliverTx
  • EndBlock

This means that taking action or setting up test code stubs using the current height from the chain context will yield results which do not include module actions taken on steps such as PreBlock or BeginBlock. For example, historical info at the current chain height is not stored in x/staking until BeginBlock is called. This may lead to unexpected results or test behaviour.

Expected Behaviour

Test code runs within a valid context of the abci lifecycle - e.g. the deliverTx step.

Version

main

Steps to Reproduce

See example in PR where this was caught: https://github.com/cosmos/ibc-go/pull/6018/files#r1530522751


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@damiannolan damiannolan added type: bug Something isn't working as expected needs discussion Issues that need discussion before they can be worked on testing Testing package and unit/integration tests labels Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs discussion Issues that need discussion before they can be worked on testing Testing package and unit/integration tests type: bug Something isn't working as expected
Projects
Status: No status
Development

No branches or pull requests

1 participant