Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Private tx enabled flag added into STATUS packet#9999

Merged
5chdn merged 6 commits into
masterfrom
PrivateTXPeers
Jan 4, 2019
Merged

Private tx enabled flag added into STATUS packet#9999
5chdn merged 6 commits into
masterfrom
PrivateTXPeers

Conversation

@grbIzl
Copy link
Copy Markdown
Collaborator

@grbIzl grbIzl commented Nov 30, 2018

This PR is aimed to fix the following situation:

  • Private tx functionality is enabled via launch flag.
  • It's disabled by default
  • In order to process private tx packets node has to be launched with this flag enabled
    As a result, on big (public) networks node might not have peers with private tx enabled among connected peers and private tx functionality doesn't work (because packets are not delivered among nodes).
    The requirement to have nodes in reserved peers doesn't solve the issue, because we randomly select subset of connected peers for packets propagation and packet can be still lost.

In terms of this PR private tx enabled flag added into STATUS packet and node can explicitly select for propagation only nodes with private tx enabled.

@grbIzl grbIzl added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Nov 30, 2018
@5chdn 5chdn added this to the 2.3 milestone Nov 30, 2018
@rphmeier
Copy link
Copy Markdown
Contributor

rphmeier commented Nov 30, 2018

is it compatible with geth nodes who aren't aware of this packet field?

@grbIzl
Copy link
Copy Markdown
Collaborator Author

grbIzl commented Nov 30, 2018

is it compatible with geth nodes who aren't aware of this packet field?

How should it be communicated? There are only basic fields of status packet described in https://github.com/ethereum/wiki/wiki/Ethereum-Wire-Protocol If we add something to the end of the packet (like we did for warp), what is the safe strategy for handling it?

Comment thread ethcore/sync/src/chain/mod.rs Outdated
packet.append(&manifest_hash);
packet.append(&block_number);
}
packet.append(&self.private_tx_handler.is_some());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This should be a warp_protocol extension

@arkpar
Copy link
Copy Markdown
Collaborator

arkpar commented Nov 30, 2018

All custom fields should only be added in the parity protocol.
The protocol version should be bumped if it wasn't bumped already since previous release.
Code should handle backwards compatibility with the previous version of the protocol. I.e. it should only add that field if both nodes use the latest protocol version and expect to read it only from nodes that are supporting the latest version.

@grbIzl grbIzl added A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. A0-pleasereview 🤓 Pull request needs code review. and removed A0-pleasereview 🤓 Pull request needs code review. A4-gotissues 💥 Pull request is reviewed and has significant issues which must be addressed. labels Nov 30, 2018
Copy link
Copy Markdown
Collaborator

@sorpaas sorpaas left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread ethcore/sync/src/api.rs Outdated
Comment thread ethcore/sync/src/chain/handler.rs Outdated
Comment thread ethcore/sync/src/chain/mod.rs Outdated
let protocol = if warp_protocol { warp_protocol_version } else { ETH_PROTOCOL_VERSION_63.0 };
trace!(target: "sync", "Sending status to {}, protocol version {}", peer, protocol);
let mut packet = RlpStream::new_list(if warp_protocol { 7 } else { 5 });
let rlp_len = if warp_protocol {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would be best to just use begin_unbounded_list and get rid of rlp_len

@grbIzl grbIzl added A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. and removed A0-pleasereview 🤓 Pull request needs code review. labels Dec 6, 2018
@grbIzl grbIzl added A0-pleasereview 🤓 Pull request needs code review. and removed A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. labels Dec 6, 2018
@5chdn
Copy link
Copy Markdown
Contributor

5chdn commented Dec 28, 2018

could you look at this again @niklasad1 ?

Comment thread ethcore/sync/src/chain/propagator.rs Outdated
if lucky_peers.is_empty() {
error!(target: "privatetx", "Cannot propagate the packet, no peers with private tx enabled connected");
} else {
trace!(target: "sync", "Sending private transaction packet to {:?}", lucky_peers);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm a little confused on the log target would be nice to be consistent and use privatetx here? Or am I missing something?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, it looks weird indeed, I agree. I'll change it to privatetx for both cases

Copy link
Copy Markdown
Collaborator

@niklasad1 niklasad1 left a comment

Choose a reason for hiding this comment

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

LGTM, but would be good if @arkpar could sign off on this too 👍

@niklasad1 niklasad1 added the A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. label Jan 3, 2019
@grbIzl grbIzl removed the A6-mustntgrumble 💦 Pull request has areas for improvement. The author need not address them before merging. label Jan 4, 2019
@5chdn
Copy link
Copy Markdown
Contributor

5chdn commented Jan 4, 2019

Thanks. Could you resolve the conflicts?

@niklasad1 niklasad1 added A7-looksgoodcantmerge 🙄 Pull request is reviewed well, but cannot be merged due to conflicts. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jan 4, 2019
@5chdn 5chdn merged commit b180be7 into master Jan 4, 2019
@5chdn 5chdn deleted the PrivateTXPeers branch January 4, 2019 18:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

A7-looksgoodcantmerge 🙄 Pull request is reviewed well, but cannot be merged due to conflicts. M4-core ⛓ Core client code / Rust.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants