-
Notifications
You must be signed in to change notification settings - Fork 667
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
Costs-3 contract #3267
Costs-3 contract #3267
Conversation
Codecov Report
@@ Coverage Diff @@
## next #3267 +/- ##
==========================================
- Coverage 29.60% 29.56% -0.04%
==========================================
Files 279 284 +5
Lines 251259 258262 +7003
==========================================
+ Hits 74378 76354 +1976
- Misses 176881 181908 +5027
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Wow! 🤯 Do we know if there's a way to speed these operations up? Curious if this is due to a natural average MARF key-path lengthening that will naturally occur at a logarithmic scale as more data gets added, or if this is due to an artifact / regression of the reference implementation. |
Notes from the blockchain meeting:
|
@pavitthrap raised a good point about the advantages of using the real backend versus the mocked backend -- this kind of relates to a question about the size of the MARF used in the benchmarks. Do you know approximately how many keys were in the MARF, and how many MARF "blocks" there are in the database? |
Update: will replace the MARF with a smaller one (up to 10 blocks). |
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.
Update: will replace the MARF with a smaller one (up to 10 blocks). Will re-benchmark the functions with the new MARF once the PR for the function
replace-at
is done.
Is this updated to use the mocked out MARF?
Is there a link to the data?
Need a function for |
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
@pavitthrap does the benchmark with real MARF use HDD or SSD? |
|
It uses a standard persistent disk, so HDD. |
…ty function to its cost function
I'll be addressing #3380 and #3381, so I'll see about adding the contract when I do that. |
N.B. the benchmarks for I/O should use an SSD, because we don't want seeks and filesystem implementation details to interfere with benchmarks. |
…t we actually need
Okay @gregorycoppola @obycode @igorsyl @a3slade, I've made a few optimizations to this PR so that the cost functions for the Once #3389 merges, I'll go and add cost functions for the bitwise operators. This PR also addresses #3266. |
… -- it's inconsistent with the old behavior
Okay, had to revert the implementation of |
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
|
…so we can use newer cost functions in later epochs without having to make multiple blocks
…d for `as-contract`)
… with pox-2 and costs-3, and will have epoch 2.1 set
Description
This PR adds new cost functions for the Clarity2 functions, and adds the costs-3 contract.
For the most part, the new costs contract does not alter old costs. However, as part of this benchmarking effort, I revamped the mocked data used (database and MARF accesses are now much more realistic). I also caught a few errors related to the computation of the input size (which only significantly altered one cost function). These changes led to a few cost changes. I provide a list of the altered costs below:
get_stx_balance_snapshot
(DB access)get_stx_balance_snapshot
(DB access)We are now using version 0.21.0 of the Rust
secp256k1
library. When we benchmarked the costs-2 contract, the version of this library was at 0.19.0. Due to improvements in these libraries, the runtimes for the following functions changed.Applicable issues
.costs-3
contract for Stacks 2.1 and associated benchmarking #3115Additional info (benefits, drawbacks, caveats)