[rooch-rpc-api] SyncStateFilter of the syncStates method supports filtering by application #2838
Labels
proposal
New external API or other notable changes
skill::rust
Need the rust language skill to complete the issue
Milestone
Proposal Details
Background:
When developing a game, in order to quickly synchronize the game status, the general strategy of the client is to
synchronize the latest status of the game in full, and then synchronize subsequent status changes incrementally.
Currently, Rooch supports incremental synchronization of the Object status through tx_order. However,
it does not support synchronization of the entire game status. In order to support synchronization of the entire game status,
there are two solutions: 1: synchronization through the address of the game contract; 2: synchronization through the game Root object ID.
Expected functions:
Code
Filter logic:
Traverse the queried StateChangeSetWithTxOrder, if the recursive Parent Object of ObjectChange matches ParentObjectID, keep it
Code
StructTagPattern example: 0x1::::, 0x1::gas_coin::*, 0x1::gas_coin::RGas
Filtering logic:
Traverse the queried StateChangeSetWithTxOrder, and keep the embedded StructTag of ObjectChange if it matches StructTagPattern
Parent Issue:
#768
The text was updated successfully, but these errors were encountered: