Skip to content

handle huge tx#664

Open
fatcat22 wants to merge 27 commits intodevfrom
yz/fat_tx
Open

handle huge tx#664
fatcat22 wants to merge 27 commits intodevfrom
yz/fat_tx

Conversation

@fatcat22
Copy link
Copy Markdown
Collaborator

@fatcat22 fatcat22 commented Aug 19, 2025

This PR introduces a Huge Transaction Management System for X Layer Erigon to handle large gas-consuming transactions with configurable quotas.

  1. Huge Transaction Detection - Configurable threshold to identify "huge" transactions based on gas consumption relative to block gas limit.
  2. Quota Management System - Implements gas quotas to prevent huge transactions from consuming entire block capacity.
  3. Dynamic Configuration - New LI flags: --txpool.huge-tx-threshold-ratio, --txpool.huge-tx-quota-ratio, --txpool.ignore-huge-tx-quota-interval

E2E Test Scenarios

Test Scenario Threshold Quota Ignore Interval Description Expected Behavior
S1 - NoHuge_AllOrderByPrice 5% 10% 5 blocks All transactions below huge threshold Normal transaction ordering by gas price
S2 - HugeUnderQuota_OrderByPrice 5% 50% 50000 blocks Mix of huge and normal txs, quota not exceeded Transactions ordered by gas price within quota
S3 - HugeOverQuota_LimitHugeCount 5% 50% 50000 blocks Huge transactions exceed quota limit Quota enforcement limits huge tx inclusion
S4 - AllHuge_ExceedQuota_OrderByPrice 5% 50% 50000 blocks All transactions are huge, exceed quota Only quota-allowed huge txs included
S5 - AllHuge_Quota100_OrderByPrice 5% 100% 50000 blocks All huge transactions, full quota All huge txs included, ordered by price
S6 - Quota0_NormalFirst_ThenHuge 5% 0% 50000 blocks Zero quota for huge transactions Normal txs processed first, huge txs blocked
S7 - IgnoreInterval0_Mix_HugeOverQuotaAllowed 5% 50% 0 blocks Quota ignored (interval=0) All transactions processed regardless of quota
S8 - HugeOverQuota_NormalPartialFill 5% 25% 50000 blocks Normal txs partially fill block Remaining space filled with huge txs within quota
S9 - Quota100_AllNormal_OrderByPrice 5% 100% 50000 blocks All normal transactions, full quota Standard transaction ordering by gas price
S10 - Quota100_Mix_NormalAndHuge 5% 100% 50000 blocks Mixed transactions, full quota Optimal mixing of normal and huge transactions
S11 - Quota0_IgnoreInterval0_Mix 5% 0% 0 blocks Zero quota but ignore interval=0 All transactions processed (quota bypassed)
S12 - Quota0_IgnoreInterval0_AllHuge 5% 0% 0 blocks All huge txs, zero quota, ignore quota All huge transactions included
S13 - Quota0_NoGasLeft_ForHuge 5% 0% 50000 blocks No gas remaining for huge txs Huge transactions rejected due to insufficient gas
S14 - SequentialHugeTxs_SameAddress_NaturalTxpoolBehavior 5% 50% 50000 blocks Sequential huge transactions from same address Multi-block distribution with efficient packing and natural txpool behavior observation
S15 - VeryHugeTx_With99Transfers_TransfersFirst 5% 50% 50000 blocks 99 normal transfers (10 Gwei) + 1 very huge tx (2.65M gas, 50 Gwei) Transfers fill first block completely, very huge tx rejected due to exceeding block gas limit
S16 - Mix_50Transfers_10HighGas_SamePrice 5% 50% 50000 blocks 50 transfers + 10 high gas txs (same 15 Gwei) + 1 very huge tx (2.65M gas, 50 Gwei) All transfers included, high gas txs limited by quota, efficient block filling

@googgoog googgoog marked this pull request as ready for review September 1, 2025 07:41
@zjg555543
Copy link
Copy Markdown

Better to use Adventure with 2w accounts 12 hours

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.

3 participants