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

fix(l1): fix the transactions spammer count diff with our node #1650

Merged
merged 23 commits into from
Jan 8, 2025

Conversation

rodrigo-o
Copy link
Collaborator

@rodrigo-o rodrigo-o commented Jan 6, 2025

Motivation

As explained in this comment the spammer has a 2-phase execution, where txcount * accounts define the number of transactions added in the second phase of each round. We were recieving significant less transactions in the secod phase, near accounts in number

Description

This PR solves the issue adding a implementation of eth_maxPriorityFeePerGas, which after debuging proved to be the cause of the diminished number of transactions reaching our node. After an initial implementation we can see the node working as expected, here is a comparision:

Before eth_maxPriorityFeePerGas After eth_maxPriorityFeePerGas
image image

For the current implementation we extracted the common logic betweeneth_GasPrice and eth_maxPriorityFeePerGas. This was inspired in how geth managed both. I moved the logic from gas_price to a common module (fee_calculator) that calculates the gas tip; previously we were estimating the gas price, now the tip, this was the only change to the logic. Now both RPC calls depend on this logic, the difference being gas_price adding the base_fee while max_priority_fee doesn't. I tried to avoid as much changes as possible to the previous implementation of gas_price, this is something that we might want to look further in the future.

Resolves #1449

Copy link

github-actions bot commented Jan 7, 2025

+-------------------------------------------------------------------------------+-------+------+
| File                                                                          | Lines | Diff |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/eth/fee_calculator.rs   | 79    | +79  |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/eth/gas_price.rs        | 124   | -222 |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/eth/max_priority_fee.rs | 109   | +109 |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/eth/mod.rs              | 162   | +154 |
+-------------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/rpc.rs                  | 434   | +1   |
+-------------------------------------------------------------------------------+-------+------+

Total lines changed: +565

@rodrigo-o rodrigo-o marked this pull request as ready for review January 8, 2025 00:13
@rodrigo-o rodrigo-o requested a review from a team as a code owner January 8, 2025 00:13
Copy link
Collaborator

@mpaulucci mpaulucci left a comment

Choose a reason for hiding this comment

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

🚀

@rodrigo-o rodrigo-o enabled auto-merge January 8, 2025 20:00
@rodrigo-o rodrigo-o added this pull request to the merge queue Jan 8, 2025
Merged via the queue into main with commit 3a528eb Jan 8, 2025
20 checks passed
@rodrigo-o rodrigo-o deleted the check-transaction-spammer-count-diff branch January 8, 2025 21:24
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.

L1: TX Spammer gets more transactions included when it hits another node's RPC
2 participants