Skip to content
This repository has been archived by the owner on Jul 27, 2022. It is now read-only.

Problem: wallet sync logic is not compatible with the refactored tendermint-rs light client design #1881

Closed
yihuang opened this issue Jul 4, 2020 · 0 comments
Assignees
Milestone

Comments

@yihuang
Copy link
Collaborator

yihuang commented Jul 4, 2020

When thinking about #828 and trying to incorporate the new light client design of tendermint-rs, I think our wallet sync logic should be overhauled too.

  • light client from tendermint-rs handled the all the light client sync and verification now, including all the disk and network io, running in standalone thread.
  • it supports multiple peers, a big step on Problem: client currently only works against a single node #1114.
  • the light client sync process can be shared by different wallets.

wallet sync logic will be like this:

let light_client_handle = get_shared_light_client_handle_or_spawn();
let light_block = light_client_handle.verify_to_highest();
// download blocks and sync wallet states
// can safely do batch and fast forward here
// still need to verify block hash and app hashes and the chain
// and verify last block matches the light_block
// only persist wallet state after synced to the last block
set wallet.trusted to false
sync_untrusted_to(light_block.height, light_block.app_hash);
check hashes match with light_block
set wallet.trsuted to true
@yihuang yihuang self-assigned this Jul 4, 2020
yihuang added a commit to yihuang/chain that referenced this issue Jul 7, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
@tomtau tomtau changed the title Problem: wallet sync logic adapt to new tendermint-rs light client design Problem: wallet sync logic is not compatible with the refactored tendermint-rs light client design Jul 7, 2020
yihuang added a commit to yihuang/chain that referenced this issue Jul 10, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
yihuang added a commit to yihuang/chain that referenced this issue Jul 10, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
yihuang added a commit to yihuang/chain that referenced this issue Jul 10, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
yihuang added a commit to yihuang/chain that referenced this issue Jul 10, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
@tomtau tomtau added this to the CRO Sprint 35 milestone Jul 15, 2020
yihuang added a commit to yihuang/chain that referenced this issue Jul 17, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 17, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 17, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 17, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 17, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 18, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 18, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 18, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 18, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 18, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 18, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 20, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 20, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 20, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 21, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 21, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 21, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 21, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
yihuang added a commit to yihuang/chain that referenced this issue Jul 22, 2020
…int-rs light client design

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block
- rpc call_batch ignore the first failed request and return the
  successed ones.
- run ra-sp-server before prepare env, and gen fresh keypackage when prepare test env
- fix tendermint-rs deserialization issues
bors bot added a commit that referenced this issue Jul 22, 2020
1901: Problem (Fix #1881): wallet sync logic is not compatible with the refactored tendermint-rs light client design r=tomtau a=yihuang

Solution:
- running light client superivsor, and sync wallet to recent
  trusted block

Co-authored-by: yihuang <yi.codeplayer@gmail.com>
@bors bors bot closed this as completed in f806885 Jul 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants