Repository navigation
Conversation
This branch has not been deployed
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.
Fixes #479
The bug
computeRequiredKeyHashesSyncderives the signing keys from inputs, withdrawals and certificates, but never inspectsvotingProcedures(body key 19). The tx builder's Vote operation likewise only tracks redeemers for script voters and never adds a key-hash voter torequiredSigners. A governance vote cast by a key-hash DRep, a constitutional-committee member, or a stake pool was therefore never signed by the wallet, and the node rejects the under-signed transaction.Reproduced first (all RED on main): a transaction whose only wallet-relevant field is a
votingProceduresentry for a key-hash DRep voter equal to the seed wallet's stake credential makessignTxreturn an empty witness set. The committee and stake-pool cases fail the same way. On the builder side, a built vote transaction carries norequiredSignersentry for its key-hash voter.The fix
Signing.ts—computeRequiredKeyHashesSyncgains avotingProceduresbranch that mirrors the certificate logic already in the same function:DRepVoterwith aKeyHashDRepdrep → matched againststakeKhHex(same as theRegDrepCerthandling)ConstitutionalCommitteeVoterwith aKeyHashcredential → matched againststakeKhHex(same as theAuthCommitteeHotCerthandling, which likewise matches the committee credential against the stake key hash)StakePoolVoter→poolKeyHashmatched againstpaymentKhHex(same as thePoolRegistration/PoolRetirementhandling)Vote.ts—createVoteProgramcollects the key hash of every key-hash voter (keyHashVoter: DRep key hash, committee key-hash credential, or the pool key hash as aKeyHash) and merges it into the builder state'srequiredSigners, deduplicated withEqual.equalsexactly like theAddSigneroperation — so a transaction built by the SDK asks for the voter's witness in the body itself.Deliberately left out
The issue also says to "apply the equivalent for
proposalProcedures". A proposal procedure carries no voter, and none of its fields is a signing requirement the wallet derivation maps to in the way a voter is: itsrewardAccountis the deposit-return account (receiving a refund is not a signing act), and the governance actions embed no voter identity either. Rather than invent a signer rule for it, I left proposals alone and would welcome maintainer direction on what the equivalent should be if I am misreading the ledger rule.Tests
Two new files, 8 tests, each verified RED on main before the fix (controls PASS on both sides):
Signing.GovernanceVoters.test.ts(5): seed wallet signs a DRep vote with the stake key, a committee vote with the stake key, and a stake-pool vote with the payment key — asserting the exact witness key hash in each case; script-hash DRep voter and unrelated key-hash DRep voter produce no witness (controls).TxBuilder.GovernanceRequiredSigners.test.ts(3): the built body'srequiredSignerscontains the voter's key hash for the DRep, committee, and stake-pool voters.Full suite: 1686 passed / 75 skipped / 0 failed, test files 103 passed / 1 skipped of 104 — exactly main's 1678 baseline + the 8 new tests, and 101 baseline files + the 2 new files.
tsc --noEmitclean, eslint clean, prettier parity with main on both source files (10 = 10 diff lines onSigning.ts, 0 = 0 onVote.ts). Changeset added (patch).Built by an independent Cardano developer — not affiliated with the Cardano Foundation, IOG, or Intersect.
@Kshot9000 (https://x.com/kshot9000) · ADA: addr1q8hnl6vl5a6k3rw3n5g3jtte696zcl76kfatzv7gpswa9r0dj7fma6klq55y4ffm7tf0em09udnyhuk4ah92pl5x9jpqjae44v
cc @cardano-foundation @IntersectMBO