Skip to content

Conversation

cdiielsi
Copy link
Contributor

@cdiielsi cdiielsi commented Oct 2, 2025

Motivation

We've detected that the Request Blob Pooled Transactions Multiple hive test is failing with:

FAIL: Error executing step 4: expected 1 hashes, got 5

and that's because there's a 1 second interval between broadcasting transactions that batch several (in this case 5) transactions before sending them, instead of broadcasting a transaction as soon as it arrives. To pass the test but still be able to batch transactions (since it translates in a significative improvement in performance) I'm introducing a new flag in the cli to set the interval as needed.

Description

This pr introduces a new flag in the cli to control the size of the broadcasting time interval for broadcasting transactions.

This pr depends on this other pr to be merged in lambda/hive to pass the ci.

Closes #3914

@github-actions github-actions bot added the L1 Ethereum client label Oct 2, 2025
Copy link

github-actions bot commented Oct 2, 2025

Lines of code report

Total lines added: 15
Total lines removed: 0
Total lines changed: 15

Detailed view
+------------------------------------------------+-------+------+
| File                                           | Lines | Diff |
+------------------------------------------------+-------+------+
| ethrex/cmd/ethrex/cli.rs                       | 524   | +8   |
+------------------------------------------------+-------+------+
| ethrex/cmd/ethrex/initializers.rs              | 404   | +1   |
+------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/network.rs        | 362   | +5   |
+------------------------------------------------+-------+------+
| ethrex/crates/networking/p2p/tx_broadcaster.rs | 310   | +1   |
+------------------------------------------------+-------+------+

@cdiielsi cdiielsi marked this pull request as ready for review October 3, 2025 18:03
@cdiielsi cdiielsi requested a review from a team as a code owner October 3, 2025 18:03
@ethrex-project-sync ethrex-project-sync bot moved this to In Review in ethrex_l1 Oct 3, 2025
dev: Default::default(),
force: false,
mempool_max_size: Default::default(),
tx_broadcasting_time_interval: Default::default(),
Copy link
Collaborator

@mpaulucci mpaulucci Oct 6, 2025

Choose a reason for hiding this comment

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

isnt this 0? Do we actually want the default?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I set the default value with the one that was used previously here and then with this pr when hive launches ethrex I set the interval value to what I tested works.

pub discovery_port: String,
#[arg(
long = "p2p.tx-broadcasting-interval",
default_value = "1000",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you put this as a constant instead of hardcoding it here?

use ethrex_config::networks::Network;

// Amount of seconds between each broadcast
const BROADCAST_INTERVAL_MS: u64 = 1000; // 1 second
Copy link
Collaborator

Choose a reason for hiding this comment

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

why did you move it here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I must have misunderstood, I thought this was what you ment here. How should I put this as a constant then?

Copy link
Collaborator

Choose a reason for hiding this comment

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

can't you import the constant from the place it was originally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh! Yes! Done here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L1 Ethereum client

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

L1: Fix Request Blob Pooled Transactions Multiple hive test

3 participants