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 #5627

Merged
merged 81 commits into from
Nov 7, 2024
Merged

Staging -> Master #5627

merged 81 commits into from
Nov 7, 2024

Conversation

danield9tqh
Copy link
Member

Summary

Release for version 2.9.0

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 label it with breaking-change-rpc or breaking-change-sdk.

[ ] Yes

hughy and others added 30 commits October 10, 2024 09:25
implements two session managers: one for dkg and one for signing

moves logic for waiting on multisig broker responses from 'dkg:create' and
'multisig:sign' into session managers

waits for confirmation of client connection before returning from connect

waits for confirmation of joining session before returning from join session
method
if a user inputs a duplicate string into a prompt from collectStrings, they will
be informed of the duplicate and the prompt will be repeated

adds option to allow duplicates

updates usage of collectStrings in 'wallet:multisig:dkg:create' and
'wallet:multisig:sign' not to error on duplicates
* uses session manager to collect all multisig inputs

defines abstract classes and interfaces for session managers to handle either
waiting on the broker server for data or waiting on CLI inputs

creates uniform session manager interfaces for either case in both signing
sessions and dkg sessions

removes interface distinction between starting and joining sessions with broker
server

* restores sessionId and connection string messages to session managers

* passes accountName to getIdentities in dkg

* updates session managers not to error on duplicate string entry

re-prompt instead
error messages from the multisig broker server include the originating messageId
in the error message. the client should cancel retries for a message that
results in an error message from the server
* multisig broker server disconnects on invalid message

if the broker server receives a message that it cannot parse then it should
disconnect from the client that sent the message

the server cannot send an 'ack' message to the client if it cannot parse the
message and cannot send an error message with the message id of the errant
message, so the client may continue retrying the malformed message if the server
does not disconnect

for now the server does not implement client banning

* adds debug log message on parsing error
error codes from the server will help the client to determine how to handle the
error message

Closes IFL-3072
gives the user feedback that the command is waiting on a connection to the
multisig broker server
updates server to send 'joined_session' message to client after starting the
session on the server side

updates session manager to wait for 'joined_session' message before returning
from startSession

adds ux status output when waiting for confirmation of joined session
adds a '--multisig' flag to use with the '--ledger' flag to import a multisig
account from the Ironfish DKG Ledger app

adds an 'importAccount' method to 'LedgerMultiSigner' to match the function
signature in the 'LedgerSingleSigner' class

updates 'wallet:multisig:ledger:import' to use the same lgoic

hides 'wallet:multisig:ledger:import' and adds a deprecation message
instead of requiring a passphrase at the time of client construction, sets the
client passphrase only when starting or joining a session

moves usage of 'parseConnectionOptions' into session manager for sessions that
use the multisig broker server

prompts the user for sessionId and passphrase in 'startSession'. this will allow
for re-prompting if starting or joining the session fails
Right now, if you input an invalid number for total participants or min
signers, it will end the process by throwing an error. A better experience is
to display the error and allow the user to try again with proper input.
if a user enters the passphrase for a session by the client is unable to decrypt
the session challenge string, the client emits a 'SessionDecryptionError'. the
'wallet:multisig:dkg:create' and 'wallet:multisig:sign' commands will now retry
the step and prompt the user to re-enter the passphrase

adds an event emitter, 'onClientError', to the multisig client. emitting client
errors as events provides a way for the command logic to define error handlers
to throw/catch the error in the control flow of the command instead of in
response to server data
…on phase (#5547)

* Clear identities when a user disconnects during the identity collection phase

* remove extra unneeded checks
listens for server error messages with the error code ofr sessionId not found
while waiting for a session. throws an error if the sessionId is not found
throws an error if client is unable to connect to multisig broker server within
one minute

repurposes unused property 'disconnectUntil' into 'tryConnectUntil'
supports passphrases that contain spaces and other unicode characters that would
result in invalid connection strings

decodes passphrase when parsing connection string
modifies multisigBroker messages so that each client submits its identity when
it starts or joins a session

simplifies the session flow by removing separate messages for submitting
identities
* adds confirmation prompt to 'multisig:sign' if using server

when running the 'wallet:multisig:sign' command using a broker server there are
no prompts or manual steps after the initial setup. this doesn't give the user a
chance to confirm the details of the unsigned transaction before the signing
process moves forward

adds a confirmation prompt if the 'sessionManager' is connected to a server

moves the rendering of transaction details and the confirmation prompt out of a
'retryStep' function so that confirmation isn't retried

* does not prompt for confirmation if user is using ledger

updates prompt message
* adds allowed identities set to multisig server sessions

server blocks any client from joining the session if its identity is not in the
set of allowed identities

sends the (encrypted) list of account identities to the server when starting a
signing session. guards against user accidentally joining signing session with
the wrong account

allowedIdentities is optional for dkg sessions, but there's not a clear way yet
of specifying this set

* removes allowedIdentities from DKG messages

* undoes unnecessary reformatting
when reviewing an unsigned transaction it will be helpful to display the
transaction fee and expiration

these fields are shown when reviewing the transaction on a ledger device, so we
should also display them on the CLI
if a user sets the hostname or port for the multisig broker server using flags
then they should not need to _also_ set the '--server' flag in order to connect
to the server

defines constants for default multisig broker hostname and port

removes default values for hostname and port flags in
'wallet:multisig:dkg:create' and 'wallet:multisig:sign' and applies defaults
only when flags are used. allows flags to be unset to determine whether user has
set the flags

adds factory functions for session managers
* wallet unlock log now uses renderspan w/ hr, min, sec

* Update unlock.ts

Fixed linting error:  added comma after forceMinute

* Removed renderSpan options from unlock
if a client disconnects from the multisig broker server unexpectedly then the
server will remove the client and its identity from the session

client automatically rejoins the session after automatically reconnecting so
that the server adds it and its identity back into the session
adds 'onDisconnected' event emitter to multisig broker client

uses 'onDisconnected' events in sessionManager to wait from confirmation that
client has reconnected to server and rejoined session

by using 'waitForConnectedMessage' and 'waitForJoinedSession' we display ux
status output to the user _and_ throw an error if the session can't be rejoined

updates session managers to conditionally start ux actions in polling loops.
this makes it so that the session manager won't clear the ux status output from
waiting to reconnect or rejoin a session while polling for session status
We were getting intermittent issues using the original codecov upload process,
which has been deprecated for a few years now. The coverage also has been
broken for some unknown amount of time. Using the github action is the
officially recommended way to upload to codecov now.
danield9tqh and others added 27 commits October 29, 2024 12:26
This way, it won't show up in the output of `cargo test`
This was missed during the transition from `jubjub` to `ironfish_jubjub`
adds a test that signs a transaction with a different key than the key used to
generate proofs for the transaction

the test confirms that signing the transaction with the wrong key succeeds, but
the transaction does not verify
this was printing the headers for every line because it was not checking the
no-headers table option
* logs warning if bootstrap node on different network

adds onMessage event handler to log a warning message if a bootstrap node is on
a different network than the user's node

outputs the warning without requiring verbose output and specifies that the peer
with the network mismatch is a bootstrap node

updates 'Peer.dispose' to use 'clearAfter' on 'onMessage' so that this second
handler will still fire to log the warning even after disconnecting from the
bootstrap node

* uses renderNetworkName to log network names in warning, if available
'wallet:account' displays the status information available in 'wallet:accounts
--extended' for a single account accepted as an arg

defaults to the wallet's default account

Closes IFL-2651
This commit adds a new `transaction-proofs` Cargo feature (enabled by
default) to the `ironfish-rust` crate. When this feature is disabled,
all the structs and methods that create or verify zero-knowledge proofs
are also disabled, hence making the Sapling parameters not needed.

This way, developers have an option to use some of the `ironfish-rust`
features (like transaction decryption) without having to deploy the
Sapling parameters, which are several MBs in size.

When `transaction-proofs` is disabled, all the transaction builder
structs (like `ProposedTransaction`, `SpendBuilder, `OutputBuilder`,
`MintBuilder`, ...) and related methods are unavailable, because those
structs/methods all generate proofs.

This commit also cleans up and reorganizes some code, in particular:

* renamed the `ironfish::transaction::utils` module to
  `ironfish::transaction::verify`, because this module only contains
  methods for verification;
* moved some of the transaction verification methods from
  `ironfish::transaction` to `ironfish::transaction::verify`;
* moved `ProposedTransaction` to a dedicated submodule;
This is to allow our documentation to build on platforms like docs.rs,
which need to build the documentation for our crates, but don't have
access to the Sapling parameters.

This also slightly improves the experience for developers who use this
crate for the first time: if they use the crate without the Sapling
parameters, they'll now get a helpful warning instead of a panic.
- prints message at end of table if limit is reached
- updates commands to handle limit
Also forbid the use of `println!`, `eprintln!`, `dbg!` and similar
invocations, which should not be allowed in a library.
This removes the `libc` dependency from `ironfish-rust`, which is not
supported in generic WASM environments.

In addition to that:

* Removed the `triggerSegfault` function, which does not appear to be
  used anywhere.

* Replaced the call to `libc::exit()` with `std::process::abort()`. The
  two are not exactly equivalent, but the latter is better suited for
  the task. If we want equivalence, we can use `std::process::exit()`
  instead.

* Corrected the definition of `display_trace`: the argument to signal is
  `void (*sighandler_t)(int)`, but our `display_trace` was not accepting
  an int argument. This could lead to stack corruption on some platforms
  (on x86-64, the first argument is passed on a register, so no stack
  corruption can occur there, but other platforms may be affected).

* Changed the `STACK_TRACE` variable from being a `static mut` to a
  stack-local variable. This simplifies the implementation and also
  avoids potential issues with multi-threading.

* Protected the `backtrace_symbols_fd` symbol from being defined on
  platforms where it's not supported.
* Add lint for rust binding changes

* check in rust binding changes
@danield9tqh danield9tqh requested a review from a team as a code owner November 7, 2024 17:13
@danield9tqh danield9tqh merged commit 6693fe5 into master Nov 7, 2024
40 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.

8 participants