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

Atomic test of proxy #12

Closed
wants to merge 1 commit into from
Closed

Atomic test of proxy #12

wants to merge 1 commit into from

Conversation

Art3miX
Copy link
Collaborator

@Art3miX Art3miX commented Mar 29, 2023

#2

TestFailureMsg is working, but I would like to confirm that bank msg alone is working properly to remove any doubts about why its not working.

  • Because we don't have meaningful errors, something else might be broken, which will result in a false positive test, with TestSuccessfulBankMsg we can confirm we are sending 2 (otherwise) successful msgs and its not working because of balance.

@0xekez
Copy link
Contributor

0xekez commented Mar 30, 2023

we want to show,

  1. if a single message fails, all messages are rolled back.
  2. the error message for the first message to fail is returned.

with the constraint: all error messages have the same error text (CosmWasm/wasmd#1289).

here's one idea how to go about this:

  1. state will never be committed from a submessage that errors.
  2. our code won't generate the error message for successful execution.
  3. there is no reasonable way the voice packet receive handler would panic
  4. a panic is handled like a regular error, from the perspective of ibc_packet_receive
  5. because we never panic and don't return an error, the only way to get an ACK-ERROR back from the voice module is if it comes from the REPLY_ACK handler.
  6. $1 \land 5 \implies$ if we see an error, the state was reverted for the message that generated that error.

to test that the state for other messages gets reverted, we can do the following:

  1. find one message that is known to fail, show that it is known to fail in another test.
  2. execute [known-success, known-fail]
  3. check that an error was returned, per (6), this must have come from known-fail.
  4. check that the state change that known-success would have applied is not present.
  5. execute [known-success]
  6. check that the state change was applied.

what this does not show is that the error message from the first one to fail is returned. no idea how to do that lol

@Art3miX
Copy link
Collaborator Author

Art3miX commented Apr 1, 2023

what this does not show is that the error message from the first one to fail is returned. no idea how to do that lol

When I was doing those tests, I actually received 2 error msgs, code 5 and code 15, guess we can have 3 msgs:
[known-success, known-fail-code-5, known-fail-code-15]

And just make sure we get code 5 and not 15.

So to do that 1 test, we need to make sure we confirm all known cases individually, nice.

@0xekez
Copy link
Contributor

0xekez commented Apr 15, 2023

done in #33

@0xekez 0xekez closed this Apr 15, 2023
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.

2 participants