Skip to content

Conversation

@DemesneGH
Copy link
Contributor

This PR reorganizes basic modules to promote reuse and improve the development experience for TAs.

  • In this initial stage, the secure_db module has been moved into the crates directory.
  • It is now shared across both the secure_db_abstraction and eth_wallet examples.

Future Plans:

  • More common modules can be moved into crates to encourage code reuse and simplify TA development.
  • Once the structure stabilizes, these crates are planned to be published on crates.io, making them easily accessible to the community.

@ivila
Copy link
Contributor

ivila commented May 23, 2025

Acked-by: Zehui Chen <ivila@apache.org> 😀

@DemesneGH DemesneGH requested review from Copilot and m4sterchain May 23, 2025 03:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR centralizes the secure_db logic into a shared crates/secure_db folder and updates all clients to consume the new crate rather than local modules.

  • Moved and restructured secure storage functions into crates/secure_db
  • Updated eth_wallet TA to use SecureStorageClient from the shared crate
  • Adjusted example and workspace manifests to point at the new crate path

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
projects/web3/eth_wallet/ta/src/wallet.rs Added Storable impl and imported secure_db::Storable
projects/web3/eth_wallet/ta/src/secure_storage.rs Removed local secure storage implementation
projects/web3/eth_wallet/ta/src/main.rs Replaced direct storage calls with SecureStorageClient usage
projects/web3/eth_wallet/ta/build.rs Minor whitespace cleanup
projects/web3/eth_wallet/ta/Cargo.toml Added secure_db crate dependency
examples/secure_db_abstraction-rs/ta/src/main.rs Removed local mod secure_db; now uses shared crate
examples/secure_db_abstraction-rs/ta/Cargo.toml Added shared secure_db dependency; removed direct bincode
crates/secure_db/src/db.rs Fixed import path for storage functions
crates/secure_db/src/client.rs Fixed import path for SecureStorageDb
crates/secure_db/src/backend.rs Streamlined match arms and buffer sizing
crates/secure_db/Cargo.toml New crate manifest with dependencies
Comments suppressed due to low confidence (3)

projects/web3/eth_wallet/ta/src/main.rs:175

  • The error message for unsupported commands could include the command ID or name for easier troubleshooting.
 _ => bail!("Unsupported command"),

projects/web3/eth_wallet/ta/src/main.rs:86

  • New storage operations (db_client.put, db_client.get, db_client.delete_entry) are introduced here and in other handlers; consider adding unit or integration tests to cover these paths.
fn create_wallet(

crates/secure_db/Cargo.toml:27

  • The secure_db crate pins bincode = "1.0", while examples previously used bincode = "1.3.3". Aligning versions across crates will prevent dependency conflicts.
bincode = "1.0"

@DemesneGH DemesneGH force-pushed the main branch 2 times, most recently from a0b1baa to 45946b2 Compare May 23, 2025 13:22
@m4sterchain m4sterchain requested a review from Copilot May 23, 2025 14:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reorganizes the project structure by moving the secure_db module into a shared crates/ directory, enabling its use by both the eth_wallet and secure_db_abstraction examples.

  • Moved secure_db into the shared crates/ directory and updated dependency references in Cargo.toml files.
  • Refactored the TA’s main.rs to replace the old secure_storage module with the SecureStorageClient from secure_db.
  • Updated the secure_db crate’s trait bounds and backend functions to standardize key conversion and error handling.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
projects/web3/eth_wallet/ta/src/wallet.rs Added implementation of the Storable trait for Wallet to support secure storage.
projects/web3/eth_wallet/ta/src/secure_storage.rs Removed obsolete secure_storage code in favor of the new secure_db usage.
projects/web3/eth_wallet/ta/src/main.rs Updated session management and secure storage functions to use SecureStorageClient.
projects/web3/eth_wallet/ta/build.rs Minor adjustments in module imports.
projects/web3/eth_wallet/ta/Cargo.toml Added dependency reference for secure_db.
examples/secure_db_abstraction-rs/ta/src/main.rs Removed references to the old secure_db module and updated Storable trait usage.
examples/secure_db_abstraction-rs/ta/Cargo.toml Updated dependency reference for secure_db.
crates/secure_db/src/{storable.rs,db.rs,client.rs,backend.rs} Updated trait bounds, error handling, and key conversion logic within secure_db.
crates/secure_db/Cargo.toml New Cargo.toml for the shared secure_db crate.

Reorganize basic modules to promote reuse and improve the
development experience for TAs.

* the secure_db module has been moved into the crates directory.
* adjusted secure_db_abstraction and eth_wallet examples to use
  the secure_db crate.

Signed-off-by: Yuan Zhuang <yuanz@apache.org>
Acked-by: Zehui Chen <ivila@apache.org>
@DemesneGH
Copy link
Contributor Author

Any other comments before merging? @m4sterchain

@m4sterchain
Copy link
Contributor

Any other comments before merging? @m4sterchain

Feel free to merge after all comments are resolved. Thanks.

@DemesneGH DemesneGH merged commit e67293c into apache:main May 26, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants