Repository navigation
Conversation
Adds a small rue-clvm crate for converting CLVM to and from text, and removes the chialisp dependency from the workspace. The text format is clearer than chialisp's: - Programs and values are written separately. Values never use operator keywords, so condition lists and data print as numbers. - Integers up to 8 bytes are written as decimal rather than hex. - Strings escape `"` and `\`, so every value round-trips. - Operators longer than 2 bytes (the secp ops) are written by name. - The parser rejects trailing input, stray `)`, malformed numbers, and a `.` with nothing before it, and `;` always starts a comment. Also bumps clvmr to 0.21 along with clvm-traits and clvm-utils 0.51. The flags used to run programs now live in rue_lir::CLVM_FLAGS, which leaves out DISABLE_OP so that modpow keeps working.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rue-clvm, a small crate for converting CLVM to and from text. It replaceschialisp, which is no longer a dependency anywhere in the workspace.clvmrfrom 0.16 to 0.21, andclvm-traitsandclvm-utilsto 0.51.Text format changes
The new format is not 1:1 with chialisp. It is meant to be easier to read:
disassemble_programuses operator names for the first item of every list.disassemble_valuenever uses operator names, so run outputs, raise values and debug prints show data as data. For example,(q 2 3)is now(1 2 3), and condition lists show(51 …)instead of(g1_negate …).1000000instead of0x0f4240. Larger atoms such as hashes and keys stay hex."and\are escaped; before, a string containing"printed as hex, and one containing\didn't parse back to the same value.), malformed numbers like1abc, and a.with nothing before it.;always starts a comment, even directly after an atom.0xparses as empty bytes. The#prefix is gone.A randomized round-trip test checks that 100,000 random values print and then parse back to the same value, in both modes.
clvmr 0.21
ClvmFlagsbitflags type. The flags used to run programs now live in one place,rue_lir::CLVM_FLAGS.MEMPOOL_MODEnow includesDISABLE_OP, which turns offmodpowunlessNEW_COST_MODELis set.CLVM_FLAGSleaves outDISABLE_OP, so Rue behaves the same as before. Otherwise themodpowbuiltin test fails withunimplemented operator. We may want to revisit this to match current mempool rules.Snapshot changes
The YAML changes come from the format changes above. The
outputfields change the most. Where a test returns a function, its output now shows opcodes as numbers.Testing
cargo test --workspace,cargo clippy --all-targets,cargo fmt --check,cargo macheteandrue fmt --checkall pass locally.wasm32-unknown-unknownlocally (target not installed).Note
Medium Risk
Large dependency and CLVM-runtime surface-area change (crypto ops, flags, text I/O) with behavior preserved via snapshots, but stricter parsing and different disassembly can break external tooling that assumed chialisp format.
Overview
Releases Rue 0.11.0 and drops the
chialispdependency in favor of a new in-treerue-clvmcrate that parses and prints CLVM text (assemble,disassemble_program,disassemble_value), with operator tables, unit tests, and a 100k-value round-trip test.clvmris upgraded to 0.21 (withclvm-traits/clvm-utils0.51). Call sites switch toClvmFlagsand sharedrue_lir::CLVM_FLAGS(mempool mode + keccak, explicitly not clearingmodpowviaDISABLE_OP). CLI, tests, WASM, const eval, and debug dialect all route throughrue-clvminstead of chialisp binutils.The text format is intentionally different: programs use operator keywords; run outputs and debug prints use value mode (numeric opcodes, decimal ints ≤8 bytes, named secp ops, stricter parsing). Expect widespread YAML snapshot updates to
output/programstrings only—execution costs in snapshots are unchanged.Reviewed by Cursor Bugbot for commit 5866ffa. Bugbot is set up for automated code reviews on this repo. Configure here.