From 3db19f64c9bc23ce8fe4c977f0cbc3f218033755 Mon Sep 17 00:00:00 2001 From: yihuang Date: Sat, 2 May 2020 01:15:53 +0800 Subject: [PATCH] Problem (Fix #1523): sync state deserialization fails when nil vote happens Solution: - Make parse_non_empty_id parse null in tendermint-rs --- CHANGELOG.md | 2 ++ Cargo.lock | 2 +- client-common/Cargo.toml | 2 +- client-core/Cargo.toml | 2 +- client-network/Cargo.toml | 2 +- integration-tests/multinode/join_test.py | 1 + test-common/Cargo.toml | 2 +- 7 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b41354ce7..a12cd6f1b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ ### Bug Fixes - *chain-abci* [1516](https://github.com/crypto-com/chain/pull/1516): Fix unbond tx didn't subtract fee from bonded +- *client-core* [1524](https://github.com/crypto-com/chain/pull/1524): Fix the decoding issue of trusted state when nil + vote happens during wallet synchronization. *Unreleased* diff --git a/Cargo.lock b/Cargo.lock index 46bff573e..d75bfb9c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4327,7 +4327,7 @@ dependencies = [ [[package]] name = "tendermint" version = "0.12.0-rc0" -source = "git+https://github.com/crypto-com/tendermint-rs.git?rev=e3c131a35936da7fc1928c3231db70e603f82fd3#e3c131a35936da7fc1928c3231db70e603f82fd3" +source = "git+https://github.com/crypto-com/tendermint-rs.git?rev=e8d350960726b242fdaa67d293d71ba8cfdb8024#e8d350960726b242fdaa67d293d71ba8cfdb8024" dependencies = [ "anomaly", "async-trait", diff --git a/client-common/Cargo.toml b/client-common/Cargo.toml index b80365999..84bc91b54 100644 --- a/client-common/Cargo.toml +++ b/client-common/Cargo.toml @@ -28,7 +28,7 @@ secstr = { version = "0.4.0", features = ["serde"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" sled = { version = "0.31.0", optional = true } -tendermint = { git = "https://github.com/crypto-com/tendermint-rs.git", default-features = false, rev = "e3c131a35936da7fc1928c3231db70e603f82fd3" } +tendermint = { git = "https://github.com/crypto-com/tendermint-rs.git", default-features = false, rev = "e8d350960726b242fdaa67d293d71ba8cfdb8024" } tokio = { version = "0.2", features = ["rt-threaded", "sync", "time", "tcp"], optional = true } tokio-tungstenite = { version = "0.10", features = ["tls"], optional = true } zeroize = "1.1" diff --git a/client-core/Cargo.toml b/client-core/Cargo.toml index 4df889517..e0df7005c 100644 --- a/client-core/Cargo.toml +++ b/client-core/Cargo.toml @@ -37,7 +37,7 @@ tiny-bip39 = { version = "0.7", default-features = false } unicase = "2.6.0" lazy_static = "1.4.0" ring = "0.16.12" -tendermint = { git = "https://github.com/crypto-com/tendermint-rs.git", default-features = false, rev = "e3c131a35936da7fc1928c3231db70e603f82fd3" } +tendermint = { git = "https://github.com/crypto-com/tendermint-rs.git", default-features = false, rev = "e8d350960726b242fdaa67d293d71ba8cfdb8024" } thiserror = { version = "1.0", default-features = false } non-empty-vec = "0.1" zxcvbn = "2.0" diff --git a/client-network/Cargo.toml b/client-network/Cargo.toml index 9add35e15..8e52ac12b 100644 --- a/client-network/Cargo.toml +++ b/client-network/Cargo.toml @@ -17,7 +17,7 @@ chrono = { version = "0.4", features = ["serde"] } parity-scale-codec = { features = ["derive"], version = "1.3" } hex = "0.4.2" secp256k1zkp = { git = "https://github.com/crypto-com/rust-secp256k1-zkp.git", rev = "f8759809f6e3fed793b37166f7cd91c57cdb2eab", features = ["recovery"] } -tendermint = { git = "https://github.com/crypto-com/tendermint-rs.git", default-features = false, rev = "e3c131a35936da7fc1928c3231db70e603f82fd3" } +tendermint = { git = "https://github.com/crypto-com/tendermint-rs.git", default-features = false, rev = "e8d350960726b242fdaa67d293d71ba8cfdb8024" } [dev-dependencies] secp256k1zkp = { git = "https://github.com/crypto-com/rust-secp256k1-zkp.git", rev = "f8759809f6e3fed793b37166f7cd91c57cdb2eab", features = ["serde", "zeroize", "rand", "recovery", "endomorphism"] } diff --git a/integration-tests/multinode/join_test.py b/integration-tests/multinode/join_test.py index 3bb4a6a4a..93a2db67c 100755 --- a/integration-tests/multinode/join_test.py +++ b/integration-tests/multinode/join_test.py @@ -55,6 +55,7 @@ assert len(rpc.chain.validators()['validators']) == 2 addr = rpc.address.list(enckey=enckey, name='target')[0] +rpc.wallet.sync(enckey=enckey, name='target') state = rpc.staking.state(addr) punishment = state['last_slash'] print('punishment', punishment) diff --git a/test-common/Cargo.toml b/test-common/Cargo.toml index 4356f6a70..9c2b850fa 100644 --- a/test-common/Cargo.toml +++ b/test-common/Cargo.toml @@ -22,7 +22,7 @@ parity-scale-codec = { features = ["derive"], version = "1.3" } base64 = "0.11" hex = "0.4" -tendermint = { git = "https://github.com/crypto-com/tendermint-rs.git", default-features = false, rev = "e3c131a35936da7fc1928c3231db70e603f82fd3" } +tendermint = { git = "https://github.com/crypto-com/tendermint-rs.git", default-features = false, rev = "e8d350960726b242fdaa67d293d71ba8cfdb8024" } chain-core = { path = "../chain-core" } chain-abci = { path = "../chain-abci" } chain-storage = { path = "../chain-storage" }