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

STAGING -> MASTER #4848

Merged
merged 28 commits into from
Mar 14, 2024
Merged

STAGING -> MASTER #4848

merged 28 commits into from
Mar 14, 2024

Conversation

rohanjadvani
Copy link
Member

Summary

Testing Plan

Documentation

Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference
)? If yes, link a
related documentation pull request for the website.

[ ] Yes

Breaking Change

Is this a breaking change? If yes, add notes below on why this is breaking and
what additional work is required, if any.

[ ] Yes

hughy and others added 27 commits March 7, 2024 09:17
* handles errors in participant creation

wallet/multisig/createParticipant returns DUPLICATE_ACCOUNT_NAME error code if
account name or multisig secret name already exists

only prompts for new name if the error was from a duplicate name

* fixes test

import from module instead of sdk package
* supports listing all created identities

a user may create more than one identity in a single wallet and may wish to
retrieve the names of all identities that they have created

adds an RPC, wallet/multisig/getIdentities, to return a list of all names and
identitites that a wallet has created

makes '--name' argument optional in `wallet:multisig:participant` command

if a user does not specify a name, prompt them with a selector that lists all
available names

* sorts identities by name
when a user creates a signing commitment using a multisig account their account
identity must be included in the list of signers in order for the commitment to
be valid

automatically includes the account's participant identity whether or not it was
passed to wallet/multisig/createSigningCommitment. relies on ironfish-frost for
deduplication when creating nonces
- Check for duplicate identities to make sure that max_signers is
  calculated correctly and according to expectations
- Check for hash collisions in FROST identifiers
- Removed unnecessary allocations and cloning
- Removed unused error kinds
* adding --watch flag to aggregate signatures

* adding pending transaction
allows user to confirm list of signers from signing package before creating
signature share

- adds NativeSigningPackage to napi layer, defines 'signers' and
  'unsigned_transaction' methods
- removes 'from_signing_package' from UnsignedTransaction,
  NativeUnsignedTransaction in favor of constructing from NativeSigningPackage
if a user tries to view details of an unsigned transaction that their account
isn't involved in then there may be no output for the transaction details. this
may be confusing when multisig commands prompt them to confirm, but there are no
details visible to confirm

always renders the 'Notes sent' and 'Notes received' headings if the transaction
has output notes

outputs a message that no notes could be decrypted if no sent or received notes
decryptable
* feat(ironfish): Try stored secrets when decrypting import

* feat(ironfish): Improve error message

* feat(cli,ironfish): Update multisig error
prompts for new name until the user inputs a unique name

checks names before trusted dealer so that import doesn't fail after accounts
have been created

includes small fix to RPC method to provide default undefined params
* supports json file input to multisig transaction commands

some of the multisig commands have very long inputs. it would be nice to be able
to pass in a file instead

defines a single schema for a JSON file containing any inputs to a command in
the multisig transaction signing flow

adds util functions for loading multisig JSON file and resolving input options
with any flags. uses flags over json settings if both are set

adds path flag to each command in multisig signing flow: 'commitment:create',
'commitment:aggregate', 'signature:create', 'signature:aggregate'

* changes multsig json key names to match flag names
All the items (functions, classes, etc) related to multisig have been
moved from the root of `@ironfish/rust-nodejs` to a `multisig`
namespace. This will help disambiguate names, and make it clear that
these items serve a specific purpose.
* verifies signing package signers in createSignatureShare

checks each signer identity in the input signing package against the set of
participants for the account

throws an error upon finding a signer that doesn't belong to the set

* adds test of signer verification

creates signing package, removes a participant from participants store to
simulate unknown signer
replaces outdated multisig test cases

changes encrypted multisig key format from binary to hex in '.key' file
checks that the number of commitments passed to
wallet/multisig/createSigningPackage is at least minSigners

prevents creating a signing package that cannot be used to create valid
signatures
… to (#4828)

* adding next step commands

* simplify wording

* removing empty string
@rohanjadvani rohanjadvani self-assigned this Mar 14, 2024
@rohanjadvani rohanjadvani requested a review from a team as a code owner March 14, 2024 19:00
when calculating witnesses at past tree sizes we cache the sibling hashes of
left nodes at the past tree size

the merkle tree has separate datastores for nodes and leaves. the cache is keyed
by node index, not leaf index.

when building the cache we incorrectly set a leaf index to a sibling hash. if
that index is visited as a node index when creating the witness, then the cached
value may be used incorrectly resulting in an invalid commitment.

the commitment may still be correct if that node index corresponds to a right
node or if the node index is overwritten by the correct sibling hash in the
cache while building the past root

there are four criteria for the merkle tree, past size, and witness index that
produce an incorrect commitment:
1. the leaf at leaf index `pastSize - 1` is a right leaf
2. the node at node index `pastSize - 2` is a left node
3. the node at node index `pastSize - 2` is _not_ on the path from the leaf
`pastSize - 1` to the root (or the incorrect cache would be overwritten
4. the node at node index `pastSize - 2` is on the path from the witness leaf
index to the root

these criteria depend on the tree size, past size, and witness index, so
reproducing the incorrect commitment is somewhat random. an example that
produces the incorrect commitment is a tree size of 128, a pasts ize of 74, and
witness indexes of 68 or 69

adds regression test for witness creation issue

treeSize 128
pastSize 74
index 68 (or 69)
@rohanjadvani rohanjadvani merged commit 04d3678 into master Mar 14, 2024
13 checks passed
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.

7 participants