Enable GetNodeData for AuRa chains and bump to v3.3.0-rc.11
This commit is contained in:
parent
ac30783c82
commit
25ce4b2ec8
@ -1,3 +1,8 @@
|
|||||||
|
## OpenEthereum v3.3.0-rc.11
|
||||||
|
|
||||||
|
Bug fixes:
|
||||||
|
* Ignore GetNodeData requests only for non-AuRa chains
|
||||||
|
|
||||||
## OpenEthereum v3.3.0-rc.10
|
## OpenEthereum v3.3.0-rc.10
|
||||||
|
|
||||||
Enhancements:
|
Enhancements:
|
||||||
|
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -2932,7 +2932,7 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "openethereum"
|
name = "openethereum"
|
||||||
version = "3.3.0-rc.10"
|
version = "3.3.0-rc.11"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"ansi_term 0.10.2",
|
"ansi_term 0.10.2",
|
||||||
"atty",
|
"atty",
|
||||||
@ -3282,7 +3282,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "parity-version"
|
name = "parity-version"
|
||||||
version = "3.3.0-rc.10"
|
version = "3.3.0-rc.11"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"parity-bytes",
|
"parity-bytes",
|
||||||
"rlp",
|
"rlp",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
description = "OpenEthereum"
|
description = "OpenEthereum"
|
||||||
name = "openethereum"
|
name = "openethereum"
|
||||||
# NOTE Make sure to update util/version/Cargo.toml as well
|
# NOTE Make sure to update util/version/Cargo.toml as well
|
||||||
version = "3.3.0-rc.10"
|
version = "3.3.0-rc.11"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
authors = [
|
authors = [
|
||||||
"OpenEthereum developers",
|
"OpenEthereum developers",
|
||||||
|
@ -2234,6 +2234,11 @@ impl BlockChainClient for Client {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn is_aura(&self) -> bool {
|
||||||
|
let engine = self.engine.clone();
|
||||||
|
engine.name() == "AuthorityRound"
|
||||||
|
}
|
||||||
|
|
||||||
fn is_processing_fork(&self) -> bool {
|
fn is_processing_fork(&self) -> bool {
|
||||||
let chain = self.chain.read();
|
let chain = self.chain.read();
|
||||||
self.importer
|
self.importer
|
||||||
|
@ -258,6 +258,9 @@ pub trait BlockChainClient:
|
|||||||
/// Get block total difficulty.
|
/// Get block total difficulty.
|
||||||
fn block_total_difficulty(&self, id: BlockId) -> Option<U256>;
|
fn block_total_difficulty(&self, id: BlockId) -> Option<U256>;
|
||||||
|
|
||||||
|
/// Is it AuRa engine?
|
||||||
|
fn is_aura(&self) -> bool;
|
||||||
|
|
||||||
/// Attempt to get address storage root at given block.
|
/// Attempt to get address storage root at given block.
|
||||||
/// May not fail on BlockId::Latest.
|
/// May not fail on BlockId::Latest.
|
||||||
fn storage_root(&self, address: &Address, id: BlockId) -> Option<H256>;
|
fn storage_root(&self, address: &Address, id: BlockId) -> Option<H256>;
|
||||||
|
@ -351,10 +351,36 @@ impl SyncSupplier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn return_node_data(io: &dyn SyncIo, rlp: &Rlp, peer_id: PeerId) -> RlpResponseResult {
|
fn return_node_data(io: &dyn SyncIo, rlp: &Rlp, peer_id: PeerId) -> RlpResponseResult {
|
||||||
// GetNodeData requests are ignored since we don't have a correct
|
if io.chain().is_aura() {
|
||||||
// implementation of the NodeData response, see issue #508
|
let count = cmp::min(rlp.item_count().unwrap_or(0), MAX_NODE_DATA_TO_SEND);
|
||||||
debug!("Ignoring GetNodeData request");
|
if count == 0 {
|
||||||
Ok(None)
|
debug!(target: "sync", "Empty GetNodeData request, ignoring.");
|
||||||
|
return Ok(None);
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut data = Bytes::new();
|
||||||
|
|
||||||
|
let mut added = 0usize;
|
||||||
|
for i in 0..count {
|
||||||
|
if let Some(ref mut node_data) = io.chain().state_data(&rlp.val_at::<H256>(i)?) {
|
||||||
|
data.append(node_data);
|
||||||
|
added += 1;
|
||||||
|
if data.len() > PAYLOAD_SOFT_LIMIT {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut rlp = RlpStream::new_list(added);
|
||||||
|
rlp.append_raw(&data, added);
|
||||||
|
trace!(target: "sync", "{} -> GetNodeData: returned {} entries", peer_id, added);
|
||||||
|
Ok(Some((NodeDataPacket, rlp)))
|
||||||
|
} else {
|
||||||
|
// GetNodeData requests are ignored since we don't have a correct
|
||||||
|
// implementation of the NodeData response, see issue #508
|
||||||
|
debug!("Ignoring GetNodeData request");
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn return_receipts(io: &dyn SyncIo, rlp: &Rlp, peer_id: PeerId) -> RlpResponseResult {
|
fn return_receipts(io: &dyn SyncIo, rlp: &Rlp, peer_id: PeerId) -> RlpResponseResult {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "parity-version"
|
name = "parity-version"
|
||||||
# NOTE: this value is used for OpenEthereum version string (via env CARGO_PKG_VERSION)
|
# NOTE: this value is used for OpenEthereum version string (via env CARGO_PKG_VERSION)
|
||||||
version = "3.3.0-rc.10"
|
version = "3.3.0-rc.11"
|
||||||
authors = ["Parity Technologies <admin@parity.io>"]
|
authors = ["Parity Technologies <admin@parity.io>"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user