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 to master v2.10.0 #5697

Merged
merged 71 commits into from
Dec 16, 2024
Merged

Staging to master v2.10.0 #5697

merged 71 commits into from
Dec 16, 2024

Conversation

patnir
Copy link
Contributor

@patnir patnir commented Dec 16, 2024

Summary

version 2.10.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

danield9tqh and others added 30 commits November 8, 2024 12:58
the walletDb has serveral leftover implementations of methods that clear
datastores

these methods are unused

not only are these methods unused, but they _should not_ be used: calling
'clear' on a datastore has the potential to block the wallet and node process
while deleting from the database. data are deleted from these stores
incrementally in the background using 'cleanUpDeletedAccounts' for this reason
* Support viewing transaction data for all accounts

This allows you to use --no-account to now see all the transactions data
for all accounts.

* Fix missing notes flag
* removes unused methods from walletDb

cleans up the walletDb by removing unused methods

removes one unused wallet method that was the only usage of a walletDb method

* puts 'loadHeads' back

it's used in the 'debug' CLI command
remove setNoteHashSequence from the walletDb and moves the logic inline into
saveDecryptedNote; the only method that called setNoteHashSequence
Added bindings for:

- `Scalar`
- `Fr`
- `ExtendedPoint`
- `SubgroupPoint`
- `Nullifier`
- `redjubjub::PrivateKey`
- `redjubjub::PublicKey`
- `redjubjub::Signature`

These are all structs that are required by transactions.
This adds a new output transfers which uses the same column as notes but
excludes change notes.
The unit tests currently are marked with both `#[test]` and
`#[wasm_bindgen_test]`. This allows tests to run with both `cargo test`
and `wasm-pack test`.

In theory, we could drop `#[test]`, but given that `cargo test` is
faster than `wasm-pack test`, this makes developing easier, so I'm
keeping it for now.
This clarifies the names and keeps them consistent with the table
naming.
* Add filter start and end support

This lets you filter dates based on a date input such as 04/20/2023

* Change examples to ISO format

* Add command examples
* adds 'format' option to account import

adds a field to the wallet/importAccount RPC that allows clients to specify the
format of the account (Base64Json, JSON, Mnemonic, or SpendingKey)

if format is specified in the request then the decoding is only attempted for
the specified format

results in more specific error messages instead of an error message containing
the errors for each encoder

* updates test not to expect within except

test would still pass if an error were not thrown
`SpendDescription`, `OutputDescription`, `MintDescription`, and
`BurnDescription`
Allows the user to use a ledger device to sign the burn transaction.
as of v1.1.0 of the Ironfish Ledger app expert mode must be required to review a
transaction that sends custom assets

defines the error code for the new export mode error

stops polling the Ledger app when an expert mode error is thrown so that the
user can navigate to the expert mode screen and enable expert mode before
continuing
* passes wallet passphrase from CLI to migrator

adds an error type, EncryptedWalletMigrationError, and catches errors of that
type in the three commands that run migrations: 'migrations:start',
'migrations:revert', and 'start'

prompts user to enter wallet passphrase and passes passphrase through to
migrator

to support passing the passphrase down to the migrator in the 'start' command we
pass the passphrase through 'NodeUtils.waitForOpen' and the the node's 'openDB' method

supports implementing database migrations that handle encrypted wallet logic.
for example, throwing the EncryptedWalletMigrationError on an encrypted account
and using the wallet passphrase passed to 'migrate' to decrypt and re-encrypt
the wallet

* removes passphrase prompt from start command

displays error message to user instead

removes logic plumbing passphrase through openDB to migrator
hughy and others added 26 commits November 25, 2024 10:41
the ui.ledger function includes error handling and retry logic that could be
useful in each of the standalone dkg commands ('participant:create',
'dkg:round1', 'dkg:round2', and 'dkg:round3')
We can move this to a debug log, as it is not a critical error.
if the command is exiting due to user action (e.g., choosing not to continue)
or an un-retryable problem then we should not prompt to retry
if a user attempts to sign a transaction, but their ledger app doesn't have any
multisig keys persisted, then the signing operation will fail with an
'invalid dkg status' error. this can happen if the user reinstalls the app or if
the user starts creating a new account on the device using bkg, but doesn't
finish

the only ways to recover from this error are to restore an encrypted backup to
the device, or to create a new multisig account using the device. since the
error shows up during signing, we can infer that the user expects to have an
account on the device and should be instructed to restore the backup
* supports migrations on encrypted wallets

adds a template migration , 033-encrypted-wallet-template, to demonstrate how to
write wallet migrations on wallet databases that may be encrypted

now that account data may be encrypted we need to be careful to decrypt the
account before running the migration and to re-encrypt the migrated data before
writing it back to the database

adds EncryptedWalletMigrationError thrown when a migration tries to access an
encrypted account without the wallet passphrase to allow client code (e.g.,
'migrations:start' command) to handle decryption flow

optionally passes wallet passphrase through migrator to an individual migration
to decrypt/encrypt account data in migrations

updates 'start' command to catch EncryptedWalletMigrationError and prompt for
wallet passphrase. passes wallet passphrase through node openDB flow to suppoprt
running migrator with wallet passphrase

NOTE: this example assumes that the schema for the masterKey store does not
change and assumes that the schema for encrypted account data does not change.
if the masterKey schema changes then that change must be addressed in a separate
migration. if the encrypted account schema changes, then that change should be
addressed separately from any change to the decrypted account schema in a
separate migration.

* removes superfluous comments

* updates template migration for changes to MasterKey

removes util from migration data

* converts encrypted-wallet-template to template

renames 033-encrypted-wallet-template to 000-encrypted-wallet-template so that
the migration is not runnable

resets walletDb version to 32
)

* exits cli commands if user rejects Ledger request

if a user rejects an action on their Ledger, the command will now exit instead
of retrying and prompting the user again to approve the action

* optionally retry if user rejects request

providers users a way to retry if they rejected by accident because starting
over in that case is a very bad experience

refactors retry prompt into reusable function
These are qualifications that rust 1.76 (specified in
`rust-toolchain.toml` does not detect, but the latest version of Rust
detects and warns about.
Also add bindings to generate transaction signatures
adds a test case to wallet slow tests to serve as an example for how to build a
test transaction and sign it using the JavaScript SDK

useful for integrations that require testing transaction signing (e.g., Ledger
integration) without running a network and/or building a chain
the publicAddress passed to postedSize is not used
compares the estimated postedSize of the raw transaction to the maximum
transaction size computed by the verifier

throws a new error type, MaxTransactionSizeError, if the proposed transaction is
too big
explains how migrations are written and named

includes more detail and example code for dealing with encrypted account data
changes the 'wallet:transactions:sign' command to render the details of the
unsigned transaction before signing the transaction

this gives the user a chance to see the transaction details on the CLI before
signing the transaction
keeps track of the posted size of a raw transaction in 'fund' and updates the
size after each spend is added to the raw transaction

throws an error if and when the posted size of the transaction will exceed the
maximum transaction size

inlines the logic of 'addSpendsForAsset' to avoid having to plumb posted size
and max transaction size down to that method

defines the constructor and error message for MaxTransactionSizeError
CLI command that displays the wallet address of the connected Ledger device.
adds optional startSequence and endSequence request parameters to the
'wallet/getAccountTransactions' RPC to support fetching transactions by a range
of block sequences (inclusive)

if startSequence is set but not endSequence, then all the maximum 32-bit integer
value is used for endSequence

if endSequence is set but not startSequence, then the genesis block sequence (1)
is used for startSequence
Version bump to v2.10.0
@patnir patnir requested a review from a team as a code owner December 16, 2024 23:06
@patnir patnir changed the title Staging Staging to master v2.10.0 Dec 16, 2024
@patnir patnir merged commit 03b5180 into master Dec 16, 2024
39 of 42 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