-
Notifications
You must be signed in to change notification settings - Fork 130
Ibft transmitted packets are logged by gossiper #652
Conversation
.../ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/network/IbftMessageTransmitter.java
Outdated
Show resolved
Hide resolved
consensus/ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/IbftGossip.java
Outdated
Show resolved
Hide resolved
Messages which originate with the current node are logged in the gossiper such that if a remote peer sends a packet which originated from the local back to the local node, it should not go back out again.
} | ||
|
||
@Override | ||
public boolean send(final MessageData messageData, final List<Address> excludeAddressesList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this method should have gossip in the name as it is doing gossiping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would rather not have the word gossip littered through the code... or else you end up with:
gossiper.gossip(msg) ...
@@ -36,12 +39,11 @@ | |||
public class IbftMessageTransmitter { | |||
|
|||
private final MessageFactory messageFactory; | |||
private final ValidatorMulticaster multicaster; | |||
private final Gossiper network; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps gossiper? It's not really the network
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
.../ibft/src/main/java/tech/pegasys/pantheon/consensus/ibft/network/IbftMessageTransmitter.java
Outdated
Show resolved
Hide resolved
|
||
boolean gossipMessage(Message message); | ||
|
||
boolean send(MessageData messageData, List<Address> excludeAddressesList); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This form of gossip where we haven't got the original message is never going to have excluded addresses so perhaps just remove that argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
@Override | ||
public boolean send(final MessageData messageData, final List<Address> excludeAddressesList) { | ||
Hash uniqueID = Hash.hash(messageData.getData()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we just use the hashCode from the messageData instead to uniquely identify the message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
* Refactoring for more readable IBFT IT * Renaming Roles to peers * Moving the assert behaviour into the RoundChangePeers * Renmaing prefix of assert to verify, grammar * Reducing usage of getAllPeers() * Dropping the getter for the peer list * Dropping peer from method names, as it's now in the class name * Spotless
fixes NC-2026 adds a `--network` option instead of separated options Networks are now defined using a `--network` option that takes the case insensitive name of an enum values as input : MAINNET, RINKEBY, ROPSTEN, GOERLI, DEV These presets are a set of network-id, genesis file and boonodes list. If the `--genesis-file` is provided with a valid JSON genesis file, Pantheon uses it instead of the default network. An empty bootnodes list is then the default value and network id is the chain id found in the genesis file. `--network-id` and `--bootnodes` options can override these defaults. You can of course also override the `--network-id` and `--bootnodes` for a predefined known network (using `--network`). User have no reason to set `--network` and `--genesis-file` options at the same time that would lead to misunderstandings so we raise an error to prevent both options to be defined at the same time on the command line. Also fixes NC-2189 renaming --private-genesis-file to --genesis-file Updates a lot of doc according to the options changes
fixes NC-2120 --discovery-enabled option refactoring now able to have --discovery-enabled option with true as default and --discovery-enabled=true or --discovery-enabled=false on CLI and discovery-enabled=true or discovery-enabled=false in YAML config file. updates doc
Separate the management of sync target and actual import from the rest of the Downloader logic in preparation for introducing a fast sync chain downloader.
|
||
@Override | ||
public void send(final MessageData message, final Collection<Address> blackList) { | ||
final Object uniqueID = message.hashCode(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be nicer to use Integer instead of Object here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the separation of the multicaster into single responsibility objects 👍
|
||
public interface Gossiper { | ||
|
||
void gossipMessage(Message message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit; gossipMessage
-> send()
.
From the context (an interface called gossiper), a reader can infer that all the behaviour will be gossiping related. As the method input parameter is a Message
does additional value really come from repeating those same details in the method name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Messages which originate with the current node are logged in the gossiper such that if a remote peer sends a packet which originated from the local back to the local node, it should not go back out again.
Messages which originate with the current node are logged in the
gossiper such that if a remote peer sends a packet which originated
from the local back to the local node, it should not go back out
again.