Skip to content
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

Add preconfirmation gossip messages #2726

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

MitchTurner
Copy link
Member

@MitchTurner MitchTurner commented Feb 18, 2025

Linked Issues/PRs

Closes #2738

Description

This is part of the greater tx confirmation work. This will enable the block producer to gossip a batch of signed transactions around the network for the senders of those transactions to receive.

In an attempt to cleanup the P2P code, some of the tests were moved to their own files (this makes reviewing slightly more difficult, so I've marked the new tests with comments in those refactored test suites).

TODO:

Checklist

  • Breaking changes are clearly marked as such in the PR description and changelog
  • New behavior is reflected in tests
  • The specification matches the implemented behavior (link update PR if changes are needed)

Before requesting review

  • I have reviewed the code myself
  • I have created follow-up issues caused by this PR and linked them here

After merging, notify other teams

[Add or remove entries as needed]

@MitchTurner MitchTurner self-assigned this Feb 19, 2025
}

#[tokio::test]
async fn run__gossip_message_from_p2p_service_is_broadcasted__tx_confirmations() {
Copy link
Member Author

@MitchTurner MitchTurner Feb 19, 2025

Choose a reason for hiding this comment

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

This is the only new test in this file. The rest were just copied over during the refactor.


#[tokio::test]
#[instrument]
async fn gossipsub_broadcast_tx_with_reject__tx_confirmations() {
Copy link
Member Author

Choose a reason for hiding this comment

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

New test.


#[tokio::test]
#[instrument]
async fn gossipsub_broadcast_tx_with_accept__tx_confirmations() {
Copy link
Member Author

Choose a reason for hiding this comment

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

New test.


// TODO: Move me before tests that use this function
/// Reusable helper function for Broadcasting Gossipsub requests
async fn gossipsub_broadcast(
Copy link
Member Author

Choose a reason for hiding this comment

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

This method was updated to accept the new GossipsubBroadcastRequest::Confirmations variant.

Introduced check_message_matches_request as part of that (before it was hardcoded to look for a specific value).

@MitchTurner MitchTurner marked this pull request as ready for review February 20, 2025 22:07
@MitchTurner MitchTurner changed the title Add TxConfirmation gossip messages Add preconfirmation gossip messages Feb 20, 2025
@MitchTurner MitchTurner requested a review from netrome as a code owner February 21, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transaction Preconfirmation Gossip Message
1 participant