Skip to content

Conversation

@devashishdxt
Copy link

No description provided.

assert!(cache_ptr.is_null());
assert!(error_msg.is_some());
let msg = String::from_utf8(error_msg.consume().unwrap()).unwrap();
assert_eq!(msg, "Error calling the VM: Cache error: Error creating directory broken\u{0}dir/state: data provided contains a nul byte");
Copy link

Choose a reason for hiding this comment

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

this error message isn't committed anywhere in the CW state, right?

Copy link
Author

Choose a reason for hiding this comment

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

Good point. I'll check.

Copy link

Choose a reason for hiding this comment

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

it's potentially also for third-party uses... for example, there was that issue in ibc-go where it committed the error message from Cosmos SDK and the message changed in Cosmos SDK seemingly non-breaking patches (within Cosmos SDK, it wasn't being committed to state anywhere).
but not sure whether wasmvm or wasmd would be used in a similar manner -- @webmaster128 @ethanfrey

Copy link
Author

Choose a reason for hiding this comment

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

This error only happens when initializing cache. In wasmd, init_cache function will get called here during keeper creation. So, I don't think it gets committed to CW state anywhere.

Copy link
Author

Choose a reason for hiding this comment

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

App will panic if this error happens.

Copy link

Choose a reason for hiding this comment

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

elements_memory_cache: 0,
size_pinned_memory_cache: 5665691,
size_memory_cache: 0,
}
Copy link
Member

Choose a reason for hiding this comment

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

@uint are you aware of an implementation similar to this assert_approx_eq but with a relative epsilon? I don't want to say 5665691 +/- 665691 but 5665691 +/- 15%. We could use that for some gas tests as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Jakub or Bart (I don't remember) actually did that for Isotonic. It's easy to implement. I'd just write our own macro in cosmwasm and maybe open a PR to the assert_approx_eq crate.

Copy link
Member

Choose a reason for hiding this comment

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

That would be much appreciated!

Copy link
Member

Choose a reason for hiding this comment

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

This particular issue should be solved as part of #351

@webmaster128
Copy link
Member

This is superseded in #360 using a different approach to some of the changes here. However, this work has been very helpful to bring up the challenges and solve them in small steps. Thanks a lot @tomtau and @devashishdxt.

Full Windows .dll support upstream can be expected as part of the 1.2.0 release.

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.

4 participants