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

Cumulative PR for Wallet & Metrics Refactoring #360

Merged
merged 235 commits into from
Dec 26, 2023

Conversation

aspect
Copy link
Collaborator

@aspect aspect commented Dec 19, 2023

Please note this PR breaks previously created wallet data files. The wallet data storage has been completely redesigned to provide easier management of data structure versioning. Following this PR data files will be always backward-compatible.

Consensus & RPC service layers:

  • Debug formatting of various consensus data structures (SPK, Address etc.) have been changed from default implementations to render in hex/human-readable.
  • Refactored signed_with_multiple_v2() to return enum Signed comprised of two states: Signed::Fully and Signed::Partially to be able to distinguish transaction signed states. Signed also implements fully_signed() -> Result<()> that will return a transaction or an error if the transaction is not fully signed.
  • Updated GetMetrics RPC call to return various additional metrics including bandwidth monitoring.
  • Add a few auxiliary functions to consensus_manager to return lengths instead of collection clones such as async_get_tips_len() and async_get_virtual_parents_len(), these are used by the GetMetrics RPC call when the metrics poll occurs.

/cli:

  • AddPeer has been added to the RPC command handler

/kaspad:

  • Modified kaspa_daemon::Args to accept an argument iterator, this allows Args to be used externally to perform argument validation as well as to supply kaspad externally generated arguments.

/metrics/kaspa-metrics-core

  • Migrated metrics from the /kos crate into its own standalone /metrics/kaspa-metrics-core crate.
  • Consolidated all metrics into a series of data structures designed for client-side use.
  • Exposed additional metrics like mempool transaction count and gRPC/p2p bandwidth metering introduced in gRPC bandwidth tracking #346 .
  • Exposed a helper task designed to bind to an existing RpcApi interface for polling metrics and delivering it to a supplied closure.

Wallet framework:

  • Restructure modules to improve module layout
  • Introduced WalletApi trait that encapsulates all wallet functions in a similar style to RpcApi, allowing the wallet to be "controlled by wire" (i.e. via serializable data structures over RPC). The WalletApi follows the same style and code notations as the RpcApi (i.e. _call fn suffixes and serializable *Request/*Response structs). The original development effort was aiming to avoid RPC-style communication with the wallet framework. However, while testing the framework in the browser extension environment we ran into problems and a requirement for the wallet framework to run "headless" in the background task. This refactoring enables such functionality, while also bringing all APIs into a single trait, making it easy to develop any kind of RPC bindings as well as WASM bindings (since all data structures are serializable).
  • Completely restructure how data storage functions in the wallet framework. Previous implementation relied on Serde JSON which exposed a variety of problems related to long-term backward compatibility and ease of use. The new data storage subsystem allows each wallet account to manage its own data storage and offers easy-to-use data version control. The new storage uses manually constructed binary serialization functions (using Borsh serializer manually to store binary data) @biryukovmaxim .
  • Accounts are now standalone data constructs managed by and created by account factories. This allows us to easily create different account types that have custom behavior or a 3rd-party developer to create a custom account externally without changes to the framework (this structure is provisional and may require further optimizations of the Account trait). In essence, Accounts are now similar to plugins allowing the creation of custom accounts that may opt to handle custom scripts (or other custom interactions such as hardware interfaces) @biryukovmaxim .
  • AccessContextT trait has been removed from the storage subsystem. Storage subsystem now accepts secrets directly. This construct was created as a "layer responsibility isolation" effort but was making APIs and secret retention more complex than they should be.
  • All transaction events have been refactored where the events are now strictly focused on transaction maturity status (and certain outlier conditions) and the TransactionRecord carries the transaction status.
  • Implemented support for inter-account zero-conf transfers. The transfers function is based on the tx acceptance and can be executed via a new Account::transfer() method by supplying the target account id. Transfers require a destination account ID and both from and to accounts will receive TransferIncoming and TransferOutgoing notifications containing the corresponding TransactionRecord.
  • UtxoContext and UtxoProcessor have been refactored to track a new OutgoingTransaction that wraps PendingTransaction (and contains additional context information such as submission time and acceptance time). The OutgoingTransaction is not tracked by UtxoProcessor and plays the main role in handling transfers as well as monitoring for Change outputs.
  • TransactionRecord processing has been modified to resolve transaction Unixtime timestamp automatically using methods introduced in Implement DAA score timestamp estimation #268. Newly discovered transactions cascade to UtxoProcessor and are then handled internally or propagated to the wallet that checks transaction storage to see if transactions are unknown, resolves unix time from the DAA score, and cascades them to the wallet multiplexer channel clients via the new Discovery event @coderofstuff .
  • Introduced Stasis transaction processing queue. The previous implementation places new coinbase transactions into the Pending state which later propagates into Reorg or Maturity states resulting in additional Reorg notifications. The new implementation places new coinbase transactions into a Stasis state for a period of 50 DAA. Upon reorg of a transaction that is currently in the Stasis state, no events are emitted. After 50 DAA expiration, the transaction is placed into a Pending state at which point the Pending event occurs, followed by the Maturity event once the transaction age reaches 100 DAA. This was implemented to simplify coinbase transaction processing for wallets as during the initial few DAA of the coinbase transaction lifetime it can frequently become subject to a reorg.
  • Improved internal wallet data structures to support different types/algorithms of wallet data encryption (provisional).
  • Implemented provisional support for TransactionRecord storage encryption (allows transaction data to be encrypted as well - for now provisional only, additional work is required to bring this feature online).
  • Fix a deadlock (recursive mutex) while storing multiple accounts via the storage API.
  • Fix a bug (trait mishandling) resulting in the dyn Account always returning account_index() as 0, preventing any additional BIP44 accounts from being signed correctly.
  • Refactor wallet open() and reload()processes. Opening a wallet now loads the storage dataset and related cache, following which the developer is required to explicitly activate account processing (a.k.a. activate accounts). (Due to event-driven architecture, starting account processing during the open() call creates event sequence difficulties where after opening the client may need to load existing transactions before any other processing should occur).
  • Add the ability to custom-configure wallet storage folders (via static mut, before using the framework).
  • Fix a rare panic during the transaction submission process occurring in an async context when the node disconnects during a tx submission setting DAA to None while async functions that require DAA would continue their processing. The panic is now converted to a cascading error.
  • Introduced transaction submission reversal process, where the failure to submit a transaction to the node results in proper "unwinding" of states (see next item).
  • Introduced an async locking mechanism (using async_std::Mutex) that blocks UtxoChanged notification processing during the transaction submission process. Transaction submission is a multi-stage process where 1) OutgoingTransaction (PendingTransaction) is registered, 2) the transaction is submitted 3) submission can result in an error in which case 4) registration of the OutgoingTransaction has to be canceled/reversed. Since these processes are async, there is a danger that acceptance and the corresponding changes come in while this process is taking place.
  • Various documentation updates.

WASM

  • PR [WIP] Implementation of WASM Bindings for TypeScript #349 (GeneratorArguments) has been folded into this PR
  • Fix a deadlock (recursive TryFrom) when calling UtxoContext.trackAddresses() from WASM
  • Fix incorrect property assignment in the Transaction.gas setter.
  • Rename (name more explicitly) some Address functions on the Rust side as they were making the Rust the API confusing (JS needs Strings while on Rust you expect to get native types).
  • Most Wallet APIs have been disabled/removed (some left as comments for reference) in the preparation for exposing WalletApi trait to WASM.

workflow-rs

  • Fix a rare wRPC server panic occurring when a client was connecting and immediately disconnecting from the WebSocket server. Due to async handling, the disconnection could occur during the WebSocket initialization phase. workflow-rs/workflow-rs@9d98829
  • Add platform detection for Electron client/server environments @starkbamse . workflow-rs/workflow-rs@f565f46

…nect to occur before utxo_processor shutdown;
… of the RPC channel after closing the wallet
…nel, allow retention of a connected RPC channel past UtxoProcessor shutdown. (API centric defensive functionality)
wallet/core/src/storage/transaction/record.rs Outdated Show resolved Hide resolved
wallet/core/src/tests/rpc_core_mock.rs Show resolved Hide resolved
wallet/core/src/tx/generator/pending.rs Show resolved Hide resolved
wallet/core/src/tx/generator/signer.rs Show resolved Hide resolved
wallet/core/src/tx/generator/signer.rs Show resolved Hide resolved
wallet/core/src/utxo/context.rs Show resolved Hide resolved
wallet/core/src/utxo/context.rs Outdated Show resolved Hide resolved
wallet/core/src/utxo/context.rs Show resolved Hide resolved
wallet/core/src/wallet/mod.rs Outdated Show resolved Hide resolved
wallet/core/src/wallet/mod.rs Outdated Show resolved Hide resolved
protocol/p2p/src/core/hub.rs Outdated Show resolved Hide resolved
consensus/src/consensus/mod.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@coderofstuff coderofstuff left a comment

Choose a reason for hiding this comment

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

Some minor comments.

@@ -0,0 +1,3 @@
pub mod client;
pub mod server;
// pub mod wasm;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this intentional that wasm is commented out?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Adding a //TODO note. This is a placeholder with some code copied over from RPC meant to automate bindings for WalletApi. I started working on bindings but quickly concluded that the WalletApi needed to be stabilized before the bindings were made.

Also, there have been efforts made by @starkbamse and other contributors with regard to improving types in RPC bindings (which also apply here) and I had to freeze the effort till January in order to get a concise view of all issues in front of us so that all of this can be addressed and implemented as a single dedicated effort/pass.

} else if decimal_len <= 8 {
decimal.parse::<u64>()? * 10u64.pow(8 - decimal_len as u32)
} else {
decimal[..8].parse::<u64>()?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Optional: This condition should never happen in a legitimate KAS value. So it might be worth changing this to an Err since this would mean you were passed a string that had 9+ decimals - which could mean something is off elsewhere in the code that made that happen.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hm.. It's a valid point... The function is constructed and is used mainly for user input and I am not sure of all the pros or cons of both cases. Like if you copy/paste a value from somewhere, it can have a very long fractional value... and I am not sure whether such a value should be rejected or truncated. It kind of falls into "what is best/friendliest for the user" domain... technically I think we should perhaps do something like ceil(v*1e8)/1e8 and then truncate... this way the user can input anything but will get back a rounded value... but perhaps a separate function should be made for that.

Let me add a TODO to this so that we can take a look at this a bit later on.

@michaelsutton michaelsutton merged commit b6f7e09 into kaspanet:master Dec 26, 2023
6 checks passed
@coderofstuff coderofstuff deleted the wallet-refactoring-q4-2023 branch December 26, 2023 17:15
michaelsutton added a commit to michaelsutton/rusty-kaspa that referenced this pull request Dec 26, 2023
commit a4ba784
Author: Ori Newman <[email protected]>
Date:   Tue Dec 26 16:22:36 2023 +0200

    Add headers first validation to simpa (kaspanet#364)

commit fb1aa5f
Author: Ori Newman <[email protected]>
Date:   Tue Dec 26 16:07:19 2023 +0200

    Move to mimalloc (kaspanet#361)

    * mimalloc

    * mimalloc disable purge_decommits

    * Add to simpa and integration tests

    * remove redundant unix and replace with win/linux/mac

    * Add comment

    * Add comment

    * Sort out features

    * Get rid of ctor

    ---------

    Co-authored-by: Michael Sutton <[email protected]>

commit b6f7e09
Author: aspect <[email protected]>
Date:   Tue Dec 26 13:38:24 2023 +0200

    Cumulative PR for Wallet & Metrics Refactoring (kaspanet#360)

    * external access to kaspad core rpc services API

    * rename wallet event members for serde serialization
    misc wallet functionality update

    * wip - event renaming

    * wip - event serialization tuneup

    * remove default wrpc listening ports on kaspad Args + fix port mapping bug for automatic JSON RPC port mapping.

    * Box wallet events

    * introduce RpcCtl + isolate wRPC from DynRpcApi

    * debug trait for secret

    * de-couple wRPC from the runtiem wallet making RPC bindings generic

    * convert wallet_list to return Vec<WalletDescriptor>

    * user-friendly error message on decryption error

    * UtxoProcessor - ignore task shutdown if not running

    * wallet storage data versioning

    * wallet - propagate wallet title

    * sort traits on WalletDescriptor

    * wallet - use precise decimal conversion when parsing strings to sompi

    * display kaspa on get-balance-by-address-rpc

    * wallet - rename settings fns to have try_ prefixes

    * rename library names "kaspad" and "kaspa_cli" to "kaspad_lib" and "kaspa_cli_lib" to prevent build collisions

    * no-unsafe-eval feature

    * allow for chrome-extension schema in the RPC url

    * wallet - expose bip32 wordlist for external access

    * wallet - delegate rpc ownership to utxo_processor; reorder rpc disconnect to occur before utxo_processor shutdown;

    * wallet - migrate wallet settings loading to cli

    * rename RpcCtlOp (Open, Close) to RpcState (Opened, Closed)

    * remove automatic RPC disconnect from wallet stop() to allow retention of the RPC channel after closing the wallet

    * allow UtxoProcessor to bind to an already existing/connected RPC channel, allow retention of a connected RPC channel past UtxoProcessor shutdown. (API centric defensive functionality)

    * code formatting

    * fix clippy warnings

    * migrate chrome-extension to use ws:// schema by default

    * wallet list formatting

    * staging for WRS 0.7.0

    * add bip32 word list iterator

    * update WRS to 0.7.0

    * fix rustdoc errors

    * wip - initial WalletApi trait implementation

    * wallet - macros and account descriptors

    * wallet - ping_call

    * cleanup

    * wip - wallet api cleanup & testing

    * kaspa-metrics as a separate crate

    * wip - metrics cleanup

    * cargo.lock update

    * async/sync api  changes for storage

    * merge

    * master merge

    * wip

    * wip

    * wip

    * wallet - (wip) changes to AccountDescriptor and Wallet API

    * metrics - make sink future return as optional

    * wip - refactor wallet open; improve wallet event ordering; cleanup

    * wip (debugging UtxoChanged notifications) - fix issuance during failed tx

    * adding workflow-rs as github dependency (allows CI)

    * revert github deps for WRS

    * metrics

    * refactor metrics to include bdi counts and peer counts

    * wallet api updates
    refactoring transaction access interface
    misc updates to wallet APIs
    refactor wallet open sequence
    refactor legacy accounts

    * wallet framework - fix a but resulting in the early issuane of UTXO maturity events.
    Refactor handling of outgoing transaction UTXOs (sending outgoing tx ACKs on UtxoChange removal), minor fixes in the Transaction file-system storage.  Add "outgoing" property to account balances (to track in-flight transactions being submitted until acceptance). Introduce new Events::Change that gets fired specifically when receiving change of the currently outgoing transaction. Initial steps toward Daa property wrapper.

    * npm 0.13.0

    * metrics - cleanup after RPC refactoring

    * rename rust-side of wasm bindings as naming conventions interfere with rust use (make fns more explicitly named)

    * make metrics data formatting fns as pub

    * expose log levels in kaspa-core::log

    * rename metrics & improve metrics fetch task

    * add API calls to pre-configure wallet framework stroage folders

    * cumulative updates for Cargo.lock

    * Improve address error messages for human readability

    * PrvKeyData enumeration, initial account transfer support (wip), wallet descriptor handling

    * wallet - change error to retain PrvKeyDataId instead of a String

    * propagate bip39 flag to runtime account and it's descriptor

    * wip - keydata refactoring

    * metrics refactoring (bandwidth)

    * wip (cleanup)

    * misc improvements to metrics

    * code formatting

    * wRPC bandwidth monitoring + scaffolding for global bandwidth metrics

    * bump WRS to 0.9.0

    * metrics - add mempool_size and convert some items to u32/f32

    * metrics cleanup

    * wallet and account rename, remove "title" from accounts

    * add missing mempool size metric

    * UTXO "stasis" mode for new coinbase transactions

    * remove useless Option from the rpc url parser

    * fix daa score in maturity state check

    * add name_or_id to PrvKeyDataInfo

    * wallet RPC Connect/Disconnect and GetStatus API calls

    * cleanup

    * support for 12-word bip39 mnemonics

    * add a hidden --daemon flag to kaspad

    * refactor get_daa_score_timestamp helper to return Vec<u64> instead of Response struct

    * Add Scan event

    * implement support for unixtime in transactions

    * kaspa value formatting functions

    * fix a deadlock due to re-entrant mutex lock when loading multiple accounts from storage

    * introduce utxo stasis mode + make balance carry utxo counts as well as the totals

    * refactor wallet events, replace reset() with close() where appropriate

    * manual debug impl for tx components (display script as hex, address as address etc)

    * fix incorrect gas assignment in WASM bindings

    * updates for wallet event handling

    * refactor sign_with_multiple to return Err(tx) when partially signed

    * refactor Storage and Wallet descriptors

    * fix account derivation index handling in DerivationCapable

    * track acceptance DAA stamp in outgoing transaction record

    * temporary harness for embedding script engine directly into tx generator (used for debugging)

    * convert PendingTransaction Utxo entries into HashSet

    * rename pending tx fns

    * outgoing tx wrapper around pending tx

    * refactor notification events during wallet ops

    * as_ref() for PrvKeyData

    * wip - initial RpcCoreMocks for wallet framework tests

    * wallet api messages update for StorageDescriptor usage

    * update AddressDerivationMeta to track addresses from index 0

    * add AHash and async_channel to wallet_core crate

    * allow Args to be used externally for daemon argument pre-validation

    * impl Hash for UtxoEntryReference and rename "fake()" to "simulated()"

    * update wallet events

    * expose tx validator check_scripts() as pub

    * update wallet wasm fns for wallet and storage descriptors

    * rename kaspa-metrics to kaspa-metrics-core

    * code formatting

    * code formatting

    * migrate transaction console formatting to cli/extensions

    * refactor wallet events

    * use ahash for faster processing in wallet hash maps (utxo context)

    * wallet - add SendError handling for error::Error

    * wallet event refactoring, scan/discovery process refactoring, wallet change secret api handling

    * refactoring: transfer and deep derivation scan

    * transaction record refactoring

    * wallet - support for cross-account transfers in generator

    * wallet - outgoing transaction impl

    * wallet - refactor maturity handling

    * wallet/utxo - initial tests scaffolding

    * minor optimization of the discovery/scan process

    * wallet - utxo processor outgoing tx and discovery timestamp unixtime handling

    * refactor utxo context to use output transactions, refactor transfers, compound and change notifications

    * code formatting + Cargo.lock update

    * Signed enum to represent Fully or Partially signed tx

    * bind p2p and grpc bandwidth metrics

    * misc clippy fixes

    * cleanup

    * remove --daemon as Args::parse() offers external mutations

    * remove previously implemented mnemonic variant in favor of client-side mnemonic creation

    * remove AccessContextT, convert to wallet_secret, wip WalletApi traits, refactor account args

    * code formatting

    * separate runtime wallet into multiple modules

    * wallet - revert create_accounts to process a single account at a time

    * cleanup

    * wallet - JSON import and export + preliminary docs

    * address - AddressList - fix TryFrom deadlock caused by recursive trait invocation

    * wallet - api rustdoc + cleanup, transaction calls

    * wallet docs

    * change address debug formatting

    * adding cli rpc addpeer

    * wip - wallet restructuring

    * wip - restructure wallet modules

    * wip - wallet restructuring - cleanup

    * wip - AccountKind refactoring

    * wallet - refactoring storage serialization & encryption

    * fold in PR kaspanet#349

    * wallet framework - misc helper fns and cleanup

    * storage unit tests + prv key data module restructuring

    * wallet - account factory registrations

    * Remove panics caused by sudden loss of connection while submitting transactions.

    * cleanup

    * cleanup

    * cleanup + docs

    * docs

    * adjust metrics formatting

    * cleanup

    * bump workflow-rs to 0.10.1

    * fix wallet storage unit tests

    * fix generator unit tests

    * convert missing listener_id panic to error

    * docs

    * code formatting

    * lints

    * misc updates following github reviews

    * refactor AccountKind to use fixedstr and implement Copy

    * refactor AccountKind to use fixedstr (str64) and re-implement Copy, removing clone() where necessary

    * change js-bound fn names from *as* to *to* to follow Rust conventions

    * replace AssocPrvKeyDataIds iter().any() to contains()

    * remove vec![] in MetricsGroup iterator fn; add TODO comment on Metric::group()

    * scope magic numbers within their associated structs

    * add try_fully_signed() and try_partially_signed() fns to Signed that allow recovery of the tx

    * refactor local storage cache to use RwLock instead of a Mutex

    * refactor serialization as per github feedback (partial trait impl)

    * Optimize AssocPrvKeyDataIds to use Either in the IntoIter impl, removing allocations.

    * Refactor to bypass aux buffer creation when storing wallet on native platforms.

    * impl custom Debug for storage structs to display data in hex

    * adding misc SAFETY comments on unsafe ops

    * TODO comments for later SignerT+multisig refactoring

    * Change panic!() to unreachable!() to make it clearer that a state should not be reached.

    * rename TransactionRecord::unixtime to unixtime_msec

    * fix wrong references in comments

    * Fix min_cosigner_index handling in multisig fns

    * add comments to UtxoContext::insert() error handling

    * bind AccountStorable:Storable for AccountStorage, migrate Storable into a separate module, add comments to MAGIC values in some locations

    * make framework init functions unsafe

    * update workflow-rs to 0.10.2

    * fix comments

    * fix data cloning when getting collection counts

    * adding TODO notes to wasm macros and KAS value decimal parsing

    ---------

    Co-authored-by: Surinder Singh Matoo <[email protected]>

commit 10d0ebf
Author: D-Stacks <[email protected]>
Date:   Tue Dec 26 10:43:59 2023 +0100

    make step 3. of linux installation not fail copy and paste (kaspanet#363)

    remove the space to escape the newline instead.
someone235 pushed a commit that referenced this pull request Dec 28, 2023
… data sizes (#351)

* cache inner struct: prep for tracking size

* initial cache policy and mem size estimator

* use new cache policies

* fix storage calcs

* update TN11 genesis

* temp: limit max block parents in virtual processor

* use more conservative constants (wip)

* ensure sufficient cache allocs for high level stores

* increase caches related to daa window

* Squashed commit of the following:

commit a4ba784
Author: Ori Newman <[email protected]>
Date:   Tue Dec 26 16:22:36 2023 +0200

    Add headers first validation to simpa (#364)

commit fb1aa5f
Author: Ori Newman <[email protected]>
Date:   Tue Dec 26 16:07:19 2023 +0200

    Move to mimalloc (#361)

    * mimalloc

    * mimalloc disable purge_decommits

    * Add to simpa and integration tests

    * remove redundant unix and replace with win/linux/mac

    * Add comment

    * Add comment

    * Sort out features

    * Get rid of ctor

    ---------

    Co-authored-by: Michael Sutton <[email protected]>

commit b6f7e09
Author: aspect <[email protected]>
Date:   Tue Dec 26 13:38:24 2023 +0200

    Cumulative PR for Wallet & Metrics Refactoring (#360)

    * external access to kaspad core rpc services API

    * rename wallet event members for serde serialization
    misc wallet functionality update

    * wip - event renaming

    * wip - event serialization tuneup

    * remove default wrpc listening ports on kaspad Args + fix port mapping bug for automatic JSON RPC port mapping.

    * Box wallet events

    * introduce RpcCtl + isolate wRPC from DynRpcApi

    * debug trait for secret

    * de-couple wRPC from the runtiem wallet making RPC bindings generic

    * convert wallet_list to return Vec<WalletDescriptor>

    * user-friendly error message on decryption error

    * UtxoProcessor - ignore task shutdown if not running

    * wallet storage data versioning

    * wallet - propagate wallet title

    * sort traits on WalletDescriptor

    * wallet - use precise decimal conversion when parsing strings to sompi

    * display kaspa on get-balance-by-address-rpc

    * wallet - rename settings fns to have try_ prefixes

    * rename library names "kaspad" and "kaspa_cli" to "kaspad_lib" and "kaspa_cli_lib" to prevent build collisions

    * no-unsafe-eval feature

    * allow for chrome-extension schema in the RPC url

    * wallet - expose bip32 wordlist for external access

    * wallet - delegate rpc ownership to utxo_processor; reorder rpc disconnect to occur before utxo_processor shutdown;

    * wallet - migrate wallet settings loading to cli

    * rename RpcCtlOp (Open, Close) to RpcState (Opened, Closed)

    * remove automatic RPC disconnect from wallet stop() to allow retention of the RPC channel after closing the wallet

    * allow UtxoProcessor to bind to an already existing/connected RPC channel, allow retention of a connected RPC channel past UtxoProcessor shutdown. (API centric defensive functionality)

    * code formatting

    * fix clippy warnings

    * migrate chrome-extension to use ws:// schema by default

    * wallet list formatting

    * staging for WRS 0.7.0

    * add bip32 word list iterator

    * update WRS to 0.7.0

    * fix rustdoc errors

    * wip - initial WalletApi trait implementation

    * wallet - macros and account descriptors

    * wallet - ping_call

    * cleanup

    * wip - wallet api cleanup & testing

    * kaspa-metrics as a separate crate

    * wip - metrics cleanup

    * cargo.lock update

    * async/sync api  changes for storage

    * merge

    * master merge

    * wip

    * wip

    * wip

    * wallet - (wip) changes to AccountDescriptor and Wallet API

    * metrics - make sink future return as optional

    * wip - refactor wallet open; improve wallet event ordering; cleanup

    * wip (debugging UtxoChanged notifications) - fix issuance during failed tx

    * adding workflow-rs as github dependency (allows CI)

    * revert github deps for WRS

    * metrics

    * refactor metrics to include bdi counts and peer counts

    * wallet api updates
    refactoring transaction access interface
    misc updates to wallet APIs
    refactor wallet open sequence
    refactor legacy accounts

    * wallet framework - fix a but resulting in the early issuane of UTXO maturity events.
    Refactor handling of outgoing transaction UTXOs (sending outgoing tx ACKs on UtxoChange removal), minor fixes in the Transaction file-system storage.  Add "outgoing" property to account balances (to track in-flight transactions being submitted until acceptance). Introduce new Events::Change that gets fired specifically when receiving change of the currently outgoing transaction. Initial steps toward Daa property wrapper.

    * npm 0.13.0

    * metrics - cleanup after RPC refactoring

    * rename rust-side of wasm bindings as naming conventions interfere with rust use (make fns more explicitly named)

    * make metrics data formatting fns as pub

    * expose log levels in kaspa-core::log

    * rename metrics & improve metrics fetch task

    * add API calls to pre-configure wallet framework stroage folders

    * cumulative updates for Cargo.lock

    * Improve address error messages for human readability

    * PrvKeyData enumeration, initial account transfer support (wip), wallet descriptor handling

    * wallet - change error to retain PrvKeyDataId instead of a String

    * propagate bip39 flag to runtime account and it's descriptor

    * wip - keydata refactoring

    * metrics refactoring (bandwidth)

    * wip (cleanup)

    * misc improvements to metrics

    * code formatting

    * wRPC bandwidth monitoring + scaffolding for global bandwidth metrics

    * bump WRS to 0.9.0

    * metrics - add mempool_size and convert some items to u32/f32

    * metrics cleanup

    * wallet and account rename, remove "title" from accounts

    * add missing mempool size metric

    * UTXO "stasis" mode for new coinbase transactions

    * remove useless Option from the rpc url parser

    * fix daa score in maturity state check

    * add name_or_id to PrvKeyDataInfo

    * wallet RPC Connect/Disconnect and GetStatus API calls

    * cleanup

    * support for 12-word bip39 mnemonics

    * add a hidden --daemon flag to kaspad

    * refactor get_daa_score_timestamp helper to return Vec<u64> instead of Response struct

    * Add Scan event

    * implement support for unixtime in transactions

    * kaspa value formatting functions

    * fix a deadlock due to re-entrant mutex lock when loading multiple accounts from storage

    * introduce utxo stasis mode + make balance carry utxo counts as well as the totals

    * refactor wallet events, replace reset() with close() where appropriate

    * manual debug impl for tx components (display script as hex, address as address etc)

    * fix incorrect gas assignment in WASM bindings

    * updates for wallet event handling

    * refactor sign_with_multiple to return Err(tx) when partially signed

    * refactor Storage and Wallet descriptors

    * fix account derivation index handling in DerivationCapable

    * track acceptance DAA stamp in outgoing transaction record

    * temporary harness for embedding script engine directly into tx generator (used for debugging)

    * convert PendingTransaction Utxo entries into HashSet

    * rename pending tx fns

    * outgoing tx wrapper around pending tx

    * refactor notification events during wallet ops

    * as_ref() for PrvKeyData

    * wip - initial RpcCoreMocks for wallet framework tests

    * wallet api messages update for StorageDescriptor usage

    * update AddressDerivationMeta to track addresses from index 0

    * add AHash and async_channel to wallet_core crate

    * allow Args to be used externally for daemon argument pre-validation

    * impl Hash for UtxoEntryReference and rename "fake()" to "simulated()"

    * update wallet events

    * expose tx validator check_scripts() as pub

    * update wallet wasm fns for wallet and storage descriptors

    * rename kaspa-metrics to kaspa-metrics-core

    * code formatting

    * code formatting

    * migrate transaction console formatting to cli/extensions

    * refactor wallet events

    * use ahash for faster processing in wallet hash maps (utxo context)

    * wallet - add SendError handling for error::Error

    * wallet event refactoring, scan/discovery process refactoring, wallet change secret api handling

    * refactoring: transfer and deep derivation scan

    * transaction record refactoring

    * wallet - support for cross-account transfers in generator

    * wallet - outgoing transaction impl

    * wallet - refactor maturity handling

    * wallet/utxo - initial tests scaffolding

    * minor optimization of the discovery/scan process

    * wallet - utxo processor outgoing tx and discovery timestamp unixtime handling

    * refactor utxo context to use output transactions, refactor transfers, compound and change notifications

    * code formatting + Cargo.lock update

    * Signed enum to represent Fully or Partially signed tx

    * bind p2p and grpc bandwidth metrics

    * misc clippy fixes

    * cleanup

    * remove --daemon as Args::parse() offers external mutations

    * remove previously implemented mnemonic variant in favor of client-side mnemonic creation

    * remove AccessContextT, convert to wallet_secret, wip WalletApi traits, refactor account args

    * code formatting

    * separate runtime wallet into multiple modules

    * wallet - revert create_accounts to process a single account at a time

    * cleanup

    * wallet - JSON import and export + preliminary docs

    * address - AddressList - fix TryFrom deadlock caused by recursive trait invocation

    * wallet - api rustdoc + cleanup, transaction calls

    * wallet docs

    * change address debug formatting

    * adding cli rpc addpeer

    * wip - wallet restructuring

    * wip - restructure wallet modules

    * wip - wallet restructuring - cleanup

    * wip - AccountKind refactoring

    * wallet - refactoring storage serialization & encryption

    * fold in PR #349

    * wallet framework - misc helper fns and cleanup

    * storage unit tests + prv key data module restructuring

    * wallet - account factory registrations

    * Remove panics caused by sudden loss of connection while submitting transactions.

    * cleanup

    * cleanup

    * cleanup + docs

    * docs

    * adjust metrics formatting

    * cleanup

    * bump workflow-rs to 0.10.1

    * fix wallet storage unit tests

    * fix generator unit tests

    * convert missing listener_id panic to error

    * docs

    * code formatting

    * lints

    * misc updates following github reviews

    * refactor AccountKind to use fixedstr and implement Copy

    * refactor AccountKind to use fixedstr (str64) and re-implement Copy, removing clone() where necessary

    * change js-bound fn names from *as* to *to* to follow Rust conventions

    * replace AssocPrvKeyDataIds iter().any() to contains()

    * remove vec![] in MetricsGroup iterator fn; add TODO comment on Metric::group()

    * scope magic numbers within their associated structs

    * add try_fully_signed() and try_partially_signed() fns to Signed that allow recovery of the tx

    * refactor local storage cache to use RwLock instead of a Mutex

    * refactor serialization as per github feedback (partial trait impl)

    * Optimize AssocPrvKeyDataIds to use Either in the IntoIter impl, removing allocations.

    * Refactor to bypass aux buffer creation when storing wallet on native platforms.

    * impl custom Debug for storage structs to display data in hex

    * adding misc SAFETY comments on unsafe ops

    * TODO comments for later SignerT+multisig refactoring

    * Change panic!() to unreachable!() to make it clearer that a state should not be reached.

    * rename TransactionRecord::unixtime to unixtime_msec

    * fix wrong references in comments

    * Fix min_cosigner_index handling in multisig fns

    * add comments to UtxoContext::insert() error handling

    * bind AccountStorable:Storable for AccountStorage, migrate Storable into a separate module, add comments to MAGIC values in some locations

    * make framework init functions unsafe

    * update workflow-rs to 0.10.2

    * fix comments

    * fix data cloning when getting collection counts

    * adding TODO notes to wasm macros and KAS value decimal parsing

    ---------

    Co-authored-by: Surinder Singh Matoo <[email protected]>

commit 10d0ebf
Author: D-Stacks <[email protected]>
Date:   Tue Dec 26 10:43:59 2023 +0100

    make step 3. of linux installation not fail copy and paste (#363)

    remove the space to escape the newline instead.

* reduce children cache policy

* reduce caches 25%

* increase tx cache

* fix gd alloc and slightly increase other numbers

* fix a cache alloc bug by redesigning the cache and adding a min units option + fix bps constants

* fix simpa short cmd op name colision

* move impls to inner struct

* comments, docs and technical refactoring

* refactor MemSizeEstimator

* refactor bool to MemMode

* memsize docs

* remove unneeded min limits

* comments and name enhancements

* rename `CachePolicy::Units` to `CachePolicy::Count` to avoid confusion with `MemMode`

* use estimated num of unique headers in validate pruning point headers cache

* cache policy builder

* add todos

* median window has different size + comments

* read ghostdag data from compact access if possible

* remove wrong upper bound for reachability sets
D-Stacks pushed a commit to D-Stacks/rusty-kaspa that referenced this pull request Jan 23, 2024
* external access to kaspad core rpc services API

* rename wallet event members for serde serialization
misc wallet functionality update

* wip - event renaming

* wip - event serialization tuneup

* remove default wrpc listening ports on kaspad Args + fix port mapping bug for automatic JSON RPC port mapping.

* Box wallet events

* introduce RpcCtl + isolate wRPC from DynRpcApi

* debug trait for secret

* de-couple wRPC from the runtiem wallet making RPC bindings generic

* convert wallet_list to return Vec<WalletDescriptor>

* user-friendly error message on decryption error

* UtxoProcessor - ignore task shutdown if not running

* wallet storage data versioning

* wallet - propagate wallet title

* sort traits on WalletDescriptor

* wallet - use precise decimal conversion when parsing strings to sompi

* display kaspa on get-balance-by-address-rpc

* wallet - rename settings fns to have try_ prefixes

* rename library names "kaspad" and "kaspa_cli" to "kaspad_lib" and "kaspa_cli_lib" to prevent build collisions

* no-unsafe-eval feature

* allow for chrome-extension schema in the RPC url

* wallet - expose bip32 wordlist for external access

* wallet - delegate rpc ownership to utxo_processor; reorder rpc disconnect to occur before utxo_processor shutdown;

* wallet - migrate wallet settings loading to cli

* rename RpcCtlOp (Open, Close) to RpcState (Opened, Closed)

* remove automatic RPC disconnect from wallet stop() to allow retention of the RPC channel after closing the wallet

* allow UtxoProcessor to bind to an already existing/connected RPC channel, allow retention of a connected RPC channel past UtxoProcessor shutdown. (API centric defensive functionality)

* code formatting

* fix clippy warnings

* migrate chrome-extension to use ws:// schema by default

* wallet list formatting

* staging for WRS 0.7.0

* add bip32 word list iterator

* update WRS to 0.7.0

* fix rustdoc errors

* wip - initial WalletApi trait implementation

* wallet - macros and account descriptors

* wallet - ping_call

* cleanup

* wip - wallet api cleanup & testing

* kaspa-metrics as a separate crate

* wip - metrics cleanup

* cargo.lock update

* async/sync api  changes for storage

* merge

* master merge

* wip

* wip

* wip

* wallet - (wip) changes to AccountDescriptor and Wallet API

* metrics - make sink future return as optional

* wip - refactor wallet open; improve wallet event ordering; cleanup

* wip (debugging UtxoChanged notifications) - fix issuance during failed tx

* adding workflow-rs as github dependency (allows CI)

* revert github deps for WRS

* metrics

* refactor metrics to include bdi counts and peer counts

* wallet api updates
refactoring transaction access interface
misc updates to wallet APIs
refactor wallet open sequence
refactor legacy accounts

* wallet framework - fix a but resulting in the early issuane of UTXO maturity events.
Refactor handling of outgoing transaction UTXOs (sending outgoing tx ACKs on UtxoChange removal), minor fixes in the Transaction file-system storage.  Add "outgoing" property to account balances (to track in-flight transactions being submitted until acceptance). Introduce new Events::Change that gets fired specifically when receiving change of the currently outgoing transaction. Initial steps toward Daa property wrapper.

* npm 0.13.0

* metrics - cleanup after RPC refactoring

* rename rust-side of wasm bindings as naming conventions interfere with rust use (make fns more explicitly named)

* make metrics data formatting fns as pub

* expose log levels in kaspa-core::log

* rename metrics & improve metrics fetch task

* add API calls to pre-configure wallet framework stroage folders

* cumulative updates for Cargo.lock

* Improve address error messages for human readability

* PrvKeyData enumeration, initial account transfer support (wip), wallet descriptor handling

* wallet - change error to retain PrvKeyDataId instead of a String

* propagate bip39 flag to runtime account and it's descriptor

* wip - keydata refactoring

* metrics refactoring (bandwidth)

* wip (cleanup)

* misc improvements to metrics

* code formatting

* wRPC bandwidth monitoring + scaffolding for global bandwidth metrics

* bump WRS to 0.9.0

* metrics - add mempool_size and convert some items to u32/f32

* metrics cleanup

* wallet and account rename, remove "title" from accounts

* add missing mempool size metric

* UTXO "stasis" mode for new coinbase transactions

* remove useless Option from the rpc url parser

* fix daa score in maturity state check

* add name_or_id to PrvKeyDataInfo

* wallet RPC Connect/Disconnect and GetStatus API calls

* cleanup

* support for 12-word bip39 mnemonics

* add a hidden --daemon flag to kaspad

* refactor get_daa_score_timestamp helper to return Vec<u64> instead of Response struct

* Add Scan event

* implement support for unixtime in transactions

* kaspa value formatting functions

* fix a deadlock due to re-entrant mutex lock when loading multiple accounts from storage

* introduce utxo stasis mode + make balance carry utxo counts as well as the totals

* refactor wallet events, replace reset() with close() where appropriate

* manual debug impl for tx components (display script as hex, address as address etc)

* fix incorrect gas assignment in WASM bindings

* updates for wallet event handling

* refactor sign_with_multiple to return Err(tx) when partially signed

* refactor Storage and Wallet descriptors

* fix account derivation index handling in DerivationCapable

* track acceptance DAA stamp in outgoing transaction record

* temporary harness for embedding script engine directly into tx generator (used for debugging)

* convert PendingTransaction Utxo entries into HashSet

* rename pending tx fns

* outgoing tx wrapper around pending tx

* refactor notification events during wallet ops

* as_ref() for PrvKeyData

* wip - initial RpcCoreMocks for wallet framework tests

* wallet api messages update for StorageDescriptor usage

* update AddressDerivationMeta to track addresses from index 0

* add AHash and async_channel to wallet_core crate

* allow Args to be used externally for daemon argument pre-validation

* impl Hash for UtxoEntryReference and rename "fake()" to "simulated()"

* update wallet events

* expose tx validator check_scripts() as pub

* update wallet wasm fns for wallet and storage descriptors

* rename kaspa-metrics to kaspa-metrics-core

* code formatting

* code formatting

* migrate transaction console formatting to cli/extensions

* refactor wallet events

* use ahash for faster processing in wallet hash maps (utxo context)

* wallet - add SendError handling for error::Error

* wallet event refactoring, scan/discovery process refactoring, wallet change secret api handling

* refactoring: transfer and deep derivation scan

* transaction record refactoring

* wallet - support for cross-account transfers in generator

* wallet - outgoing transaction impl

* wallet - refactor maturity handling

* wallet/utxo - initial tests scaffolding

* minor optimization of the discovery/scan process

* wallet - utxo processor outgoing tx and discovery timestamp unixtime handling

* refactor utxo context to use output transactions, refactor transfers, compound and change notifications

* code formatting + Cargo.lock update

* Signed enum to represent Fully or Partially signed tx

* bind p2p and grpc bandwidth metrics

* misc clippy fixes

* cleanup

* remove --daemon as Args::parse() offers external mutations

* remove previously implemented mnemonic variant in favor of client-side mnemonic creation

* remove AccessContextT, convert to wallet_secret, wip WalletApi traits, refactor account args

* code formatting

* separate runtime wallet into multiple modules

* wallet - revert create_accounts to process a single account at a time

* cleanup

* wallet - JSON import and export + preliminary docs

* address - AddressList - fix TryFrom deadlock caused by recursive trait invocation

* wallet - api rustdoc + cleanup, transaction calls

* wallet docs

* change address debug formatting

* adding cli rpc addpeer

* wip - wallet restructuring

* wip - restructure wallet modules

* wip - wallet restructuring - cleanup

* wip - AccountKind refactoring

* wallet - refactoring storage serialization & encryption

* fold in PR kaspanet#349

* wallet framework - misc helper fns and cleanup

* storage unit tests + prv key data module restructuring

* wallet - account factory registrations

* Remove panics caused by sudden loss of connection while submitting transactions.

* cleanup

* cleanup

* cleanup + docs

* docs

* adjust metrics formatting

* cleanup

* bump workflow-rs to 0.10.1

* fix wallet storage unit tests

* fix generator unit tests

* convert missing listener_id panic to error

* docs

* code formatting

* lints

* misc updates following github reviews

* refactor AccountKind to use fixedstr and implement Copy

* refactor AccountKind to use fixedstr (str64) and re-implement Copy, removing clone() where necessary

* change js-bound fn names from *as* to *to* to follow Rust conventions

* replace AssocPrvKeyDataIds iter().any() to contains()

* remove vec![] in MetricsGroup iterator fn; add TODO comment on Metric::group()

* scope magic numbers within their associated structs

* add try_fully_signed() and try_partially_signed() fns to Signed that allow recovery of the tx

* refactor local storage cache to use RwLock instead of a Mutex

* refactor serialization as per github feedback (partial trait impl)

* Optimize AssocPrvKeyDataIds to use Either in the IntoIter impl, removing allocations.

* Refactor to bypass aux buffer creation when storing wallet on native platforms.

* impl custom Debug for storage structs to display data in hex

* adding misc SAFETY comments on unsafe ops

* TODO comments for later SignerT+multisig refactoring

* Change panic!() to unreachable!() to make it clearer that a state should not be reached.

* rename TransactionRecord::unixtime to unixtime_msec

* fix wrong references in comments

* Fix min_cosigner_index handling in multisig fns

* add comments to UtxoContext::insert() error handling

* bind AccountStorable:Storable for AccountStorage, migrate Storable into a separate module, add comments to MAGIC values in some locations

* make framework init functions unsafe

* update workflow-rs to 0.10.2

* fix comments

* fix data cloning when getting collection counts

* adding TODO notes to wasm macros and KAS value decimal parsing

---------

Co-authored-by: Surinder Singh Matoo <[email protected]>
D-Stacks pushed a commit to D-Stacks/rusty-kaspa that referenced this pull request Jan 23, 2024
… data sizes (kaspanet#351)

* cache inner struct: prep for tracking size

* initial cache policy and mem size estimator

* use new cache policies

* fix storage calcs

* update TN11 genesis

* temp: limit max block parents in virtual processor

* use more conservative constants (wip)

* ensure sufficient cache allocs for high level stores

* increase caches related to daa window

* Squashed commit of the following:

commit a4ba784
Author: Ori Newman <[email protected]>
Date:   Tue Dec 26 16:22:36 2023 +0200

    Add headers first validation to simpa (kaspanet#364)

commit fb1aa5f
Author: Ori Newman <[email protected]>
Date:   Tue Dec 26 16:07:19 2023 +0200

    Move to mimalloc (kaspanet#361)

    * mimalloc

    * mimalloc disable purge_decommits

    * Add to simpa and integration tests

    * remove redundant unix and replace with win/linux/mac

    * Add comment

    * Add comment

    * Sort out features

    * Get rid of ctor

    ---------

    Co-authored-by: Michael Sutton <[email protected]>

commit b6f7e09
Author: aspect <[email protected]>
Date:   Tue Dec 26 13:38:24 2023 +0200

    Cumulative PR for Wallet & Metrics Refactoring (kaspanet#360)

    * external access to kaspad core rpc services API

    * rename wallet event members for serde serialization
    misc wallet functionality update

    * wip - event renaming

    * wip - event serialization tuneup

    * remove default wrpc listening ports on kaspad Args + fix port mapping bug for automatic JSON RPC port mapping.

    * Box wallet events

    * introduce RpcCtl + isolate wRPC from DynRpcApi

    * debug trait for secret

    * de-couple wRPC from the runtiem wallet making RPC bindings generic

    * convert wallet_list to return Vec<WalletDescriptor>

    * user-friendly error message on decryption error

    * UtxoProcessor - ignore task shutdown if not running

    * wallet storage data versioning

    * wallet - propagate wallet title

    * sort traits on WalletDescriptor

    * wallet - use precise decimal conversion when parsing strings to sompi

    * display kaspa on get-balance-by-address-rpc

    * wallet - rename settings fns to have try_ prefixes

    * rename library names "kaspad" and "kaspa_cli" to "kaspad_lib" and "kaspa_cli_lib" to prevent build collisions

    * no-unsafe-eval feature

    * allow for chrome-extension schema in the RPC url

    * wallet - expose bip32 wordlist for external access

    * wallet - delegate rpc ownership to utxo_processor; reorder rpc disconnect to occur before utxo_processor shutdown;

    * wallet - migrate wallet settings loading to cli

    * rename RpcCtlOp (Open, Close) to RpcState (Opened, Closed)

    * remove automatic RPC disconnect from wallet stop() to allow retention of the RPC channel after closing the wallet

    * allow UtxoProcessor to bind to an already existing/connected RPC channel, allow retention of a connected RPC channel past UtxoProcessor shutdown. (API centric defensive functionality)

    * code formatting

    * fix clippy warnings

    * migrate chrome-extension to use ws:// schema by default

    * wallet list formatting

    * staging for WRS 0.7.0

    * add bip32 word list iterator

    * update WRS to 0.7.0

    * fix rustdoc errors

    * wip - initial WalletApi trait implementation

    * wallet - macros and account descriptors

    * wallet - ping_call

    * cleanup

    * wip - wallet api cleanup & testing

    * kaspa-metrics as a separate crate

    * wip - metrics cleanup

    * cargo.lock update

    * async/sync api  changes for storage

    * merge

    * master merge

    * wip

    * wip

    * wip

    * wallet - (wip) changes to AccountDescriptor and Wallet API

    * metrics - make sink future return as optional

    * wip - refactor wallet open; improve wallet event ordering; cleanup

    * wip (debugging UtxoChanged notifications) - fix issuance during failed tx

    * adding workflow-rs as github dependency (allows CI)

    * revert github deps for WRS

    * metrics

    * refactor metrics to include bdi counts and peer counts

    * wallet api updates
    refactoring transaction access interface
    misc updates to wallet APIs
    refactor wallet open sequence
    refactor legacy accounts

    * wallet framework - fix a but resulting in the early issuane of UTXO maturity events.
    Refactor handling of outgoing transaction UTXOs (sending outgoing tx ACKs on UtxoChange removal), minor fixes in the Transaction file-system storage.  Add "outgoing" property to account balances (to track in-flight transactions being submitted until acceptance). Introduce new Events::Change that gets fired specifically when receiving change of the currently outgoing transaction. Initial steps toward Daa property wrapper.

    * npm 0.13.0

    * metrics - cleanup after RPC refactoring

    * rename rust-side of wasm bindings as naming conventions interfere with rust use (make fns more explicitly named)

    * make metrics data formatting fns as pub

    * expose log levels in kaspa-core::log

    * rename metrics & improve metrics fetch task

    * add API calls to pre-configure wallet framework stroage folders

    * cumulative updates for Cargo.lock

    * Improve address error messages for human readability

    * PrvKeyData enumeration, initial account transfer support (wip), wallet descriptor handling

    * wallet - change error to retain PrvKeyDataId instead of a String

    * propagate bip39 flag to runtime account and it's descriptor

    * wip - keydata refactoring

    * metrics refactoring (bandwidth)

    * wip (cleanup)

    * misc improvements to metrics

    * code formatting

    * wRPC bandwidth monitoring + scaffolding for global bandwidth metrics

    * bump WRS to 0.9.0

    * metrics - add mempool_size and convert some items to u32/f32

    * metrics cleanup

    * wallet and account rename, remove "title" from accounts

    * add missing mempool size metric

    * UTXO "stasis" mode for new coinbase transactions

    * remove useless Option from the rpc url parser

    * fix daa score in maturity state check

    * add name_or_id to PrvKeyDataInfo

    * wallet RPC Connect/Disconnect and GetStatus API calls

    * cleanup

    * support for 12-word bip39 mnemonics

    * add a hidden --daemon flag to kaspad

    * refactor get_daa_score_timestamp helper to return Vec<u64> instead of Response struct

    * Add Scan event

    * implement support for unixtime in transactions

    * kaspa value formatting functions

    * fix a deadlock due to re-entrant mutex lock when loading multiple accounts from storage

    * introduce utxo stasis mode + make balance carry utxo counts as well as the totals

    * refactor wallet events, replace reset() with close() where appropriate

    * manual debug impl for tx components (display script as hex, address as address etc)

    * fix incorrect gas assignment in WASM bindings

    * updates for wallet event handling

    * refactor sign_with_multiple to return Err(tx) when partially signed

    * refactor Storage and Wallet descriptors

    * fix account derivation index handling in DerivationCapable

    * track acceptance DAA stamp in outgoing transaction record

    * temporary harness for embedding script engine directly into tx generator (used for debugging)

    * convert PendingTransaction Utxo entries into HashSet

    * rename pending tx fns

    * outgoing tx wrapper around pending tx

    * refactor notification events during wallet ops

    * as_ref() for PrvKeyData

    * wip - initial RpcCoreMocks for wallet framework tests

    * wallet api messages update for StorageDescriptor usage

    * update AddressDerivationMeta to track addresses from index 0

    * add AHash and async_channel to wallet_core crate

    * allow Args to be used externally for daemon argument pre-validation

    * impl Hash for UtxoEntryReference and rename "fake()" to "simulated()"

    * update wallet events

    * expose tx validator check_scripts() as pub

    * update wallet wasm fns for wallet and storage descriptors

    * rename kaspa-metrics to kaspa-metrics-core

    * code formatting

    * code formatting

    * migrate transaction console formatting to cli/extensions

    * refactor wallet events

    * use ahash for faster processing in wallet hash maps (utxo context)

    * wallet - add SendError handling for error::Error

    * wallet event refactoring, scan/discovery process refactoring, wallet change secret api handling

    * refactoring: transfer and deep derivation scan

    * transaction record refactoring

    * wallet - support for cross-account transfers in generator

    * wallet - outgoing transaction impl

    * wallet - refactor maturity handling

    * wallet/utxo - initial tests scaffolding

    * minor optimization of the discovery/scan process

    * wallet - utxo processor outgoing tx and discovery timestamp unixtime handling

    * refactor utxo context to use output transactions, refactor transfers, compound and change notifications

    * code formatting + Cargo.lock update

    * Signed enum to represent Fully or Partially signed tx

    * bind p2p and grpc bandwidth metrics

    * misc clippy fixes

    * cleanup

    * remove --daemon as Args::parse() offers external mutations

    * remove previously implemented mnemonic variant in favor of client-side mnemonic creation

    * remove AccessContextT, convert to wallet_secret, wip WalletApi traits, refactor account args

    * code formatting

    * separate runtime wallet into multiple modules

    * wallet - revert create_accounts to process a single account at a time

    * cleanup

    * wallet - JSON import and export + preliminary docs

    * address - AddressList - fix TryFrom deadlock caused by recursive trait invocation

    * wallet - api rustdoc + cleanup, transaction calls

    * wallet docs

    * change address debug formatting

    * adding cli rpc addpeer

    * wip - wallet restructuring

    * wip - restructure wallet modules

    * wip - wallet restructuring - cleanup

    * wip - AccountKind refactoring

    * wallet - refactoring storage serialization & encryption

    * fold in PR kaspanet#349

    * wallet framework - misc helper fns and cleanup

    * storage unit tests + prv key data module restructuring

    * wallet - account factory registrations

    * Remove panics caused by sudden loss of connection while submitting transactions.

    * cleanup

    * cleanup

    * cleanup + docs

    * docs

    * adjust metrics formatting

    * cleanup

    * bump workflow-rs to 0.10.1

    * fix wallet storage unit tests

    * fix generator unit tests

    * convert missing listener_id panic to error

    * docs

    * code formatting

    * lints

    * misc updates following github reviews

    * refactor AccountKind to use fixedstr and implement Copy

    * refactor AccountKind to use fixedstr (str64) and re-implement Copy, removing clone() where necessary

    * change js-bound fn names from *as* to *to* to follow Rust conventions

    * replace AssocPrvKeyDataIds iter().any() to contains()

    * remove vec![] in MetricsGroup iterator fn; add TODO comment on Metric::group()

    * scope magic numbers within their associated structs

    * add try_fully_signed() and try_partially_signed() fns to Signed that allow recovery of the tx

    * refactor local storage cache to use RwLock instead of a Mutex

    * refactor serialization as per github feedback (partial trait impl)

    * Optimize AssocPrvKeyDataIds to use Either in the IntoIter impl, removing allocations.

    * Refactor to bypass aux buffer creation when storing wallet on native platforms.

    * impl custom Debug for storage structs to display data in hex

    * adding misc SAFETY comments on unsafe ops

    * TODO comments for later SignerT+multisig refactoring

    * Change panic!() to unreachable!() to make it clearer that a state should not be reached.

    * rename TransactionRecord::unixtime to unixtime_msec

    * fix wrong references in comments

    * Fix min_cosigner_index handling in multisig fns

    * add comments to UtxoContext::insert() error handling

    * bind AccountStorable:Storable for AccountStorage, migrate Storable into a separate module, add comments to MAGIC values in some locations

    * make framework init functions unsafe

    * update workflow-rs to 0.10.2

    * fix comments

    * fix data cloning when getting collection counts

    * adding TODO notes to wasm macros and KAS value decimal parsing

    ---------

    Co-authored-by: Surinder Singh Matoo <[email protected]>

commit 10d0ebf
Author: D-Stacks <[email protected]>
Date:   Tue Dec 26 10:43:59 2023 +0100

    make step 3. of linux installation not fail copy and paste (kaspanet#363)

    remove the space to escape the newline instead.

* reduce children cache policy

* reduce caches 25%

* increase tx cache

* fix gd alloc and slightly increase other numbers

* fix a cache alloc bug by redesigning the cache and adding a min units option + fix bps constants

* fix simpa short cmd op name colision

* move impls to inner struct

* comments, docs and technical refactoring

* refactor MemSizeEstimator

* refactor bool to MemMode

* memsize docs

* remove unneeded min limits

* comments and name enhancements

* rename `CachePolicy::Units` to `CachePolicy::Count` to avoid confusion with `MemMode`

* use estimated num of unique headers in validate pruning point headers cache

* cache policy builder

* add todos

* median window has different size + comments

* read ghostdag data from compact access if possible

* remove wrong upper bound for reachability sets
smartgoo pushed a commit to smartgoo/rusty-kaspa that referenced this pull request Jun 18, 2024
* external access to kaspad core rpc services API

* rename wallet event members for serde serialization
misc wallet functionality update

* wip - event renaming

* wip - event serialization tuneup

* remove default wrpc listening ports on kaspad Args + fix port mapping bug for automatic JSON RPC port mapping.

* Box wallet events

* introduce RpcCtl + isolate wRPC from DynRpcApi

* debug trait for secret

* de-couple wRPC from the runtiem wallet making RPC bindings generic

* convert wallet_list to return Vec<WalletDescriptor>

* user-friendly error message on decryption error

* UtxoProcessor - ignore task shutdown if not running

* wallet storage data versioning

* wallet - propagate wallet title

* sort traits on WalletDescriptor

* wallet - use precise decimal conversion when parsing strings to sompi

* display kaspa on get-balance-by-address-rpc

* wallet - rename settings fns to have try_ prefixes

* rename library names "kaspad" and "kaspa_cli" to "kaspad_lib" and "kaspa_cli_lib" to prevent build collisions

* no-unsafe-eval feature

* allow for chrome-extension schema in the RPC url

* wallet - expose bip32 wordlist for external access

* wallet - delegate rpc ownership to utxo_processor; reorder rpc disconnect to occur before utxo_processor shutdown;

* wallet - migrate wallet settings loading to cli

* rename RpcCtlOp (Open, Close) to RpcState (Opened, Closed)

* remove automatic RPC disconnect from wallet stop() to allow retention of the RPC channel after closing the wallet

* allow UtxoProcessor to bind to an already existing/connected RPC channel, allow retention of a connected RPC channel past UtxoProcessor shutdown. (API centric defensive functionality)

* code formatting

* fix clippy warnings

* migrate chrome-extension to use ws:// schema by default

* wallet list formatting

* staging for WRS 0.7.0

* add bip32 word list iterator

* update WRS to 0.7.0

* fix rustdoc errors

* wip - initial WalletApi trait implementation

* wallet - macros and account descriptors

* wallet - ping_call

* cleanup

* wip - wallet api cleanup & testing

* kaspa-metrics as a separate crate

* wip - metrics cleanup

* cargo.lock update

* async/sync api  changes for storage

* merge

* master merge

* wip

* wip

* wip

* wallet - (wip) changes to AccountDescriptor and Wallet API

* metrics - make sink future return as optional

* wip - refactor wallet open; improve wallet event ordering; cleanup

* wip (debugging UtxoChanged notifications) - fix issuance during failed tx

* adding workflow-rs as github dependency (allows CI)

* revert github deps for WRS

* metrics

* refactor metrics to include bdi counts and peer counts

* wallet api updates
refactoring transaction access interface
misc updates to wallet APIs
refactor wallet open sequence
refactor legacy accounts

* wallet framework - fix a but resulting in the early issuane of UTXO maturity events.
Refactor handling of outgoing transaction UTXOs (sending outgoing tx ACKs on UtxoChange removal), minor fixes in the Transaction file-system storage.  Add "outgoing" property to account balances (to track in-flight transactions being submitted until acceptance). Introduce new Events::Change that gets fired specifically when receiving change of the currently outgoing transaction. Initial steps toward Daa property wrapper.

* npm 0.13.0

* metrics - cleanup after RPC refactoring

* rename rust-side of wasm bindings as naming conventions interfere with rust use (make fns more explicitly named)

* make metrics data formatting fns as pub

* expose log levels in kaspa-core::log

* rename metrics & improve metrics fetch task

* add API calls to pre-configure wallet framework stroage folders

* cumulative updates for Cargo.lock

* Improve address error messages for human readability

* PrvKeyData enumeration, initial account transfer support (wip), wallet descriptor handling

* wallet - change error to retain PrvKeyDataId instead of a String

* propagate bip39 flag to runtime account and it's descriptor

* wip - keydata refactoring

* metrics refactoring (bandwidth)

* wip (cleanup)

* misc improvements to metrics

* code formatting

* wRPC bandwidth monitoring + scaffolding for global bandwidth metrics

* bump WRS to 0.9.0

* metrics - add mempool_size and convert some items to u32/f32

* metrics cleanup

* wallet and account rename, remove "title" from accounts

* add missing mempool size metric

* UTXO "stasis" mode for new coinbase transactions

* remove useless Option from the rpc url parser

* fix daa score in maturity state check

* add name_or_id to PrvKeyDataInfo

* wallet RPC Connect/Disconnect and GetStatus API calls

* cleanup

* support for 12-word bip39 mnemonics

* add a hidden --daemon flag to kaspad

* refactor get_daa_score_timestamp helper to return Vec<u64> instead of Response struct

* Add Scan event

* implement support for unixtime in transactions

* kaspa value formatting functions

* fix a deadlock due to re-entrant mutex lock when loading multiple accounts from storage

* introduce utxo stasis mode + make balance carry utxo counts as well as the totals

* refactor wallet events, replace reset() with close() where appropriate

* manual debug impl for tx components (display script as hex, address as address etc)

* fix incorrect gas assignment in WASM bindings

* updates for wallet event handling

* refactor sign_with_multiple to return Err(tx) when partially signed

* refactor Storage and Wallet descriptors

* fix account derivation index handling in DerivationCapable

* track acceptance DAA stamp in outgoing transaction record

* temporary harness for embedding script engine directly into tx generator (used for debugging)

* convert PendingTransaction Utxo entries into HashSet

* rename pending tx fns

* outgoing tx wrapper around pending tx

* refactor notification events during wallet ops

* as_ref() for PrvKeyData

* wip - initial RpcCoreMocks for wallet framework tests

* wallet api messages update for StorageDescriptor usage

* update AddressDerivationMeta to track addresses from index 0

* add AHash and async_channel to wallet_core crate

* allow Args to be used externally for daemon argument pre-validation

* impl Hash for UtxoEntryReference and rename "fake()" to "simulated()"

* update wallet events

* expose tx validator check_scripts() as pub

* update wallet wasm fns for wallet and storage descriptors

* rename kaspa-metrics to kaspa-metrics-core

* code formatting

* code formatting

* migrate transaction console formatting to cli/extensions

* refactor wallet events

* use ahash for faster processing in wallet hash maps (utxo context)

* wallet - add SendError handling for error::Error

* wallet event refactoring, scan/discovery process refactoring, wallet change secret api handling

* refactoring: transfer and deep derivation scan

* transaction record refactoring

* wallet - support for cross-account transfers in generator

* wallet - outgoing transaction impl

* wallet - refactor maturity handling

* wallet/utxo - initial tests scaffolding

* minor optimization of the discovery/scan process

* wallet - utxo processor outgoing tx and discovery timestamp unixtime handling

* refactor utxo context to use output transactions, refactor transfers, compound and change notifications

* code formatting + Cargo.lock update

* Signed enum to represent Fully or Partially signed tx

* bind p2p and grpc bandwidth metrics

* misc clippy fixes

* cleanup

* remove --daemon as Args::parse() offers external mutations

* remove previously implemented mnemonic variant in favor of client-side mnemonic creation

* remove AccessContextT, convert to wallet_secret, wip WalletApi traits, refactor account args

* code formatting

* separate runtime wallet into multiple modules

* wallet - revert create_accounts to process a single account at a time

* cleanup

* wallet - JSON import and export + preliminary docs

* address - AddressList - fix TryFrom deadlock caused by recursive trait invocation

* wallet - api rustdoc + cleanup, transaction calls

* wallet docs

* change address debug formatting

* adding cli rpc addpeer

* wip - wallet restructuring

* wip - restructure wallet modules

* wip - wallet restructuring - cleanup

* wip - AccountKind refactoring

* wallet - refactoring storage serialization & encryption

* fold in PR kaspanet#349

* wallet framework - misc helper fns and cleanup

* storage unit tests + prv key data module restructuring

* wallet - account factory registrations

* Remove panics caused by sudden loss of connection while submitting transactions.

* cleanup

* cleanup

* cleanup + docs

* docs

* adjust metrics formatting

* cleanup

* bump workflow-rs to 0.10.1

* fix wallet storage unit tests

* fix generator unit tests

* convert missing listener_id panic to error

* docs

* code formatting

* lints

* misc updates following github reviews

* refactor AccountKind to use fixedstr and implement Copy

* refactor AccountKind to use fixedstr (str64) and re-implement Copy, removing clone() where necessary

* change js-bound fn names from *as* to *to* to follow Rust conventions

* replace AssocPrvKeyDataIds iter().any() to contains()

* remove vec![] in MetricsGroup iterator fn; add TODO comment on Metric::group()

* scope magic numbers within their associated structs

* add try_fully_signed() and try_partially_signed() fns to Signed that allow recovery of the tx

* refactor local storage cache to use RwLock instead of a Mutex

* refactor serialization as per github feedback (partial trait impl)

* Optimize AssocPrvKeyDataIds to use Either in the IntoIter impl, removing allocations.

* Refactor to bypass aux buffer creation when storing wallet on native platforms.

* impl custom Debug for storage structs to display data in hex

* adding misc SAFETY comments on unsafe ops

* TODO comments for later SignerT+multisig refactoring

* Change panic!() to unreachable!() to make it clearer that a state should not be reached.

* rename TransactionRecord::unixtime to unixtime_msec

* fix wrong references in comments

* Fix min_cosigner_index handling in multisig fns

* add comments to UtxoContext::insert() error handling

* bind AccountStorable:Storable for AccountStorage, migrate Storable into a separate module, add comments to MAGIC values in some locations

* make framework init functions unsafe

* update workflow-rs to 0.10.2

* fix comments

* fix data cloning when getting collection counts

* adding TODO notes to wasm macros and KAS value decimal parsing

---------

Co-authored-by: Surinder Singh Matoo <[email protected]>
smartgoo pushed a commit to smartgoo/rusty-kaspa that referenced this pull request Jun 18, 2024
… data sizes (kaspanet#351)

* cache inner struct: prep for tracking size

* initial cache policy and mem size estimator

* use new cache policies

* fix storage calcs

* update TN11 genesis

* temp: limit max block parents in virtual processor

* use more conservative constants (wip)

* ensure sufficient cache allocs for high level stores

* increase caches related to daa window

* Squashed commit of the following:

commit a4ba784
Author: Ori Newman <[email protected]>
Date:   Tue Dec 26 16:22:36 2023 +0200

    Add headers first validation to simpa (kaspanet#364)

commit fb1aa5f
Author: Ori Newman <[email protected]>
Date:   Tue Dec 26 16:07:19 2023 +0200

    Move to mimalloc (kaspanet#361)

    * mimalloc

    * mimalloc disable purge_decommits

    * Add to simpa and integration tests

    * remove redundant unix and replace with win/linux/mac

    * Add comment

    * Add comment

    * Sort out features

    * Get rid of ctor

    ---------

    Co-authored-by: Michael Sutton <[email protected]>

commit b6f7e09
Author: aspect <[email protected]>
Date:   Tue Dec 26 13:38:24 2023 +0200

    Cumulative PR for Wallet & Metrics Refactoring (kaspanet#360)

    * external access to kaspad core rpc services API

    * rename wallet event members for serde serialization
    misc wallet functionality update

    * wip - event renaming

    * wip - event serialization tuneup

    * remove default wrpc listening ports on kaspad Args + fix port mapping bug for automatic JSON RPC port mapping.

    * Box wallet events

    * introduce RpcCtl + isolate wRPC from DynRpcApi

    * debug trait for secret

    * de-couple wRPC from the runtiem wallet making RPC bindings generic

    * convert wallet_list to return Vec<WalletDescriptor>

    * user-friendly error message on decryption error

    * UtxoProcessor - ignore task shutdown if not running

    * wallet storage data versioning

    * wallet - propagate wallet title

    * sort traits on WalletDescriptor

    * wallet - use precise decimal conversion when parsing strings to sompi

    * display kaspa on get-balance-by-address-rpc

    * wallet - rename settings fns to have try_ prefixes

    * rename library names "kaspad" and "kaspa_cli" to "kaspad_lib" and "kaspa_cli_lib" to prevent build collisions

    * no-unsafe-eval feature

    * allow for chrome-extension schema in the RPC url

    * wallet - expose bip32 wordlist for external access

    * wallet - delegate rpc ownership to utxo_processor; reorder rpc disconnect to occur before utxo_processor shutdown;

    * wallet - migrate wallet settings loading to cli

    * rename RpcCtlOp (Open, Close) to RpcState (Opened, Closed)

    * remove automatic RPC disconnect from wallet stop() to allow retention of the RPC channel after closing the wallet

    * allow UtxoProcessor to bind to an already existing/connected RPC channel, allow retention of a connected RPC channel past UtxoProcessor shutdown. (API centric defensive functionality)

    * code formatting

    * fix clippy warnings

    * migrate chrome-extension to use ws:// schema by default

    * wallet list formatting

    * staging for WRS 0.7.0

    * add bip32 word list iterator

    * update WRS to 0.7.0

    * fix rustdoc errors

    * wip - initial WalletApi trait implementation

    * wallet - macros and account descriptors

    * wallet - ping_call

    * cleanup

    * wip - wallet api cleanup & testing

    * kaspa-metrics as a separate crate

    * wip - metrics cleanup

    * cargo.lock update

    * async/sync api  changes for storage

    * merge

    * master merge

    * wip

    * wip

    * wip

    * wallet - (wip) changes to AccountDescriptor and Wallet API

    * metrics - make sink future return as optional

    * wip - refactor wallet open; improve wallet event ordering; cleanup

    * wip (debugging UtxoChanged notifications) - fix issuance during failed tx

    * adding workflow-rs as github dependency (allows CI)

    * revert github deps for WRS

    * metrics

    * refactor metrics to include bdi counts and peer counts

    * wallet api updates
    refactoring transaction access interface
    misc updates to wallet APIs
    refactor wallet open sequence
    refactor legacy accounts

    * wallet framework - fix a but resulting in the early issuane of UTXO maturity events.
    Refactor handling of outgoing transaction UTXOs (sending outgoing tx ACKs on UtxoChange removal), minor fixes in the Transaction file-system storage.  Add "outgoing" property to account balances (to track in-flight transactions being submitted until acceptance). Introduce new Events::Change that gets fired specifically when receiving change of the currently outgoing transaction. Initial steps toward Daa property wrapper.

    * npm 0.13.0

    * metrics - cleanup after RPC refactoring

    * rename rust-side of wasm bindings as naming conventions interfere with rust use (make fns more explicitly named)

    * make metrics data formatting fns as pub

    * expose log levels in kaspa-core::log

    * rename metrics & improve metrics fetch task

    * add API calls to pre-configure wallet framework stroage folders

    * cumulative updates for Cargo.lock

    * Improve address error messages for human readability

    * PrvKeyData enumeration, initial account transfer support (wip), wallet descriptor handling

    * wallet - change error to retain PrvKeyDataId instead of a String

    * propagate bip39 flag to runtime account and it's descriptor

    * wip - keydata refactoring

    * metrics refactoring (bandwidth)

    * wip (cleanup)

    * misc improvements to metrics

    * code formatting

    * wRPC bandwidth monitoring + scaffolding for global bandwidth metrics

    * bump WRS to 0.9.0

    * metrics - add mempool_size and convert some items to u32/f32

    * metrics cleanup

    * wallet and account rename, remove "title" from accounts

    * add missing mempool size metric

    * UTXO "stasis" mode for new coinbase transactions

    * remove useless Option from the rpc url parser

    * fix daa score in maturity state check

    * add name_or_id to PrvKeyDataInfo

    * wallet RPC Connect/Disconnect and GetStatus API calls

    * cleanup

    * support for 12-word bip39 mnemonics

    * add a hidden --daemon flag to kaspad

    * refactor get_daa_score_timestamp helper to return Vec<u64> instead of Response struct

    * Add Scan event

    * implement support for unixtime in transactions

    * kaspa value formatting functions

    * fix a deadlock due to re-entrant mutex lock when loading multiple accounts from storage

    * introduce utxo stasis mode + make balance carry utxo counts as well as the totals

    * refactor wallet events, replace reset() with close() where appropriate

    * manual debug impl for tx components (display script as hex, address as address etc)

    * fix incorrect gas assignment in WASM bindings

    * updates for wallet event handling

    * refactor sign_with_multiple to return Err(tx) when partially signed

    * refactor Storage and Wallet descriptors

    * fix account derivation index handling in DerivationCapable

    * track acceptance DAA stamp in outgoing transaction record

    * temporary harness for embedding script engine directly into tx generator (used for debugging)

    * convert PendingTransaction Utxo entries into HashSet

    * rename pending tx fns

    * outgoing tx wrapper around pending tx

    * refactor notification events during wallet ops

    * as_ref() for PrvKeyData

    * wip - initial RpcCoreMocks for wallet framework tests

    * wallet api messages update for StorageDescriptor usage

    * update AddressDerivationMeta to track addresses from index 0

    * add AHash and async_channel to wallet_core crate

    * allow Args to be used externally for daemon argument pre-validation

    * impl Hash for UtxoEntryReference and rename "fake()" to "simulated()"

    * update wallet events

    * expose tx validator check_scripts() as pub

    * update wallet wasm fns for wallet and storage descriptors

    * rename kaspa-metrics to kaspa-metrics-core

    * code formatting

    * code formatting

    * migrate transaction console formatting to cli/extensions

    * refactor wallet events

    * use ahash for faster processing in wallet hash maps (utxo context)

    * wallet - add SendError handling for error::Error

    * wallet event refactoring, scan/discovery process refactoring, wallet change secret api handling

    * refactoring: transfer and deep derivation scan

    * transaction record refactoring

    * wallet - support for cross-account transfers in generator

    * wallet - outgoing transaction impl

    * wallet - refactor maturity handling

    * wallet/utxo - initial tests scaffolding

    * minor optimization of the discovery/scan process

    * wallet - utxo processor outgoing tx and discovery timestamp unixtime handling

    * refactor utxo context to use output transactions, refactor transfers, compound and change notifications

    * code formatting + Cargo.lock update

    * Signed enum to represent Fully or Partially signed tx

    * bind p2p and grpc bandwidth metrics

    * misc clippy fixes

    * cleanup

    * remove --daemon as Args::parse() offers external mutations

    * remove previously implemented mnemonic variant in favor of client-side mnemonic creation

    * remove AccessContextT, convert to wallet_secret, wip WalletApi traits, refactor account args

    * code formatting

    * separate runtime wallet into multiple modules

    * wallet - revert create_accounts to process a single account at a time

    * cleanup

    * wallet - JSON import and export + preliminary docs

    * address - AddressList - fix TryFrom deadlock caused by recursive trait invocation

    * wallet - api rustdoc + cleanup, transaction calls

    * wallet docs

    * change address debug formatting

    * adding cli rpc addpeer

    * wip - wallet restructuring

    * wip - restructure wallet modules

    * wip - wallet restructuring - cleanup

    * wip - AccountKind refactoring

    * wallet - refactoring storage serialization & encryption

    * fold in PR kaspanet#349

    * wallet framework - misc helper fns and cleanup

    * storage unit tests + prv key data module restructuring

    * wallet - account factory registrations

    * Remove panics caused by sudden loss of connection while submitting transactions.

    * cleanup

    * cleanup

    * cleanup + docs

    * docs

    * adjust metrics formatting

    * cleanup

    * bump workflow-rs to 0.10.1

    * fix wallet storage unit tests

    * fix generator unit tests

    * convert missing listener_id panic to error

    * docs

    * code formatting

    * lints

    * misc updates following github reviews

    * refactor AccountKind to use fixedstr and implement Copy

    * refactor AccountKind to use fixedstr (str64) and re-implement Copy, removing clone() where necessary

    * change js-bound fn names from *as* to *to* to follow Rust conventions

    * replace AssocPrvKeyDataIds iter().any() to contains()

    * remove vec![] in MetricsGroup iterator fn; add TODO comment on Metric::group()

    * scope magic numbers within their associated structs

    * add try_fully_signed() and try_partially_signed() fns to Signed that allow recovery of the tx

    * refactor local storage cache to use RwLock instead of a Mutex

    * refactor serialization as per github feedback (partial trait impl)

    * Optimize AssocPrvKeyDataIds to use Either in the IntoIter impl, removing allocations.

    * Refactor to bypass aux buffer creation when storing wallet on native platforms.

    * impl custom Debug for storage structs to display data in hex

    * adding misc SAFETY comments on unsafe ops

    * TODO comments for later SignerT+multisig refactoring

    * Change panic!() to unreachable!() to make it clearer that a state should not be reached.

    * rename TransactionRecord::unixtime to unixtime_msec

    * fix wrong references in comments

    * Fix min_cosigner_index handling in multisig fns

    * add comments to UtxoContext::insert() error handling

    * bind AccountStorable:Storable for AccountStorage, migrate Storable into a separate module, add comments to MAGIC values in some locations

    * make framework init functions unsafe

    * update workflow-rs to 0.10.2

    * fix comments

    * fix data cloning when getting collection counts

    * adding TODO notes to wasm macros and KAS value decimal parsing

    ---------

    Co-authored-by: Surinder Singh Matoo <[email protected]>

commit 10d0ebf
Author: D-Stacks <[email protected]>
Date:   Tue Dec 26 10:43:59 2023 +0100

    make step 3. of linux installation not fail copy and paste (kaspanet#363)

    remove the space to escape the newline instead.

* reduce children cache policy

* reduce caches 25%

* increase tx cache

* fix gd alloc and slightly increase other numbers

* fix a cache alloc bug by redesigning the cache and adding a min units option + fix bps constants

* fix simpa short cmd op name colision

* move impls to inner struct

* comments, docs and technical refactoring

* refactor MemSizeEstimator

* refactor bool to MemMode

* memsize docs

* remove unneeded min limits

* comments and name enhancements

* rename `CachePolicy::Units` to `CachePolicy::Count` to avoid confusion with `MemMode`

* use estimated num of unique headers in validate pruning point headers cache

* cache policy builder

* add todos

* median window has different size + comments

* read ghostdag data from compact access if possible

* remove wrong upper bound for reachability sets
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.

6 participants