Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How are hashing ops limits applied in the case of p2sh? #14

Closed
cculianu opened this issue Apr 10, 2024 · 1 comment
Closed

How are hashing ops limits applied in the case of p2sh? #14

cculianu opened this issue Apr 10, 2024 · 1 comment

Comments

@cculianu
Copy link
Contributor

cculianu commented Apr 10, 2024

In the spec, what is the definition of an “evaluation” for the purposes of hitting the hash ops limit? For example, a p2sh:

(1) evaluates the locking script, hashing the redeemscript via e.g. OP_HASH160 or whatever.
(2) then it evaluates the redeemscript (which itself may contain further hashing op codes).

When (2) begins evaluating redeemscript, is the hash count reset to 0 or does it continue where (1) left off for the counts?

EDIT: So far in my test implementation, I am having it not reset to 0 as it proceeds to the redeemscript, thus the hashOps count is 1 when the redeemScript begins execution in the p2sh case.

@bitjson
Copy link
Owner

bitjson commented Aug 12, 2024

Fixed and noted in changelog (Note accounting of P2SH redeem bytecode digest iterations (#14)) by 4eba48e 🚀

@bitjson bitjson closed this as completed Aug 12, 2024
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

No branches or pull requests

2 participants