-
Notifications
You must be signed in to change notification settings - Fork 302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose gossip future #8735
Expose gossip future #8735
Conversation
...ing/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/forks/GossipForkManager.java
Show resolved
Hide resolved
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.
Great improvement!
Just few nits
...ing/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/forks/GossipForkManager.java
Show resolved
Hide resolved
networking/p2p/src/main/java/tech/pegasys/teku/networking/p2p/libp2p/gossip/GossipHandler.java
Outdated
Show resolved
Hide resolved
...tor/src/main/java/tech/pegasys/teku/validator/coordinator/publisher/BlockPublisherDeneb.java
Show resolved
Hide resolved
e166cc3
to
fb0f4a4
Compare
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/GossipFailureLogger.java
Dismissed
Show dismissed
Hide dismissed
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/GossipFailureLogger.java
Dismissed
Show dismissed
Hide dismissed
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/GossipFailureLogger.java
Dismissed
Show dismissed
Hide dismissed
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.
LGTM
...king/p2p/src/test/java/tech/pegasys/teku/networking/p2p/libp2p/gossip/GossipHandlerTest.java
Outdated
Show resolved
Hide resolved
...ing/p2p/src/main/java/tech/pegasys/teku/networking/p2p/libp2p/gossip/LibP2PTopicChannel.java
Show resolved
Hide resolved
...ing/eth2/src/test/java/tech/pegasys/teku/networking/eth2/gossip/GossipFailureLoggerTest.java
Show resolved
Hide resolved
@@ -163,12 +165,13 @@ public synchronized void publishAttestation(final ValidatableAttestation attesta | |||
GossipForkSubscriptions::publishAttestation); | |||
} | |||
|
|||
public synchronized void publishBlock(final SignedBeaconBlock block) { | |||
publishMessage(block.getSlot(), block, "block", GossipForkSubscriptions::publishBlock); | |||
public synchronized SafeFuture<Void> publishBlock(final SignedBeaconBlock block) { |
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.
Something is synchronized here, something not (publishSyncCommitteeContribution
). Maybe move all synchronizations to publishMessage
and publishMessageWithFeedback
? Or I missed something and features like publishSyncCommitteeContribution
shouldn't be synchronized?
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.
oh.. I haven't noticed the difference. good catch. I actually don't know, seems to me like the synchronized
has been forgotten.
It happened here: https://github.com/Consensys/teku/pull/4888/files#diff-8b65d2863b6d9404c913fa07957bc9f5e638ccb31cda39bfd22df59594208fa7
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 cleaned up the synchronizations
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/GossipFailureLogger.java
Outdated
Show resolved
Hide resolved
networking/eth2/src/main/java/tech/pegasys/teku/networking/eth2/gossip/GossipFailureLogger.java
Outdated
Show resolved
Hide resolved
add static creators
b23aa54
to
9b37f3e
Compare
Allow block and blobs gossip publishing to forward the libp2p Future signaling when the first message (block or blob) has been successfully published over the wire (or error).
The exposed
SafeFuture<Void>
is designed to never fail. If the underlining gossip fails, it in any case completes successfully.I also refactored gossip error handling to have a common logic used everywhere. So now we will have:
related to an improvement over #8682
Documentation
doc-change-required
label to this PR if updates are required.Changelog