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

Merged
merged 55 commits into from
Apr 16, 2024
Merged

STAGING -> MASTER #4898

merged 55 commits into from
Apr 16, 2024

Conversation

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

[ ] Yes

andiflabs and others added 30 commits March 14, 2024 13:20
…d from `RpcClient`

This replaces code like the following:

    await routeTest.client.request<FooResponse>('foo', ...).waitForEnd()

with:

    await routeTest.client.foo(...)
* Clarify when users are entering iron denominations

This makes it more clear, however it also reveals a confusing issue we
have. When using custom assets, why are we entering iron? What should
we refer to the coin denomination for that asset? These issues will need
to be fixed goign forward from a UX perspective.

* Update ironfish-cli/src/utils/currency.ts

Co-authored-by: mat-if <[email protected]>

---------

Co-authored-by: mat-if <[email protected]>
* Adds a transaction timer class to reuse

* lint fix

* shortening function name

* explicitly calling display estimate
requires using the '--notes' flag because memos are only available on notes, not
transactions
* Moves responsibility of logging estimate out of the timer

* name change

* changing date.now to performance.now
This function will be reused by wallet send and wallet notes combine commands.
* add spend post time to utils

* using getSpendPostTime in notes combine
the 'memo' included with each note is modified to remove non-human-readable
characters. if the memo included in the note is encoding data then this can make
it impossible to recover the data from the rpc response.

adds memoHex to return the memo as a hex string to preserve memo data in wallet
rpc responses
when verifying the checksums included in singing commitments we need to verify
that all commitments were created using the same list os signers

however, we currently verify that all commitments were created using the list of
_all_ signers. this means that a signing package cannot be created for a subset
of signers even if they meet the minimum signing threshold

fixes checksum verification to use the list of identities gathered from
commitments as the list of signers

updates tests
* allows deploying Docker images for staging branch

adds deploy step to deploy to image to github for branch refs

* adds rule to deploy docker image on push to staging
The pool will recalculate the target of the new block template every 10 seconds. Right now, once it reaches the max target for that block, it stops sending out updated block templates with the new target and timestamp. This leads to an issue where once the max target has been reached for that block, the timestamp is never updated, so a block that takes, for example, 3 hours to mine, will still say 34 minutes because that was the last time the timestamp was updated.

By removing this check, the timestamp will be changed every 10 seconds, leading to more accurate block times for the reference pool implementation.
…ror was that in memory store still contained account for a moment while the head was deleted. (#4867)
* add additional fields to asset verification code

* add website field, rename assetId field

* modify some fields to be optional

* remove name field

* update verified asset endpoint
)

* Refactors combine to explicitly call benchmarkSpendPostTime

Also removes `spendPostTimeAt` from internal store. In an upcoming PR this will be replaced with a different variable to create more accurate measurements for spendPostTime.
This refactor is to make the code more readable and to make it easier to understand where `spendPostTime` is being called and how the value is being calculated.

* updating imports

* covering edgecase of calculating a negative time

* Removing temp test variable

* < to <= for calculating spendPostTime

* throwing error when user doesn't have enough notes to benchmark
danield9tqh and others added 24 commits April 5, 2024 21:23
* updates binary to use xlarge runner

* fix apple binary generation and add test

* specify python and make runner bash for windows

* add python setuptools

* python version to 3.11

* remove push
any node that has asset, transaction, or note data from before the network reset
in commit `f483d9aeb87eda3101ae2c602e19d3ebb88897b6` will need to clear out this
data before the node can start on any version after the network reset.

since this data must be deleted it is unnecessary to execute any migrations that
operate on this data. some of these migrations depend directly on the walletdb
and may need to be updated if and when we make changes to the walletdb in the
future. removing the logic reduces our code maintenance burden.

removes migration logic that reads or writes from/to chain or wallet datastores
that store assets, transactions, or notes from before the network reset.

maintains migration logic that clears old datastores that no longer exist.

maintains migration logic that affects accounts. account data will not be
deleted, so we still need to execute this migration logic.
* Add new verified asset metadata fields to RpcAsset

* Move verified metadata fields to the verification sub-object

* fix tests

* Improve types for internal verified asset metadata

* update to use new rpc type

* test fixes

---------

Co-authored-by: danield9tqh <[email protected]>
This is a follow up to 98fcad2 and
removes a few more uses of `request()` in tests.
* Add new currency render function

* Use new render function signature based off RpcAsset changes

* code review changes
our LevelupStore implementation has several methods for iterating over keys and
values in the store: 'getAllIter', 'getAll', 'getAllValuesIter',
'getAllValues', 'getAllKeysIter', and 'getAllKeys'. these methods all use
'getAllIter', which always deserializes all keys and all values. this results in
unnecessary deserialization of values when using 'getAllKeysIter' or
'getAllKeys' and likewise for keys when using 'getAllValuesIter' or
'getAllValues'.

updates LevelupStore to use lazy deserialization: only deserializing keys or
values during iteration if required.

- changes LevelupTransaction to cache using database-encoded keys as Buffers
  instead of converting those Buffers to strings
- defines LevelupStore._getAllIter to yield encoded keys. yields encoded values
  where deserialized value is not in transaction cache
- defines resolveValue to deserialize value from Buffer if necessary

fixes bug in WalletDb.cleanupDeletedAccounts:
- if db migrations run after deleting an account, then data for deleted accounts
  are not migrated
- when cleanupDeletedAccounts runs it iterates over keys, but errors because
  deserialization of unmigrated values fails
- fixes error by preventing deserialization of unmigrated values
* removes unused walletDb method

removes 'replaceNullifierToNoteHash'

* removes more dead code: clearNullifierToNoteHash
* Use new render function in the CLI

* Use the new render function definition

* yellow

* move asset to top level out of balance
* Parse values in the proper denomination for CLI commands

* Split out helper function and add unit tests

* remove todo comments that have been moved to tickets

* ValueFlag cannot assume a BigInt or other type beyond basic parsing due to not
knowing the decimal places for the asset, so instead just do some basic parsing
to ensure it is a valid number

* rename function

* use the right field after rebase changes
Updates the spend post time at the end of the transaction to create a more accurate estimate over time.
when a user runs round1 of dkg with a given secret name they must also include
the identity for that secret in the list of participants

updates the round1 rpc to automatically add that identity if it's missing
instead of throwing an error
* implement dkg/round2 RPC

- updates ironfish-frost version to latest main
- defines round2 in ironfish-rust-nodejs
- defines round2 RPC endpoint

* updates round2 RPC to return list of packages

round2 returns a list of PublicPackages now that each one includes the identity
of the recipient participant

* return object with recipientIdentity with round2 public package
* add dkg round1 cli command

adds a cli command to run round1 of the dkg protocol

takes flags for secret name, identities of particicpants, and minimum signers

logs encrypted secret package and public package to command-line

* prompts user for secretName if flag not set
runs round2 of DKG and logs round2 encrypted secret package and each public
package to the command-line
If the random scalar generated is zero (which is a rare occurrence,
almost impossible, and has the same probability to occur as guessing
somebody's private key), `SaplingKey::generate_key` is supposed to
generate a new random scalar and try again. The current code however,
does not generate a new random scalar if that occurs, resulting in an
infinite loop.
`split_spender_key` currently has a lot of code copied from
`SaplingKey::new`, but it doesn't need to: the results these
computations can be obtained directly from `SaplingKey`.
…g passed (#4892)

* Fix an issue with the mint command where the id was not properly being passed

This was causing an issue where minting a new asset would default to the 8 decimal places instead of 0

* remove unused asset owner comparison function
@danield9tqh danield9tqh requested a review from a team as a code owner April 16, 2024 18:12
@danield9tqh danield9tqh changed the title Staging -> Master STAGING -> MASTER Apr 16, 2024
@danield9tqh danield9tqh merged commit f792fd7 into master Apr 16, 2024
29 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.

9 participants