fix: add wit_split_card_index to queryWitnesses (follow-up to #8) - #9
Merged
Merged
Conversation
Follow-up to #8. The node constructs the Midnight contract in two places — actionWitnesses (midnight-actions.ts, fixed in #8) and queryWitnesses (midnight-query.ts, missed). Both must declare every witness the compiled contract requires, or `new Contract(...)` throws and the node crash-loops. initializeQueryContract was still dying on the missing wit_split_card_index. Added as a throwing stub matching the other query witnesses (the query contract only reads ledger state, never runs circuits). Co-Authored-By: Claude Opus 4.8 <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.
Follow-up to #8.
#8 added
wit_split_card_indextoactionWitnesses, but the node constructs the Midnight contract in two places, each with its own witnesses object:actionWitnesses(midnight-actions.ts) — fixed in fix: complete 0.100.21 mainnet deploy (witness, deploy script, frontend build, gateway routing) #8queryWitnesses(midnight-query.ts) — missedThe compiled contract's constructor validates that every declared witness has an implementation, so
initializeQueryContract(midnight-query.ts:122) was still throwing on the missingwit_split_card_index→ the node kept crash-looping after #8.Added as a throwing stub, matching the other
queryWitnessesentries — the query contract only reads ledger state and never runs circuits, so it should never actually invoke this witness (and fails loudly if it somehow does).Verified the crash trace points here:
After this merges I'll pull it on the box and confirm the node stays up.
🤖 Generated with Claude Code