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

Make clvm_rs a replacement for clvm #253

Draft
wants to merge 46 commits into
base: main
Choose a base branch
from
Draft

Conversation

richardkiss
Copy link
Contributor

@richardkiss richardkiss commented Feb 7, 2023

This draws a lot of ideas from various places. Here are the key points:

  • the CLVMStorage protocol is fundamental. It has two attributes: atom and the property pair, which is an implicit method call
  • Program is the high level wrapper around the low level protocol CLVMStorage. All API is here
  • there are only two public exports: Program and EvalError (from clvm_rs import Program, EvalError). Users shouldn't need any others
  • run is only supported via rust, and returns a LazyNode which conforms to CLVMStorage (and is generally wrapped by Program)
  • sha256tree values are cached when possible all through the tree
  • SerializedProgram is no longer needed as CLVMTree replaces it

CLVMTree is great. Here's why:

  1. parses quickly in rust and returns pointers to the parsed blob to use as the storage for the atom
  2. calculates sha256tree values (optionally, but by default) on parse, for the whole tree
  3. caches serialized representations on parse, for the whole tree
  4. ideal for use with MOD templates, as curry will be fast, hashing will be fast, and deserialization will be fast
  5. maintains these benefits when wrapped by Program

@@ -0,0 +1 @@
bytes32 = bytes
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still need to figure out what to do about this.

@richardkiss richardkiss marked this pull request as draft February 8, 2023 01:14
wheel/python/clvm_rs/curry_and_treehash.py Outdated Show resolved Hide resolved
wheel/python/clvm_rs/eval_error.py Outdated Show resolved Hide resolved
wheel/python/clvm_rs/program.py Outdated Show resolved Hide resolved
wheel/python/clvm_rs/program.py Outdated Show resolved Hide resolved
@github-actions
Copy link

'This PR has been flagged as stale due to no activity for over 60
days. It will not be automatically closed, but it has been given
a stale-pr label and should be manually reviewed.'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants