BlockstreamResearch / simplicity

Simplicity is a blockchain programming language designed as an alternative to Bitcoin script.
MIT License
305 stars 45 forks source link

Taptweak #254

Closed roconnor-blockstream closed 2 months ago

roconnor-blockstream commented 2 months ago

Add two new jets, a taptweak jet, and a tapdata jet.

roconnor-blockstream commented 2 months ago

This PR is ready for review. I've put it into draft state because we need to run the benchmarks on them, to assign them a cost. Once that is done I'll amend this PR to add those costs, and adjust the CMRs appropriately.

I think @apoelstra will be doing the benchmarks??

While that is being done we can simultaneously run this PR through @apoelstra's CI and generally review the PR.

apoelstra commented 2 months ago

My benchmark computer will be busy for the next several hours (including running tests on this draft PR) but I will try to get these benchmarks run today.

apoelstra commented 2 months ago

TapdataInit:

{
  "best_name": "unit_2",
  "best_value": 630.355508333529,
  "median_name": "unit_3",
  "median_value": 654.1267159364477,
  "worst_name": "unit_1",
  "worst_value": 654.8088901361084
}

BuildTapTweak:

{
  "best_name": "xo_pt_ge_offc_fe_outofrange_+_hi-bits_0",
  "best_value": 723.1729932177461,
  "median_name": "xo_pt_ge_offc_fe_lo-bits_+_lo-bits_4",
  "median_value": 29087.074000000004,
  "worst_name": "xo_pt_ge_oncurve_+_lo-bits_4",
  "worst_value": 51562.63
}

I sent the full data to you in another channel in case you want to sanity-check the overall results.

roconnor-blockstream commented 2 months ago

I've incorporated the benchmarks.