Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

WASM parse payload from panics #7097

Merged
merged 3 commits into from Nov 21, 2017
Merged

WASM parse payload from panics #7097

merged 3 commits into from Nov 21, 2017

Conversation

pepyakin
Copy link
Contributor

This change implements a new format of a panic payload (see openethereum/pwasm-std#42).
So if a contract has been compiled with a pwasm-std/panic_with_msg feature then it's panic messages will be printed (by default they are stripped).

Example of a panic message:

arithmetic operation overflow, /Users/pepyakin/.cargo/registry/src/github.com-1ecc6299db9ec823/bigint-4.2.0/src/uint.rs:1227:0

Impl payload

empty str is none

Update tests

Clean

Update wasm-tests
@parity-cla-bot
Copy link

It looks like @pepyakin signed our Contributor License Agreement. 👍

Many thanks,

Parity Technologies CLA Bot

@pepyakin pepyakin added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Nov 20, 2017
@5chdn 5chdn added this to the 1.9 milestone Nov 20, 2017
@NikVolf NikVolf added A8-looksgood 🦄 Pull request is reviewed well. B0-patch and removed A0-pleasereview 🤓 Pull request needs code review. labels Nov 20, 2017
@pepyakin pepyakin changed the title Parse payload from panics WASM parse payload from panics Nov 20, 2017

Err(UserTrap::Panic(msg).into())
}
let payload_len = context.value_stack.pop_as::<i32>()? as u32;
Copy link
Collaborator

Choose a reason for hiding this comment

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

use tabs instead of spaces

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! It happened after I copied this chunk after rustfmt : (

@debris debris added A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. and removed A8-looksgood 🦄 Pull request is reviewed well. labels Nov 21, 2017
@pepyakin pepyakin added A0-pleasereview 🤓 Pull request needs code review. and removed A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. labels Nov 21, 2017
@NikVolf NikVolf added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Nov 21, 2017
@debris debris merged commit 2650154 into master Nov 21, 2017
@debris debris deleted the panic-payload-with-msg branch November 21, 2017 14:01
tomusdrw pushed a commit that referenced this pull request Dec 4, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants