We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Modular Exponentiation leads to resource exhaustion during script execution.
import { Transaction, Script } from '@bsv/sdk' const sourceTransaction = new Transaction() sourceTransaction.addInput({ sourceOutputIndex: 0, sourceTXID: 'beefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeefbeef', unlockingScript: Script.fromASM('OP_TRUE'), }) sourceTransaction.addOutput({ lockingScript: Script.fromASM('OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL OP_DUP OP_MUL'), satoshis: 1 }) sourceTransaction.merklePath = {} const tx = new Transaction() tx.addInput({ sourceTransaction, sourceOutputIndex: 0, unlockingScript: Script.fromASM('OP_2') }) tx.addOutput({ satoshis: 1, lockingScript: Script.fromASM('OP_TRUE') }) await tx.fee() await tx.sign() console.log(sourceTransaction.outputs[0].lockingScript.chunks.length / 2) await tx.verify('scripts only')
Script execution should fail once stack memory usage hits 100 MB since this is the max allowed in node's policy.
What actually happened?
If applicable, add screenshots or stack traces to help explain the issue.
@bsv/sdk
At 22 iterations my machine copes, beyond that it's noticeably lagging each time I add more iterations.
The limit to match current default policy should be 100MB.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug Description
Modular Exponentiation leads to resource exhaustion during script execution.
Expected Behavior
Script execution should fail once stack memory usage hits 100 MB since this is the max allowed in node's policy.
Actual Behavior
What actually happened?
Stack Traces or Screenshots
If applicable, add screenshots or stack traces to help explain the issue.
Environment
@bsv/sdk
version: 1.3.18Additional Information
At 22 iterations my machine copes, beyond that it's noticeably lagging each time I add more iterations.
The limit to match current default policy should be 100MB.
The text was updated successfully, but these errors were encountered: