diff --git a/Cargo.lock b/Cargo.lock index f3c8d48aa..e2892f297 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -400,7 +400,7 @@ dependencies = [ [[package]] name = "bft-rs" version = "0.2.0-alpha" -source = "git+https://github.com/cryptape/bft-rs.git?rev=861aa4f#861aa4f8d5ad95ff9aaf225ae1e804958dd2702a" +source = "git+https://github.com/cryptape/bft-rs.git?branch=bft_for_muta#fd57ec35ad8a405dbed96dcdeb76ff4ae8a7fab2" dependencies = [ "crossbeam 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -855,7 +855,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "core-consensus" version = "0.1.0" dependencies = [ - "bft-rs 0.2.0-alpha (git+https://github.com/cryptape/bft-rs.git?rev=861aa4f)", + "bft-rs 0.2.0-alpha (git+https://github.com/cryptape/bft-rs.git?branch=bft_for_muta)", "common-cita 0.1.0", "components-database 0.1.0", "components-executor 0.1.0", @@ -961,7 +961,7 @@ dependencies = [ name = "core-runtime" version = "0.1.0" dependencies = [ - "bft-rs 0.2.0-alpha (git+https://github.com/cryptape/bft-rs.git?rev=861aa4f)", + "bft-rs 0.2.0-alpha (git+https://github.com/cryptape/bft-rs.git?branch=bft_for_muta)", "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "cita-vm 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "core-context 0.1.0", @@ -3954,7 +3954,7 @@ dependencies = [ "checksum backtrace 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)" = "45934a579eff9fd0ff637ac376a4bd134f47f8fc603f0b211d696b54d61e35f1" "checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6" "checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e" -"checksum bft-rs 0.2.0-alpha (git+https://github.com/cryptape/bft-rs.git?rev=861aa4f)" = "" +"checksum bft-rs 0.2.0-alpha (git+https://github.com/cryptape/bft-rs.git?branch=bft_for_muta)" = "" "checksum bindgen 0.47.3 (registry+https://github.com/rust-lang/crates.io-index)" = "df683a55b54b41d5ea8ebfaebb5aa7e6b84e3f3006a78f010dadc9ca88469260" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum blake2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "91721a6330935673395a0607df4d49a9cb90ae12d259f1b3e0a3f6e1d486872e" diff --git a/components/transaction-pool/src/lib.rs b/components/transaction-pool/src/lib.rs index f033eb3bc..1e0ec755e 100644 --- a/components/transaction-pool/src/lib.rs +++ b/components/transaction-pool/src/lib.rs @@ -222,8 +222,6 @@ where sig_txs.push(tx); } else if let Some(tx) = callback_cache.get(hash) { sig_txs.push(tx); - } else { - return Err(TransactionPoolError::NotExpected); } } diff --git a/core/consensus/Cargo.toml b/core/consensus/Cargo.toml index 560ed0790..5415336d6 100644 --- a/core/consensus/Cargo.toml +++ b/core/consensus/Cargo.toml @@ -21,8 +21,7 @@ tokio = "0.1" futures-timer = "0.1" # compat is required for tokio timer futures-preview = { version = "0.3.0-alpha.16", features = [ "compat" ] } -# TODO: upgrade bft-rs -bft-rs = { git = "https://github.com/cryptape/bft-rs.git", features = [ "verify_req" ], rev = "861aa4f" } +bft-rs = { git = "https://github.com/cryptape/bft-rs.git", features = [ "verify_req" ], branch = "bft_for_muta" } rayon = "1.0" [dev-dependencies] diff --git a/core/consensus/src/bft/support.rs b/core/consensus/src/bft/support.rs index fc846f60e..b9d03e9d8 100644 --- a/core/consensus/src/bft/support.rs +++ b/core/consensus/src/bft/support.rs @@ -95,12 +95,6 @@ where .await? .try_into()?; - // Ignore the self proposal - let status = self.engine.get_status(); - if proposal.proposer == status.node_address { - return Ok(()); - } - let ctx = Context::new(); self.engine.verify_proposal(ctx.clone(), &proposal)?; Ok(()) @@ -121,6 +115,7 @@ where signed_proposal_hash: &[u8], _height: u64, _round: u64, + proposer: &[u8], ) -> Result<(), Self::Error> { let fut = async move { let proposal: Proposal = AsyncCodec::decode::(proposal.to_vec()) @@ -132,8 +127,9 @@ where } // Ignore the self proposal + let proposer = Address::from_bytes(proposer)?; let status = self.engine.get_status(); - if proposal.proposer == status.node_address { + if proposer == status.node_address { return Ok(()); } diff --git a/core/runtime/Cargo.toml b/core/runtime/Cargo.toml index 7782b6484..2b2f06429 100644 --- a/core/runtime/Cargo.toml +++ b/core/runtime/Cargo.toml @@ -13,5 +13,4 @@ core-serialization = { path = "../serialization" } bytes = "0.4" cita-vm = "0.1" -# TODO: upgrade bft-rs -bft-rs = { git = "https://github.com/cryptape/bft-rs.git", features = [ "verify_req" ], rev = "861aa4f" } +bft-rs = { git = "https://github.com/cryptape/bft-rs.git", features = [ "verify_req" ], branch = "bft_for_muta" }