keep-starknet-strange / shinigami

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

[bug] disabled, unimplemented, and unknown opcodes should throw an error regardless of IF conditions #109

Closed 0xBEEFCAF3 closed 2 months ago

0xBEEFCAF3 commented 2 months ago

How to reproduce: While developing the disabled opcodes feature I noticed that I can still use a disabled opcode if it is an IF block that is never executed. For example this script: OP_0 OP_IF OP_MUL OP_ELSE OP_DROP OP_ENDIF

The same is probably true of unkown opcodes as well. However this is not emulating bitcoin mainnet consensus rules. The interperter in bitcoin core will first check for disabled or unknown opcodes and throw before executing the current opcode.

https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L456

adrianvrj commented 2 months ago

Hi, is this open for contributions? If so, can I work on this?

ShantelPeters commented 2 months ago

Hello @0xBEEFCAF3 is this issue open for contribution? If yes, can I be assigned to it please

onlydustapp[bot] commented 2 months ago

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

ShantelPeters commented 2 months ago

I am applying for this issue via https://app.onlydust.com/p/shinigami

Please can I take this up ?

b-j-roberts commented 2 months ago

@adrianvrj would you still be interested in working on this? I'll assign you, but lmk if not.

We have been following the design of btcd pretty closely, so these links might help:

adrianvrj commented 2 months ago

@b-j-roberts I will take care of this one, ty very much