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

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

Merged
merged 1 commit into from
Jul 22, 2020

Conversation

yihuang
Copy link
Collaborator

@yihuang yihuang commented Jul 7, 2020

Solution:

  • running light client superivsor, and sync wallet to recent
    trusted block

@yihuang yihuang marked this pull request as draft July 7, 2020 07:55
Copy link
Contributor

@tomtau tomtau left a comment

Choose a reason for hiding this comment

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

I guess this doc can be referenced in the commit + code: https://github.com/informalsystems/tendermint-rs/blob/master/docs/architecture/adr-006-light-client-refactor.md
when initially reading this, I was a bit puzzled by the "Supervisor" term and thought it was spinning up http://supervisord.org or something :D

@tomtau tomtau changed the title Problem (Fix #1881): wallet sync logic adapt to new tendermint-rs light client design Problem (Fix #1881): wallet sync logic is not compatible with the refactored tendermint-rs light client design Jul 7, 2020
@leejw51crypto
Copy link
Collaborator

where is light client supervisor code ?
so , it's run as a separate process ?

@tomtau
Copy link
Contributor

tomtau commented Jul 9, 2020

where is light client supervisor code ?
so , it's run as a separate process ?

it's in the Tendermint refactored light-client crate (refactored from "tendermint-rs" crate) -- see https://github.com/informalsystems/tendermint-rs/blob/master/docs/architecture/adr-006-light-client-refactor.md#integration

@yihuang yihuang force-pushed the issue1881 branch 3 times, most recently from ee3a1c0 to 0e382b4 Compare July 10, 2020 05:10
@yihuang
Copy link
Collaborator Author

yihuang commented Jul 10, 2020

The ring build issue happen again:

[build:325] error[E0425]: cannot find function `fill_impl` in this scope
[build:326]    --> /drone/src/drone/cargo/registry/src/github.com-1ecc6299db9ec823/ring-0.16.12/src/rand.rs:160:9
[build:327]     |
[build:328] 160 |         fill_impl(dest)
[build:329]     |         ^^^^^^^^^ help: try: `self.fill_impl`
[build:330]
[build:331]    Compiling regex v1.3.9
[build:332] error: aborting due to previous error
[build:333]
[build:334] For more information about this error, try `rustc --explain E0425`.
[build:335] error: could not compile `ring`.
[build:336]
[build:337] To learn more, run the command again with --verbose.
[build:338] warning: build failed, waiting for other jobs to finish...
[build:339] error: build failed

@devashishdxt
Copy link
Collaborator

This pull request downgrades ring back to 0.16.12. Maybe update rebase with master.

@devashishdxt
Copy link
Collaborator

It also downgrades webpki.

@yihuang yihuang force-pushed the issue1881 branch 2 times, most recently from ef68120 to 59ca48b Compare July 10, 2020 08:45
@yihuang
Copy link
Collaborator Author

yihuang commented Jul 10, 2020

This pull request downgrades ring back to 0.16.12. Maybe update rebase with master.

The cause of the issue is because tendermint-rs bring in signatory-secp256k1, which has conflict dependencies with newer version of ring.
informalsystems/tendermint-rs#391 (comment)

So either change tendermint-rs to make signatory-secp256k1 optional, or downgrade our ring for now.

EDIT: I changed the cc version constraint in our fork of ring.

@cargo-dep-bot
Copy link

cargo-dep-bot bot commented Jul 10, 2020

This PR made the following dependency changes:

Added Packages (Duplicate versions in '()'):
	addr2line 0.13.0
	adler 0.2.2
	async-tungstenite 0.5.0
	contracts 0.4.0
	cpuid-bool 0.1.0
	curve25519-dalek 1.2.4 (2.1.0)
	derive_more 0.99.9
	elliptic-curve 0.4.0 (0.3.0)
	generator 0.6.21
	gimli 0.22.0
	loom 0.3.4
	miniz_oxide 0.4.0
	object 0.20.0
	prost-amino 0.6.0 (0.5.0)
	ripemd160 0.9.1 (0.8.0)
	scoped-tls 0.1.2
	secp256k1 0.17.2
	secp256k1-sys 0.1.2
	serde_repr 0.1.6
	sha2 0.9.1 (0.8.2)
	signatory-secp256k1 0.20.0
	signature_derive 1.0.0-pre.2
	tendermint-light-client 0.14.0
	tendermint-rpc 0.14.0
	tinyvec 0.3.3

Removed Packages (Remaining versions in '()'):
	arrayvec 0.4.12 (0.5.1)
	backtrace-sys 0.1.37
	digest 0.7.6 (0.8.1, 0.9.0)
	generic-array 0.9.0 (0.14.2, 0.12.3)
	jobserver 0.1.21
	nodrop 0.1.14
	p256 0.1.0 (0.2.0)
	p384 0.1.0
	proc-macro2 0.4.30 (1.0.18)
	static_assertions 0.3.4 (1.1.0)
	subtle-encoding 0.4.1 (0.5.1)
	syn 0.14.9 (1.0.33)

Updated Packages:
	abci: 0.7.0 -> 0.7.1
	aho-corasick: 0.7.10 -> 0.7.13
	arc-swap: 0.4.6 -> 0.4.7
	async-trait: 0.1.30 -> 0.1.36
	backtrace: 0.3.46 -> 0.3.50
	bindgen: 0.53.2 -> 0.53.3
	bstr: 0.2.12 -> 0.2.13
	bumpalo: 3.2.1 -> 3.4.0
	bytes: 0.5.4 -> 0.5.5
	cc: 1.0.58 -> 1.0.41
	clap: 2.33.0 -> 2.33.1
	clear_on_drop: 0.2.3 -> 0.2.4
	crossbeam-queue: 0.2.1 -> 0.2.3
	curve25519-dalek: 2.0.0 -> 2.1.0
	curve25519-dalek: 1.2.3 -> 2.1.0
	dtoa: 0.4.5 -> 0.4.6
	ecdsa: 0.4.0 -> 0.6.1
	ed25519: 1.0.0-pre.1 -> 1.0.1
	fnv: 1.0.6 -> 1.0.7
	hermit-abi: 0.1.12 -> 0.1.15
	hyper: 0.13.5 -> 0.13.6
	itoa: 0.4.5 -> 0.4.6
	js-sys: 0.3.39 -> 0.3.41
	k256: 0.1.1 -> 0.3.0
	lexical-core: 0.6.2 -> 0.7.4
	memoffset: 0.5.4 -> 0.5.5
	mio-named-pipes: 0.1.6 -> 0.1.7
	miow: 0.3.4 -> 0.3.5
	mirai-annotations: 1.8.0 -> 1.9.1
	nom: 5.1.1 -> 5.1.2
	num-integer: 0.1.42 -> 0.1.43
	num-traits: 0.2.11 -> 0.2.12
	oorandom: 11.1.1 -> 11.1.2
	openssl: 0.10.29 -> 0.10.30
	openssl-sys: 0.9.56 -> 0.9.58
	pem: 0.7.0 -> 0.8.1
	pin-project: 0.4.13 -> 0.4.22
	pin-project-internal: 0.4.13 -> 0.4.22
	pin-project-lite: 0.1.5 -> 0.1.7
	plotters: 0.2.14 -> 0.2.15
	ppv-lite86: 0.2.6 -> 0.2.8
	proc-macro-crate: 0.1.4 -> 0.1.5
	proc-macro-error: 1.0.2 -> 1.0.3
	proc-macro-error-attr: 1.0.2 -> 1.0.3
	proc-macro-hack: 0.5.15 -> 0.5.16
	proc-macro-nested: 0.1.4 -> 0.1.6
	prost-amino-derive: 0.5.0 -> 0.6.1
	protobuf: 2.10.2 -> 2.15.1
	protobuf-codegen: 2.10.2 -> 2.15.1
	protobuf-codegen-pure: 2.10.2 -> 2.15.1
	protoc: 2.10.2 -> 2.15.1
	protoc-rust: 2.10.2 -> 2.15.1
	quote: 0.6.13 -> 1.0.7
	quote: 1.0.6 -> 1.0.7
	rayon: 1.3.0 -> 1.3.1
	rayon-core: 1.7.0 -> 1.7.1
	rcgen: 0.8.3 -> 0.8.5
	regex: 1.3.7 -> 1.3.9
	regex-syntax: 0.6.17 -> 0.6.18
	remove_dir_all: 0.5.2 -> 0.5.3
	ring: 0.16.15 -> 0.16.15
	rs-libc: 0.2.1 -> 0.2.0
	ryu: 1.0.4 -> 1.0.5
	schannel: 0.1.18 -> 0.1.19
	security-framework: 0.4.3 -> 0.4.4
	serde_bytes: 0.11.4 -> 0.11.5
	signatory: 0.18.1 -> 0.20.0
	signatory-dalek: 0.18.1 -> 0.20.0
	signature: 1.0.0-pre.1 -> 1.1.0
	smallvec: 1.4.0 -> 1.4.1
	synstructure: 0.12.3 -> 0.12.4
	tendermint: 0.12.0-rc0 -> 0.14.1
	tokio: 0.2.20 -> 0.2.21
	tokio-uds: 0.2.6 -> 0.2.7
	unicode-normalization: 0.1.12 -> 0.1.13
	unicode-width: 0.1.7 -> 0.1.8
	unicode-xid: 0.1.0 -> 0.2.1
	unicode-xid: 0.2.0 -> 0.2.1
	vcpkg: 0.2.8 -> 0.2.10
	version_check: 0.9.1 -> 0.9.2
	wasm-bindgen: 0.2.62 -> 0.2.64
	wasm-bindgen-backend: 0.2.62 -> 0.2.64
	wasm-bindgen-futures: 0.4.12 -> 0.4.14
	wasm-bindgen-macro: 0.2.62 -> 0.2.64
	wasm-bindgen-macro-support: 0.2.62 -> 0.2.64
	wasm-bindgen-shared: 0.2.62 -> 0.2.64
	web-sys: 0.3.39 -> 0.3.41
	winapi: 0.3.8 -> 0.3.9
	yaml-rust: 0.4.3 -> 0.4.4
	yasna: 0.3.1 -> 0.3.2

@leejw51crypto
Copy link
Collaborator

Supervisor term is confusing with that of python , some comment about it?

Copy link
Collaborator

@leejw51crypto leejw51crypto left a comment

Choose a reason for hiding this comment

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

lgtm

@yihuang yihuang marked this pull request as ready for review July 17, 2020 06:38
@yihuang
Copy link
Collaborator Author

yihuang commented Jul 17, 2020

Supervisor term is confusing with that of python , some comment about it?

added the tendermint-rs design doc in comment.

@tomtau
Copy link
Contributor

tomtau commented Jul 21, 2020

bors try

bors bot added a commit that referenced this pull request Jul 21, 2020
@bors
Copy link
Contributor

bors bot commented Jul 21, 2020

try

Build failed:

@yihuang
Copy link
Collaborator Author

yihuang commented Jul 21, 2020

try

Build failed:

I don't see this issue running locally

Preparing... WITH_FEE
--
201 | Error: Run enclave error: No such file or directory (os error 2)

The error message come from dev-utils keypackage generate, it don't find enclave file, strange.

@tomtau
Copy link
Contributor

tomtau commented Jul 21, 2020

try

Build failed:

I don't see this issue running locally

Preparing... WITH_FEE
--
201 | Error: Run enclave error: No such file or directory (os error 2)

The error message come from dev-utils keypackage generate, it don't find enclave file, strange.

not sure if it's because of the force-push while it was executing

@tomtau
Copy link
Contributor

tomtau commented Jul 21, 2020

bors retry

bors bot added a commit that referenced this pull request Jul 21, 2020
@bors
Copy link
Contributor

bors bot commented Jul 21, 2020

try

Build failed:

@tomtau
Copy link
Contributor

tomtau commented Jul 21, 2020

The error message come from dev-utils keypackage generate, it don't find enclave file, strange.

not sure if it's because of the force-push while it was executing

still -- not sure. it doesn't need to be the enclave file; it can also be the signature or the "ftxsgx-runner"

@yihuang
Copy link
Collaborator Author

yihuang commented Jul 21, 2020

The error message come from dev-utils keypackage generate, it don't find enclave file, strange.

not sure if it's because of the force-push while it was executing

still -- not sure. it doesn't need to be the enclave file; it can also be the signature or the "ftxsgx-runner"

it should be the PATH env issue, and my local chain-test image is different from the one in the hub. fixed.

@tomtau
Copy link
Contributor

tomtau commented Jul 21, 2020

bors try

bors bot added a commit that referenced this pull request Jul 21, 2020
@bors
Copy link
Contributor

bors bot commented Jul 21, 2020

try

Build succeeded:

@tomtau
Copy link
Contributor

tomtau commented Jul 22, 2020

bors try

@tomtau
Copy link
Contributor

tomtau commented Jul 22, 2020

bors retry

@bors
Copy link
Contributor

bors bot commented Jul 22, 2020

try

Already running a review

@tomtau
Copy link
Contributor

tomtau commented Jul 22, 2020

bors try-

@tomtau
Copy link
Contributor

tomtau commented Jul 22, 2020

bors try

bors bot added a commit that referenced this pull request 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
@tomtau
Copy link
Contributor

tomtau commented Jul 22, 2020

bors try-

@tomtau
Copy link
Contributor

tomtau commented Jul 22, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 22, 2020

Build succeeded:

@bors bors bot merged commit 4a13c6e into crypto-com:master 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

Successfully merging this pull request may close these issues.

None yet

4 participants