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

parse-tx too expensive #3

Open
friedger opened this issue May 18, 2021 · 2 comments
Open

parse-tx too expensive #3

friedger opened this issue May 18, 2021 · 2 comments

Comments

@friedger
Copy link

Calling read-only function parse-tx fails with

Error: Unchecked(CostBalanceExceeded(ExecutionCost { write_length: 0, write_count: 0, read_length: 42572, read_count: 3, runtime: 1001249000 }, ExecutionCost { write_length: 0, write_count: 0, read_length: 100000, read_count: 30, runtime: 1000000000 }))
    parseReadOnlyResponse utils.ts:198

This was already mentioned in stacksgov/grants-program#92 (comment)

@jcnelson
Copy link
Owner

I'm not surprised. The code here is meant to demonstrate feasibility of parsing Clarity code, but there is more work that needs to be done in the VM to make certain functions cheaper. For example, Stacks 2.1 will have a cheap way to read byte slices out of a buff, which would remove all the expensive calls to index-of.

What was the transaction you tried to parse?

@friedger
Copy link
Author

friedger commented May 18, 2021

PoX tx on testnet: https://api.blockcypher.com/v1/btc/test3/txs/7ad9187efd4fa01ce8690015a1a711d7958f18c248fb4c47a32d00732cfc4a61?limit=50&includeHex=true

0x0100000001c8bd3502a21f810da7692e323cc46e0e9ec1def7a93cc610f6d65b60193174e2030000006a47304402204ffe267e6b5aab28350be80c1f4ea94424c483f3f44f175594bb6273000f80e8022042ebd5668420c8b29d2ec2791e2c8aa0d7784d8a6283f958fe581e0be129c61b0121037435c194e9b01b3d7f7a2802d6684a3af68d05bbf4ec8f17021980d777691f1dfdffffff040000000000000000536a4c5058365b13588072c8b4eca88a505db5c453123c5c91db98d90ac1cd124402dba596531ebf945361dbdbcb0a43e8d6984ab8eee14982d0341eab198fc74d2d917c6d95dc001e21c20008001e1fc2001d0210270000000000001976a914c70e1ca5a5ef633fe5464821ca421c173997f38888ac10270000000000001976a9146c575e9f31715b180b22738136895876ade678cb88ac752f7c5c000000001976a914ba27f99e007c7f605a8305e318c1abde3cd220ac88ac00000000

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