feat: implemented multiple signer count#751
Open
muhahahmad68 wants to merge 1 commit intodotandev:mainfrom
Open
feat: implemented multiple signer count#751muhahahmad68 wants to merge 1 commit intodotandev:mainfrom
muhahahmad68 wants to merge 1 commit intodotandev:mainfrom
Conversation
Owner
|
fix the newest conflicts, please. |
Owner
|
fix these conflicts, when you can, please. |
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
Fixes #586 . When a contract deployment requires multiple signers, the simulate endpoint now mocks the presence of those signatures so the Soroban host charges realistic ed25519 verification budget and produces an accurate gas estimate.
Without this change, a dry-run on an unsigned or partially-signed multisig transaction shows the host zero signature verification work, systematically underestimating the fee. The on-chain transaction is then submitted with an insufficient fee and fails.
Root Cause
At dry-run time the
DecoratedSignaturelist in the transaction envelope is empty or partially filled — the transaction has not yet been fully signed by all required parties. The Soroban host meters ed25519 verification cost per signature present in the envelope, so an empty list means zero metered cost and an underestimated budget.Changes
internal/cmd/dry_run.goextractSignerCountFromEnvelope— auto-detects the right signer count in priority order: (1) use existingDecoratedSignaturesif present, (2) countInvokeHostFunctionoperations as a proxy, (3) fall back to 1--mock-signersflag — explicit override when the caller knows the exact auth policy (e.g.--mock-signers 3for a 3-of-5 multisig)MockSignersthrough toSimulationRequestMock signers used for gas estimation: Nin the output so the estimate is auditableAuto-Detection Logic
For the common case where
--mock-signersis not supplied:InvokeHostFunctionops → use op count (each invoke needs ≥1 signer)Callers with a known multisig policy should always pass
--mock-signersexplicitly for a precise estimate.Testing
Type of Change
Checklist
VecMcap (20) without panicking--mock-signersoverrides when neededmock_signersisOption<u32>/omitempty; existing callers that don't send the field get the old behaviour