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

refactor: ics27 indicator tests of deterministic error codes and message responses #1349

Merged
merged 4 commits into from
May 16, 2022

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented May 12, 2022

Description

Readjusts the acknowledgement test which ensures the error code is deterministic (and thus can be included in the acknowledgement without halting the network.

In v0.35, tendermint made the construction of the LastResultsHash private. In order to maintain the spirit of the original test which allows us to automatically detect when our expected behaviour changes, I have added in process tests which commit a single transaction via tendermint. I then reconstruct the expected hash and ensure they are equal. To show the code is deterministic, I reconstruct the expected hash again with a different error code and show they are not equal. The same is done for successful transaction (a different message response is used)

I have updated the handling of transaction responses in the ics27 acknowledgement as specified in ADR 003

closes: #XXXX


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@colin-axner colin-axner changed the title begin refactoring ack_test refactor: ics27 indicator tests of determinstic error codes May 12, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #1349 (30a5ef9) into carlos/upgrade-pr-branch (378234d) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@                    Coverage Diff                    @@
##           carlos/upgrade-pr-branch    #1349   +/-   ##
=========================================================
  Coverage                     79.88%   79.88%           
=========================================================
  Files                           152      152           
  Lines                         10982    10982           
=========================================================
  Hits                           8773     8773           
  Misses                         1783     1783           
  Partials                        426      426           
Impacted Files Coverage Δ
modules/core/04-channel/keeper/packet.go 95.79% <0.00%> (ø)
modules/core/04-channel/keeper/timeout.go 93.29% <0.00%> (ø)

@colin-axner colin-axner marked this pull request as ready for review May 12, 2022 15:46
@colin-axner colin-axner changed the title refactor: ics27 indicator tests of determinstic error codes refactor: ics27 indicator tests of determinstic error codes and message responses May 12, 2022
@crodriguezvega crodriguezvega changed the title refactor: ics27 indicator tests of determinstic error codes and message responses refactor: ics27 indicator tests of deterministic error codes and message responses May 16, 2022
Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

Thank you so much, @colin-axner!

@crodriguezvega crodriguezvega merged commit 5ac1441 into carlos/upgrade-pr-branch May 16, 2022
@crodriguezvega crodriguezvega deleted the colin/ics27-ack-testing branch May 16, 2022 11:15
@colin-axner
Copy link
Contributor Author

would appreciate a post merge ack from another person cc @seantking @damiannolan

The changes are pretty straightforward, but always nice to have 2 pairs of eyes on important changes

crodriguezvega added a commit that referenced this pull request May 17, 2022
* deps: upgrade of SDK to 0.46 and tendermint to 0.35

* some changes from review comments

* some review comments

* refactor: simplify IBC redundant relay check in given restructure of SDK v0.46 (#1288)

* refactor: simplify ibc redundancy check used as sdk middleware

Instead of having the function checkRedundancy check if the call is on CheckTx or SimulateTx, only call the function on CheckTx or SimulateTx

* add godoc

* more review comments.

* another review comment

* remove tests since legacy REST endpoints have been removed in SDK 0.46

* chore: update sdk to v0.46.0-beta2

* refactor: ics27 indicator tests of deterministic error codes and message responses (#1349)

* begin refactoring ack_test

* fix test due to delayed block execution

* refactor: switch ics27 response creation to use new SDK version, update tests

* fix import

* review comment

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* review comment.

* pass nil context

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* review comment

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

* remove unused import

* remove unused import

* fix for race condition in tests

* remove replace directive to make it build in pre-monterrey mac OS X

Co-authored-by: Carlos Rodriguez <crodveg@gmail.com>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
Co-authored-by: billy rennekamp <billy.rennekamp@gmail.com>
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