Cesar Rodas cesar

cesar hizo push a proto/independent-signatory en cesar/cdk

hace 3 semanas

cesar hizo push a main en cesar/cdk

hace 3 semanas

cesar hizo push a tmp-sigantory en cesar/cdk

  • 45d551146a Add more commands
  • 84c5b6d57f Remove the shared Mint instance between tests Since the SignatoryManager spawns a worker (with `tokio::spawn`) to execute the Signatory (which implements the `Signatory` trait), a mpsc channel is used to exchange messages. In side Tokio tests, each test has its own Tokio runtime. When the first test is done, since `instantiate` shares all the Mint instances, their Tokio runtime is dropped, and the tokio::spawn's task gets killed, breaking the channel. Since the SignatoryManager has no way to respawn, understandably so, since the task runs in an infinite loop, receiving messages and spawning new tasks to non-blocking. There are two choices: either create one Mint per test (which is what this PR does) or compile a modified version of the SignatoryManager for tests, which performs the calls to the Signatory trait in place instead of converting it to a message and passing to the signatory Tokio task. The first option is more straightforward and fixes other instances of the code where `tokio::spawn` is used, such as subscriptions. A third option could be explored, which would imply spawning a Tokio runtime in another OS-level thread, creating the Mint in that context, and sharing it with everything else; perhaps this should explored further if the idea is to test Mint this way.
  • 7fe6e2b418 Introduce a SignatoryManager service. The SignatoryManager manager provides an API to interact with keysets, private keys, and all key-related operations, offering segregation between the mint and the most sensible part of the mind: the private keys. Although the default signatory runs in memory, it is completely isolated from the rest of the system and can only be communicated through the interface offered by the signatory manager. Only messages can be sent from the mintd to the Signatory trait through the Signatory Manager. This pull request sets the foundation for eventually being able to run the Signatory and all the key-related operations in a separate service, possibly in a foreign service, to offload risks, as described in #476. The Signatory manager is concurrent and deferred any mechanism needed to handle concurrency to the Signatory trait.
  • 0cd1d6a194 style: Clean up CHANGELOG.md formatting and consistency (#625)
  • f7d9a1b5db Drop the in-memory database (#613) * Drop the in-memory database Fixes #607 This PR drops the implementation of in-memory database traits. They are useful for testing purposes since the tests should test our codebase and assume the database works as expected (although a follow-up PR should write a sanity test suite for all database trait implementors). As complexity is worth with database requirements to simplify complexity and add more robustness, for instance, with the following plans to add support for transactions or buffered writes, it would become more complex and time-consuming to support a correct database trait. This PR drops the implementation and replaces it with a SQLite memory instance * Remove OnceCell<Mint> Without this change, a single Mint is shared for all tests, and the first tests to run and shutdown makes the other databases (not-reachable, as dropping the tokio engine would also drop the database instance). There is no real reason, other than perhaps performance. The mint should perhaps run in their own tokio engine and share channels as API interfaces, or a new instance should be created in each tests * Fixed bug with foreign keys [1] https://gist.github.com/crodas/bad00997c63bd5ac58db3c5bd90747ed * Show more debug on failure * Remove old code * Remove old references to WalletMemoryDatabase

hace 3 semanas

cesar nueva rama tmp-sigantory creada en cesar/cdk

hace 3 semanas

cesar hizo push a simpler-proto en cesar/cdk

  • 45e33578ec WIP: Working on a simpler Proto
  • f93bd1799b Make sure signatory has all the keys in memory Drop also foreign constraints on sqlite
  • a94febf043 Removed KeysDatabase Trait from MintDatabase All Keys operations should be done through the signatory
  • a59c534260 Do not read keys from the DB
  • e94c8186b3 Fixed missing default feature for signatory

hace 3 semanas

cesar nueva rama simpler-proto creada en cesar/cdk

hace 3 semanas

cesar hizo push a fix/race-condition-state-update en cesar/cdk

  • 25fad98aa8 Fix formatting
  • 5505f0b5d7 Apply suggestions from code review Co-authored-by: thesimplekid <tsk@thesimplekid.com>
  • 81a6d68ef3 Remove wallet states from `check_state_transition`
  • abdde307c6 Fix race conditions with proof state updates. Add a strict set of updates to prevent incorrect state changes and correct usage. Supporting the transaction at the trait level prevented some cases, but having a strict set of state change flows is better. This bug was found while developing the signatory. The keys are read from memory, triggering race conditions at the database, and some `Pending` states are selected (instead of just selecting `Unspent`). This PR also introduces a set of generic database tests to be executed for all database implementations, this test suite will make sure writing and maintaining new database drivers
  • 3626dd2f6a Merge pull request #727 from thesimplekid/fix_debug_info_panic Fix debug info panic

hace 3 semanas

cesar nueva rama fix/race-condition-state-update creada en cesar/cdk

hace 3 semanas

cesar hizo push a fix/memory-issue-with-empty-db en cesar/cdk

  • d8864dbcb6 Do not create the wallet struct directly; instead, call new. The bug comes with the SQLx-sqlite pool bug, where several connections are created by default, but the `new` function takes care of that, fixing that bug by making a single instance of the database. If constructed directly, the pool would create several connections to the database, which in most instances is fine, but with SQLite :memory: each connection is entirely independent. Also follow documentation to make sure that failed `acquire` will not end up dropping connections by setting test_before_acquire to false However, if your workload is sensitive to dropped connections such as using an in-memory SQLite database with a pool size of 1, you can pretty easily ensure that a cancelled `acquire()` call will never drop connections by tweaking your [`PoolOptions`]: * Set [`test_before_acquire(false)`][PoolOptions::test_before_acquire] * Never set [`before_acquire`][PoolOptions::before_acquire] or [`after_connect`][PoolOptions::after_connect].
  • d224cc57b5 Melt to amountless invoice (#497) * feat: melt token with amountless * fix: docs * fix: extra migration
  • 09f339e6c6 Merge pull request #704 from thesimplekid/fix_mint_pending fix: mint pending get mint info to create auth wallet
  • 71bfe1ff9c fix: mint pending get mint info to create auth wallet
  • d68fdd1a0c Merge pull request #703 from thesimplekid/fix_nutshell_tests fix: nutshell tests

hace 3 semanas

cesar nueva rama fix/memory-issue-with-empty-db creada en cesar/cdk

hace 3 semanas

cesar hizo push a feature/rusqlite en cesar/cdk

  • f5cc218b57 WIP
  • 0b9ca1a474 Time time series (#708) * feat: Add created_time and paid_time fields to MintQuote struct * feat: Add serde default of 0 for created_time in MintQuote * feat: Add created_time and paid_time to MintQuote and MeltQuote structs * feat: Add paid_time update when setting melt quote state to Paid * fix: Update melt quote state with current Unix timestamp * feat: Add paid_time update for mint quote when state is set to Paid * feat: Add issued_time field to MintQuote conversion from SQLite row * feat: Add issued_time tracking for MintQuoteState::Issued state * feat: Add migration script for mint time of quotes * feat: Add timestamp columns to mint_quote and melt_quote tables * feat: Add timestamp columns to `add_mint_quote` method * refactor: Improve code formatting and readability in mint quote state update logic * feat: Add created_time and paid_time columns to melt_quote query * feat: time on mint and melt quotes * feat: Add migration script for mint created time signature feat: Add created_time column to blind_signature table feat: Add created_time to blind_signature insertion feat: Add created_time column to proof table and update insert query feat: time on mint and melt quotes * feat: Add new table to track blind signature creation time * feat: Add timestamp tracking for proofs in ReDB database * feat: redb proof time * chore: fmt
  • 43ab1fdde1 Do not create the wallet struct directly; instead, call new. (#707) The bug comes with the SQLx-sqlite pool bug, where several connections are created by default, but the `new` function takes care of that, fixing that bug by making a single instance of the database. If constructed directly, the pool would create several connections to the database, which in most instances is fine, but with SQLite :memory: each connection is entirely independent. Also follow documentation to make sure that failed `acquire` will not end up dropping connections by setting test_before_acquire to false However, if your workload is sensitive to dropped connections such as using an in-memory SQLite database with a pool size of 1, you can pretty easily ensure that a cancelled `acquire()` call will never drop connections by tweaking your [`PoolOptions`]: * Set [`test_before_acquire(false)`][PoolOptions::test_before_acquire] * Never set [`before_acquire`][PoolOptions::before_acquire] or [`after_connect`][PoolOptions::after_connect].
  • d224cc57b5 Melt to amountless invoice (#497) * feat: melt token with amountless * fix: docs * fix: extra migration
  • 09f339e6c6 Merge pull request #704 from thesimplekid/fix_mint_pending fix: mint pending get mint info to create auth wallet

hace 3 semanas

cesar nueva rama feature/rusqlite creada en cesar/cdk

hace 3 semanas

cesar hizo push a feature/debug-random-migration-failures-sqlite en cesar/cdk

  • 321e7796a0 Debug commit Check which SQLite version is installed in the CI
  • 1cfb51a4c3 Merge pull request #659 from thesimplekid/half_msrv chore: msrv of half
  • 619a89060c chore: msrv of half
  • 4c447cf046 Merge pull request #656 from thesimplekid/payment_request_builder feat: payments request builder
  • 0155962d11 Update crates/cashu/src/nuts/nut18.rs Co-authored-by: ok300 <106775972+ok300@users.noreply.github.com>

hace 3 semanas

cesar nueva rama feature/debug-random-migration-failures-sqlite creada en cesar/cdk

hace 3 semanas

cesar hizo push a feat/swap-before-melt- en cesar/cdk

  • 3626dd2f6a Merge pull request #727 from thesimplekid/fix_debug_info_panic Fix debug info panic
  • 717742be05 fix: debug print of info
  • f5f3e50507 fix: Correct mnemonic hashing in Debug implementation
  • 607cdf23d4 feat: Add robust mnemonic hashing and debug tests for Info struct
  • 7715d45f3b Merge pull request #724 from thesimplekid/token_value_uniqe refactor: Ensure unique proofs when calculating token value

hace 3 semanas

cesar nueva rama feat/swap-before-melt- creada en cesar/cdk

hace 3 semanas

cesar hizo push a feat/swap-before-melt en cesar/cdk

  • 252d5604ce WIP
  • 3626dd2f6a Merge pull request #727 from thesimplekid/fix_debug_info_panic Fix debug info panic
  • 717742be05 fix: debug print of info
  • f5f3e50507 fix: Correct mnemonic hashing in Debug implementation
  • 607cdf23d4 feat: Add robust mnemonic hashing and debug tests for Info struct

hace 3 semanas

cesar nueva rama feat/swap-before-melt creada en cesar/cdk

hace 3 semanas

cesar hizo push a proto/independent-signatory en cesar/cdk

hace 3 semanas

cesar hizo push a main en cesar/cdk

hace 3 semanas