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

Add some failure modes to hackatom contract #142

Merged
merged 7 commits into from
Feb 9, 2020

Conversation

ethanfrey
Copy link
Member

Based on this discussion: CosmWasm/wasmd#8 (comment)

Breaking change in the contract - no longer will {} release funds, but we will need to do {"release":{}}.

We add the following new commands for testing the stack:

  • {"cpuloop":{}} - will do an infinite loop with cpu usage - to hit wasm gas limit
  • {"storageloop":{}} - will do an infinite loop with writes to storage - to hit cosmos-sdk storage gas limit
  • {"panic":{}} - will cause contract to do a panic, make sure we handle this properly (like any other error)

@ethanfrey ethanfrey force-pushed the hackatom-with-failure-modes branch from 78759c4 to fdb5ec1 Compare February 7, 2020 17:56
@ethanfrey ethanfrey marked this pull request as ready for review February 7, 2020 17:58
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Good stuff. Some comments.

Do we want this in the 0.6 branch?

contracts/hackatom/src/contract.rs Outdated Show resolved Hide resolved
contracts/hackatom/src/contract.rs Show resolved Hide resolved
contracts/hackatom/src/contract.rs Outdated Show resolved Hide resolved
contracts/hackatom/tests/integration.rs Outdated Show resolved Hide resolved
lib/vm/src/backends/singlepass.rs Outdated Show resolved Hide resolved
lib/vm/src/backends/singlepass.rs Show resolved Hide resolved
@ethanfrey
Copy link
Member Author

Do we want this in the 0.6 branch?

I wanted this primarily to test the soon-to-be released wasmd binary, so you, need it on 0.6. It should be merged into 0.7 as well. This doesn't break any APIs, just changes the format of the test contract (but nothing but our test code should depend on that)

@ethanfrey
Copy link
Member Author

Okay, I believe I fixed all points from the review

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

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

Nice.

I wonder if the checked-in contract changed due to renamings of internal functions. Anyways, there should not be a functional difference.

@ethanfrey ethanfrey merged commit 3351c30 into master Feb 9, 2020
@ethanfrey ethanfrey deleted the hackatom-with-failure-modes branch February 9, 2020 11:52
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