Cesar Rodas cesar

cesar pushed to tmp-signatory at cesar/cdk

  • b16a8da8d6 Refactor: Introduce `cdk-common` internal crate - Created a new internal crate, `cdk-common`, to centralize shared types and trait definitions. - The goal is to enable CDK extensions without requiring CDK as a direct dependency. - However, this approach currently introduces circular dependencies. - Refactor NUT types and traits (e.g., databases and other layers) to reside in `cdk-common` instead of the main `cdk` crate, resolving the circular dependency issue.
  • 96760992db Remove unwrap
  • b90b23cf80 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.
  • c6e27d0de9 Add ArcSwap to update Mint configuration at runtime (#503) * Add ArcSwap to update Mint configuration at runtime The main goal is to change settings without having multiple RwLock everywhere, instead having ArcSwap to update the configuration without having access to a mutable reference to the Mint. This will allow the RPC Server, or any other medium to update the Mint without minimum contention. * Rename structs * Move quote_ttl to the new config * Fixed clippy issues
  • ccb1ee77d0 Merge pull request #446 from thesimplekid/sign_mint feat: nut-20 signature on mint witness

3 weeks ago

cesar created new branch tmp-signatory at cesar/cdk

3 weeks ago

cesar pushed to tmp at cesar/cdk

  • 77ead1b158 Remove cdk-database
  • 8a3f544fdf Add gRPC server
  • a8c289e1a0 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.
  • 0840dfea1a Merge pull request #531 from thesimplekid/itest_mint_builder refactor: mint builder in itest
  • 1f45be28a3 refactor: mint builder in itest

3 weeks ago

cesar created new branch tmp at cesar/cdk

3 weeks ago

cesar pushed to proto/independent-signatory at cesar/cdk

  • 18f7297d1b Add more commands
  • 3db93e501c 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.
  • 792b7a3180 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.
  • 6e86235970 Merge pull request #610 from BitcreditProtocol/peanut/swagger_type fix openApi attributes to keyset id to present it as a string
  • 606385f44a fix openApi attributes to keyset id to present it as a string The attribute `schema(as = String)` does not result in the expected behaviour. It does not convert Id to being represented as a simple string, but rather simply rename the type `Id` to `String`. This commit removes the attribute that implements utoipa::ToSchema trait for type `Id` and adds attribute to all the types that have a keyset id as inner type to represent it as string.

3 weeks ago

cesar created new branch proto/independent-signatory at cesar/cdk

3 weeks ago

cesar pushed to proto/db-transactions at cesar/cdk

3 weeks ago

cesar created new branch proto/db-transactions at cesar/cdk

3 weeks ago

cesar pushed to features/types at cesar/cdk

3 weeks ago

cesar created new branch features/types at cesar/cdk

3 weeks ago

cesar pushed to feature/in-memory-db-sqlite at cesar/cdk

  • bb46e85683 Remove old references to WalletMemoryDatabase
  • cfcf5ead41 Remove old code
  • f6d5360927 Show more debug on failure
  • 960abb63a4 Fixed bug with foreign keys [1] https://gist.github.com/crodas/bad00997c63bd5ac58db3c5bd90747ed
  • 0b6757926c 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

3 weeks ago

cesar created new branch feature/in-memory-db-sqlite at cesar/cdk

3 weeks ago

cesar pushed to feature/drop-amount-str at cesar/cdk

  • f1c69fe5da Add a custom error for invalid amounts
  • 040259c131 Drop AmountStr Fixes #609 Instead write a customer serializer for Keys to serialize amounts as strings
  • 6e86235970 Merge pull request #610 from BitcreditProtocol/peanut/swagger_type fix openApi attributes to keyset id to present it as a string
  • 606385f44a fix openApi attributes to keyset id to present it as a string The attribute `schema(as = String)` does not result in the expected behaviour. It does not convert Id to being represented as a simple string, but rather simply rename the type `Id` to `String`. This commit removes the attribute that implements utoipa::ToSchema trait for type `Id` and adds attribute to all the types that have a keyset id as inner type to represent it as string.
  • e1458b07a8 chore: cdk-mintd v0.7.2

3 weeks ago

cesar created new branch feature/drop-amount-str at cesar/cdk

3 weeks ago

cesar pushed to feature/cdk-database-instance at cesar/cdk

  • c40d68b262 Introduce `cdk-database` This is a crate that makes it easier to create a database instance based on an enum that can be constructed from a CLI or an env variable.
  • 2e16453638 Merge pull request #549 from thesimplekid/update_example_config feat: update example config
  • b51cf3778a Merge pull request #547 from thesimplekid/update_regtest Update regtest
  • 78e51b102a Merge pull request #546 from thesimplekid/remove_cargo_lock chore: remove cargo.lock
  • 0fb7a75fb0 feat: update example config

3 weeks ago

cesar created new branch feature/cdk-database-instance at cesar/cdk

3 weeks ago

cesar pushed to feature/cdk-common at cesar/cdk

  • a3f8addb2f Remove macro
  • 708b7c4c7b Merge remote-tracking branch 'origin/main' into feature/cdk-common
  • 36c1d2a8e5 Merge remote-tracking branch 'origin/feature/cdk-common' into feature/cdk-common
  • 3a4e06dcd1 Remove reqwest from base crate
  • 8ac766dd62 chore: update readme for mint sig

3 weeks ago

cesar created new branch feature/cdk-common at cesar/cdk

3 weeks ago

cesar pushed to feat/sqlite-drop-replace at cesar/cdk

  • ec82379d47 Do not use `INSERT OR REPLACE` in SQLite. Instead, use `INSERT` and `ON CONFLICT`. The reason is that in case of conflicts, the `REPLACE` will trigger a DELETE and then perform an INSERT, as outlined in the documentation[1], and that may cause a cascade of deletion due to our FOREIGN KEYs. Here is the official documentation: ``` When a UNIQUE or PRIMARY KEY constraint violation occurs, the REPLACE algorithm deletes pre-existing rows that are causing the constraint violation prior to inserting or updating the current row and the command continues executing normally. If a NOT NULL constraint violation occurs, the REPLACE conflict resolution replaces the NULL value with the default value for that column, or if the column has no default value, then the ABORT algorithm is used. If a CHECK constraint or foreign key constraint violation occurs, the REPLACE conflict resolution algorithm works like ABORT. When the REPLACE conflict resolution strategy deletes rows in order to satisfy a constraint, delete triggers fire if and only if recursive triggers are enabled. The update hook is not invoked for rows that are deleted by the REPLACE conflict resolution strategy. Nor does REPLACE increment the change counter. The exceptional behaviors defined in this paragraph might change in a future release. ``` [1] https://www.sqlite.org/lang_conflict.html
  • 062d7be58f chore: pin base64ct as newer version is unsuported on stable
  • 827e4aebde Refactor mintd used in itest (#616)
  • 692e13ff16 Refactor Keyset Initialization (#615) * reorg keyset startup initialization
  • d5df413d6b Drop AmountStr (#612) * Drop AmountStr Fixes #609 Instead write a customer serializer for Keys to serialize amounts as strings * Add a custom error for invalid amounts

3 weeks ago

cesar created new branch feat/sqlite-drop-replace at cesar/cdk

3 weeks ago