keep-starknet-strange / shinigami

Bitcoin Script VM in Cairo
https://shinigamibtc.dev
MIT License
57 stars 56 forks source link

[bug] Error in script like 'OP_0 OP_IF OP_PUSHDATA1 0x4c 0x8181...8181 OP_ENDIF OP_1' #180

Closed b-j-roberts closed 1 month ago

b-j-roberts commented 1 month ago

There is currently an error in scripts defined like OP_0 OP_IF OP_PUSHDATA1 0x4c 0x8181...8181 OP_ENDIF OP_1 due to a disabled opcode being contained in the data which should be ignored from OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4 push opcodes inside unexecuted if statements.

This is a very similar issue to what was resolved in this PR, but for push data opcodes instead of data opcodes.

This link explains how pushdata opcodes work, which should be useful in helping determine how many bytes to skip while executing.

How to reproduce:

scarb cairo-run '[[],0,0,[140135624088450475610217147749187676300840157221817713006065969293516877944,99283136139014068768601023030988662693914077962589140923480615436517126456,86963330924683855855708925282617806739194812813946692779691050017387264049,99283136139014068768601023030988662693914077962589140923480615436517126456,86963330924683855855708925282617806739194812813946692779691050017387264049,99283136139014068768601023030988662693914077962589140923480615436515561296],115175239917286698924400433,11]'
b-j-roberts commented 1 month ago

@jsandinoDev Here is the issue for OP_PUSHDATAX we were discussing, comment here and I can assign you the issue. Thank you!

onlydustapp[bot] commented 1 month ago

Hey @b-j-roberts! Thanks for showing interest. We've created an application for you to contribute to shinigami. Go check it out on OnlyDust!

jsandinoDev commented 1 month ago

Hi @b-j-roberts I would like to work on this!

onlydustapp[bot] commented 1 month ago

Hey @jsandinoDev! Thanks for showing interest. We've created an application for you to contribute to shinigami. Go check it out on OnlyDust!

ScottyDavies commented 1 month ago

Hello @b-j-roberts can I please be assigned this task ?

b-j-roberts commented 1 month ago

Hey @jsandinoDev , have you been able to implement this bug fix?

jsandinoDev commented 1 month ago

Hi @b-j-roberts yes I hope to send my PR this monday!