Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure payment template is available during coin selection and fee estimation is using it for multisig #3502

Merged
merged 9 commits into from
Oct 11, 2022

Conversation

paweljakubas
Copy link
Contributor

@paweljakubas paweljakubas commented Sep 19, 2022

  • Added script template of native script to tx skeleton and update tx size estimation basing on ledger's cddl

Comments

Minting/delegation/validity for multisig is going to be addressed in coming PRs. At this point single/multiple output multisig txs along with metadata support should work.

Issue Number

adp-2221

@paweljakubas paweljakubas force-pushed the paweljakubas/adp-2221/fee-adjustment-testnet branch from 8b886b2 to 93b76cb Compare October 10, 2022 11:21
@paweljakubas paweljakubas changed the title add unique input scripts to tx skeleton make sure payment template is available during coin selection and fee estimation is using it for multisig Oct 10, 2022
@paweljakubas paweljakubas changed the title make sure payment template is available during coin selection and fee estimation is using it for multisig Make sure payment template is available during coin selection and fee estimation is using it for multisig Oct 10, 2022
Copy link
Member

@Anviking Anviking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't see how the details work out but high level lgtm 👍

@@ -1820,9 +1826,10 @@ estimateTxSize era skeleton =

-- Total number of signatures the scripts require
numberOf_ScriptVkeyWitnesses
= sumVia scriptRequiredKeySigs txScripts
= sumVia scriptRequiredKeySigs txMintOrBurnScripts
+ maybe 0 scriptRequiredKeySigs txPaymentTemplate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The effect of this line seems to be to: "add sizeOf_VKeyWitness * scriptRequiredKeySigs if a payment template exists."

You also seem to be adding determinePaymentTemplateSize once.

I'd guess it should rather be determinePaymentTemplateSize * nInputs * scriptRequiredKeySigs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed! Thanks Johannes!

@paweljakubas
Copy link
Contributor Author

bors try

iohk-bors bot added a commit that referenced this pull request Oct 11, 2022
@iohk-bors
Copy link
Contributor

iohk-bors bot commented Oct 11, 2022

try

Build failed:

@paweljakubas
Copy link
Contributor Author

bors r+

iohk-bors bot added a commit that referenced this pull request Oct 11, 2022
3502: Make sure payment template is available during coin selection and fee estimation is using it for multisig r=paweljakubas a=paweljakubas

<!--
Detail in a few bullet points the work accomplished in this PR.

Before you submit, don't forget to:

* Make sure the GitHub PR fields are correct:
   ✓ Set a good Title for your PR.
   ✓ Assign yourself to the PR.
   ✓ Assign one or more reviewer(s).
   ✓ Link to a Jira issue, and/or other GitHub issues or PRs.
   ✓ In the PR description delete any empty sections
     and all text commented in <!--, so that this text does not appear
     in merge commit messages.

* Don't waste reviewers' time:
   ✓ If it's a draft, select the Create Draft PR option.
   ✓ Self-review your changes to make sure nothing unexpected slipped through.

* Try to make your intent clear:
   ✓ Write a good Description that explains what this PR is meant to do.
   ✓ Jira will detect and link to this PR once created, but you can also
     link this PR in the description of the corresponding Jira ticket.
   ✓ Highlight what Testing you have done.
   ✓ Acknowledge any changes required to the Documentation.
-->


- [x] Added script template of native script to tx skeleton and update tx size estimation basing on ledger's cddl

### Comments

Minting/delegation/validity for multisig is going to be addressed in coming PRs. At this point single/multiple output multisig txs along with metadata support should work. 

<!-- Additional comments, links, or screenshots to attach, if any. -->

### Issue Number
adp-2221
<!-- Reference the Jira/GitHub issue that this PR relates to, and which requirements it tackles.
  Note: Jira issues of the form ADP- will be auto-linked. -->


Co-authored-by: Pawel Jakubas <[email protected]>
@paweljakubas
Copy link
Contributor Author

bors r-

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Oct 11, 2022

Canceled.

paweljakubas and others added 2 commits October 11, 2022 14:38
 - single output
 - multi output
 - multi-assets
 - validity intervals
Copy link
Contributor

@piotr-iohk piotr-iohk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears that with most recent commit 7402995 this fixes ADP-2221. So far I haven't seen "invalid_transaction" on submission on preview network.

Also enabled submitting tx + additional assertions on following txs from shared wallets (e2e tests):

  • single output
  • multi output
  • multi-assets
  • validity intervals

@paweljakubas
Copy link
Contributor Author

bors r+

@iohk-bors
Copy link
Contributor

iohk-bors bot commented Oct 11, 2022

Build succeeded:

@iohk-bors iohk-bors bot merged commit 9c122c9 into master Oct 11, 2022
@iohk-bors iohk-bors bot deleted the paweljakubas/adp-2221/fee-adjustment-testnet branch October 11, 2022 18:37
WilliamKingNoel-Bot pushed a commit that referenced this pull request Oct 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants