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

Possible cost calculation issue #524

Closed
whoabuddy opened this issue Aug 29, 2022 · 1 comment
Closed

Possible cost calculation issue #524

whoabuddy opened this issue Aug 29, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@whoabuddy
Copy link
Contributor

We deploy a "tardis" contract that uses at-block to pull historical information from CityCoins contracts. It's a very basic contract and used in conjunction with a vote contract as seen here:

For an upcoming vote, we've deployed a new tardis / GitHub and it is failing because it exceeds the read length (107905 / 100000):

Unchecked(CostBalanceExceeded(ExecutionCost { write_length: 0, write_count: 0, read_length: 107905, read_count: 17, runtime: 125602 }, ExecutionCost { write_length: 0, write_count: 0, read_length: 100000, read_count: 30, runtime: 1000000000 }))

When testing a similar, local version of the contract, the output of clarinet test --costs shows this value as much lower:

├──────────────────────────────────────────┼──────────┼──────────────────────────┼──────────────────────┼─────────────────────────┼─────────────────────┼──────────────────────┼──────────────┤
│                                          │ # Calls  │ Runtime (units)          │ Read Count           │ Read Length (bytes)     │ Write Count         │ Write Length (bytes) │ Tx per Block │
├──────────────────────────────────────────┼──────────┼──────────────────────────┼──────────────────────┼─────────────────────────┼─────────────────────┼──────────────────────┼──────────────┤
│ get-stacker-stats                        │        3 │  min:  114042  (0.002%)  │  min:  18  (0.120%)  │  min:  91411  (0.091%)  │  min:  0  (0.000%)  │   min:  0  (0.000%)  │          833 │
│                                          │          │  max:  114042  (0.002%)  │  max:  18  (0.120%)  │  max:  91411  (0.091%)  │  max:  0  (0.000%)  │   max:  0  (0.000%)  │          833 │
│                                          │          │  avg:  114042  (0.002%)  │  avg:  18  (0.120%)  │  avg:  91411  (0.091%)  │  avg:  0  (0.000%)  │   avg:  0  (0.000%)  │          833 │
├──────────────────────────────────────────┼──────────┼──────────────────────────┼──────────────────────┼─────────────────────────┼─────────────────────┼──────────────────────┼──────────────┤

The core contract that the tardis contract queries for information did increase slightly in size, and I think I have a workaround, but it would've been nice if the cost testing showed this could be a potential issue.

See citycoins/contracts#208 for more detail.

@hugocaillard hugocaillard moved this to 🆕 New in DevTools Aug 30, 2022
@obycode obycode moved this from 🆕 New to 🔖 To do in DevTools Aug 30, 2022
@lgalabru
Copy link
Contributor

lgalabru commented Oct 6, 2022

Should be addressed with the latest VM integration #544

@lgalabru lgalabru added bug Something isn't working 1.0 labels Oct 6, 2022
@lgalabru lgalabru closed this as completed Oct 7, 2022
Repository owner moved this from 🔖 To do to ✅ Done in DevTools Oct 7, 2022
@lgalabru lgalabru removed this from DevTools Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants