arm_circuits: add guest feature-forwarding for borsh/bin serialization#209
Draft
AHartNtkn wants to merge 8 commits into
Draft
arm_circuits: add guest feature-forwarding for borsh/bin serialization#209AHartNtkn wants to merge 8 commits into
AHartNtkn wants to merge 8 commits into
Conversation
- Add borsh, sha2, solana-program, solana-secp256k1, dashu as optional deps - Add `borsh` and `solana` feature flags - Add k256 dev-dependency for tests without default features - Digest: add Borsh derive, make field public, add from_bytes/to_bytes methods - Digest: replace bytemuck::from_bytes with from_bytes() in TryFrom/FromHex - Constants: feature-gate VK bytes by solana (Borsh circuit vs risc0 serde circuit) - Constants: extract BATCH_AGGREGATION_VK_BYTES, add EMPTY_HASH_WORDS, bytes_to_words_const - Error: add DeltaPointNotOnCurve and DeltaMismatch variants Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Action, ComplianceInstance, ComplianceInstanceWords, ComplianceUnit - DeltaProof (placeholder), DeltaWitness (placeholder) + len/is_empty/as_slice - DeltaProof (k256), DeltaWitness (k256): manual BorshSerialize/BorshDeserialize - LogicInstance, AppData, ExpirableBlob, LogicVerifierInputs - Transaction, Delta Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- delta_proof: feature-gate hasher (SHA-256 for solana, Keccak-256 for EVM) - LogicInstance: split to_journal() into zkvm (risc0 serde) and borsh variants - LogicVerifierInputs: add instance_journal field for pre-serialized journal bytes - LogicVerifier: use pre-serialized instance_journal instead of recomputing - ComplianceInstance: add Solana borsh to_journal() impl - ComplianceWitness: relax feature gate from zkvm+k256 to just k256 - arm_test_app: add instance_journal to LogicVerifierInputs construction Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Uses Solana syscalls (hashv, secp256k1_recover) and solana-secp256k1 for EC point arithmetic instead of k256, which exceeds SBF stack frame limits. Module is gated on cfg(all(feature = "solana", not(feature = "zkvm"))). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- arm_circuits/Cargo.toml: add methods crates to workspace members - All methods/Cargo.toml: add borsh and bin features - All methods/build.rs: forward borsh/bin features to guest via GuestOptionsBuilder - All guest/Cargo.toml: add borsh/bincode deps, forward borsh to anoma-rm-risc0/borsh - All guest/src/main.rs: feature-conditional output (borsh/bincode/default risc0 serde) - compliance guest: add k256 and zkvm features to anoma-rm-risc0 dep - trivial_logic guest: add zkvm and k256 features with default-features = false - arm_test_app: add instance_journal to LogicVerifierInputs construction Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
14e21d7 to
3d87f52
Compare
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.
Problem
Circuit guests currently commit default
risc0-serde output only. For backend-specific flows, guest journal serialization must be selectable (borshorbin) and the selected feature must be forwarded from methods crates into guest builds.Changes
borshandbinfeatures to methods + guest crates for:compliancetrivial_logiclogic_testbatch_aggregationmethods/build.rs.risc0_build::embed_methods()risc0_build::embed_methods_with_options(...)withGuestOptionsBuilder::features(...)bin:bincode::serialize(...)+env::commit_slice(...)borsh:borsh::to_vec(...)+env::commit_slice(...)env::commit(...)arm_circuits/Cargo.tomlworkspace members to include methods crates used by this change.Scope
arm_circuits/*arm/*changes in this PRTracking
armcrate changes), Add EVM ABI encoding for circuit journal output #208 (EVM path)