gear-sv / gear-nano

bitcoin --> wasm engine
Other
1 stars 0 forks source link

Invalid method params can break state #4

Closed gWOLF3 closed 5 years ago

gWOLF3 commented 5 years ago

What happened?

Issue was found during the performance testing phase on contract ID # '3862ae21275acad4256c5e4a4a82b3662f53b3dfb9c96a29cb4df35b7c467b7a'

If we look inside our bus folder for the block that broke our state: '605216.json' , we see params such that the recipient address for 'transfer' was double string encoded: ' "s4": "[\"196Q9u4D7S7f43qTgWYgVFtL8ZJ9Km8Mj9\",30]" '.

seanavery commented 5 years ago

I think this should be solved with try catch around wasm call.

https://github.com/gear-sv/gear-nano/blob/master/bin/gearia.js#L120

gWOLF3 commented 5 years ago
Screen Shot 2019-10-28 at 11 53 47 AM

Validated that this is indeed fixed.