Chia-Network / chips

Apache License 2.0
45 stars 22 forks source link

CHIP-0026: New Wallet Sync Protocol #100

Closed Rigidity closed 4 months ago

danieljperry commented 8 months ago

CHIP-26 is now a Draft. It proposes a new set of protocol messages for syncing a light wallet against a full node. This CHIP will likely be of interest to all Chia wallet developers. Please leave your reviews as comments in this PR.

forReason commented 8 months ago

I support this chip because I am affected by the described problems.

However, I have not made a code review because im not familiar with the wallet internal code and protocols

danieljperry commented 7 months ago

We will have a public Zoom call to discuss the details of this CHIP's design, as well as to answer any questions. When: March 21 at 7 AM PDT 2 PM UTC 10 PM China

See the #chips channel in our Discord for more details.

danieljperry commented 7 months ago

Here is the video from Brandon's discussion of this CHIP: https://youtu.be/onIB-ikRJ-M

Please leave your reviews here soon. The implementation is nearly complete.

Rigidity commented 7 months ago

Update on this CHIP - I've removed AddPuzzleSubscriptions and AddCoinSubscriptions, since they were redundant. RequestCoinState and RequestPuzzleState both have a toggle to subscribe when you have been fully synced to the peak. And if you want to skip syncing coin states for RequestPuzzleState, you can disable both include_spent and include_unspent in the CoinStateFilter object.

So to simplify the protocol and reduce confusion, I've removed the subscribe-only messages. I have also added a reason to RejectCoinState and RejectPuzzleState, to where they will now reject the request if you exceed the subscription limit, in addition to when a reorg occurred. This is a change in behavior from before, where reaching the limit would be silently ignored.

The coin_ids and puzzle_hashes fields in the response of the request state messages will now only indicate which coin ids or puzzle hashes were actually processed and included in a query. Any request items which were not in the response should be requested separately. This allows implementors of the protocol to set their own limits, (hopefully) without breaking wallets that use the protocol.

Lastly, the mempool event (TransactionAdded and TransactionRemoved) functionality will not be in the initial implementation PR for this CHIP.

danieljperry commented 5 months ago

This CHIP is now in Review. Most of the implementation is complete and ready to be merged. Please leave your reviews here.

danieljperry commented 4 months ago

This CHIP is now in Last Call. If no changes are required after two weeks, it will be moved to Final.

danieljperry commented 4 months ago

This CHIP is now Final. No further changes are allowed (other than adding errata).