Skip to content

storage: use trait for some high level storage operations & merge RPC operations of native and wasm#268

Closed
Officeyutong wants to merge 20 commits intonervosnetwork:developfrom
Officeyutong:use-trait-for-storage-functions
Closed

storage: use trait for some high level storage operations & merge RPC operations of native and wasm#268
Officeyutong wants to merge 20 commits intonervosnetwork:developfrom
Officeyutong:use-trait-for-storage-functions

Conversation

@Officeyutong
Copy link
Collaborator

@Officeyutong Officeyutong commented Jan 16, 2026

This PR adds the following traits:

  • StorageHighLevelOperations: Containing functions implemented by each database implementations
  • StorageGeneralOperations: Containing functions that can be implemented based on StorageHighLevelOperations
  • StorageGetPinnedRelatedOperations: Containing functions that used get_pinned function of struct Storage
  • StorageBatchRelatedOperations: Containing functions that used struct Batch of each database implementations

With these traits, StorageWithChainData and XXXRPCImpls won't base on struct Storage, instead, they will be based on the given traits.

Based on these traits, this PR merges ths PRC implementations of rocksdb, rusqlite and wasm into a single crate ckb-light-client-rpc, without the need of three duplicated RPC implementations

@Officeyutong Officeyutong changed the title storage: use trait for some high level storage operations storage: use trait for some high level storage operations & merge RPC operations of native and wasm Jan 21, 2026
@quake
Copy link
Member

quake commented Feb 24, 2026

duplicate #270

@quake quake closed this Feb 24, 2026
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.

3 participants