fix(interpreter): wrap Resolver closures in Arc::new for upstream API change#865
Draft
mwaddip wants to merge 2 commits into
Draft
fix(interpreter): wrap Resolver closures in Arc::new for upstream API change#865mwaddip wants to merge 2 commits into
mwaddip wants to merge 2 commits into
Conversation
…ver API The local fork at ~/projects/ergo_avltree_rust/ (HEAD 879545c) changed the Resolver type from `fn(&Digest32) -> Node` to `Arc<dyn Fn(&Digest32) -> Node + Send + Sync>` (fork commit 28862a1) to support stateful persistence-backed resolvers. The fork-corrected contains semantics (fork commit 879545c) is the canonical reference for the ergots TypeScript port's AVL+ verifier, so ergots' fixture-gen applies [patch.crates-io] to redirect ergo_avltree_rust to the fork. That redirection forces ergotree- interpreter to compile against the new Resolver API. This commit wraps every bare-closure Resolver call site in Arc::new(...) so ergotree-interpreter compiles cleanly against the fork. Identical to the migration upstream sigma-rust would need if/when the fork's API change merges into a future ergo_avltree_rust release. Affects: savltree.rs (10 sites incl. tests), tree_lookup.rs (2 sites). No semantic behavior changes — pure type-level adaptation. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…test Completes the Arc<dyn Fn> Resolver API-compat fix from ff2c514. The prior commit wrapped 12 of 13 closure call sites (10 in savltree.rs + 2 in tree_lookup.rs) but missed the test-only site in create_avl_tree.rs at the eval_create_avl_tree fn. Adds `use alloc::sync::Arc` and `use ergo_avltree_rust::operation::Digest32` inside the test mod, then wraps the bare closure in the same Arc::new(|digest: &Digest32| ...) pattern used everywhere else. Canonical build environment for integration/ergots is via the ergots/fixture-gen `[patch.crates-io] ergo_avltree_rust = { path = ... }` directive which routes to the local fork at ~/projects/ergo_avltree_rust/ (HEAD 879545c). Confirmed clean fixture-gen build (4.63s) with this edit. Standalone `cargo build` from the worktree fails by design under the new Resolver API — the integration/ergots branch is incompatible with crates.io ergo_avltree_rust@0.1.1's bare-fn-pointer API, by intent (per option A of the prior session's discussion). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Adapts the 13 AVLTree::new call sites in ergotree-interpreter (savltree.rs, tree_lookup.rs, create_avl_tree.rs) from bare fn closure to Arc::new(...), matching the Resolver type change in ergoplatform/ergo_avltree_rust#10. Arc not Box because AVLTree: Clone.
Draft. Blocked on #10 merge + ergo_avltree_rust version bump. Locally validated on integration/ergots via [patch.crates-io].