-
Notifications
You must be signed in to change notification settings - Fork 668
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
Feat/clarity cli costs json #2597
Conversation
…nally report runtime costs and asset movements, and will output everything in JSON
…ting asset movement in clarity-cli)
with this, I can get the oracle contract costs:
thank you @jcnelson ! now I can experiment and reduce cost, hopefully dramatically |
I think there's still a bug in the
|
Actually, I'm not sure this is a bug -- I think this is may be working as intended. Please see #2605 for further analysis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me -- I think it should just avoid duplicating the HELIUM limit definition.
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @jcnelson!
I think all feedback has been addressed, and the PR has since received 2 approvals. Moving to dismiss this review so as to merge the PR (Github won't let me otherwise).
This PR addresses #2573 and implements PR #2587.
clarity-cli
binary will install the chain bootcode into the CLI's database, so.pox
,.bns
,.costs
, and.cost-voting
are now always available.clarity-cli
binary, when instantiating the database, will take an optional--testnet
flag to indicate to use the testnet settings for the chain bootcode, as well as use the testnet block limits when running code. This will be honored in subsequent commands that rely on the database.clarity-cli
binary now accepts a--costs
switch forcheck
,launch
,execute
,eval
,eval_at_chaintip
, andeval_at_block
. If given, the program will print out the runtime cost of the code executed.clarity-cli
binary now accepts a--assets
switch forlaunch
andexecute
. If given, the program will print out the JSON representation of theAssetMap
that was generated when the code executed.clarity-cli
binary will now enforce runtime costs oncheck
,launch
,execute
,eval
,eval_at_chaintip
, andeval_at_block
. Depending on whether or not the DB was instantiated with--testnet
, the mainnet or testnet block limits will be used. Theeval_raw
andrepl
directives are not affected by this; they continue to use the unlimited cost.clarity-cli
directives now write a JSON representation tostdout
, which should make it much easier forclarity-js-sdk
andclarinet
to interact it.I've asked @hstove and @zone117x to take a look at this as well, since this affects downstream clients.
Example run: