Skip to content

XDC - Trc21 txPool validation#10783

Open
cicr99 wants to merge 8 commits intofeature/xdc-trc21from
feature/xdc-trc21-txpool-validation
Open

XDC - Trc21 txPool validation#10783
cicr99 wants to merge 8 commits intofeature/xdc-trc21from
feature/xdc-trc21-txpool-validation

Conversation

@cicr99
Copy link
Contributor

@cicr99 cicr99 commented Mar 11, 2026

This PR extends XDC txpool validation beyond sign-tx-only checks, adds TRC21-aware balance/cost handling in shared txpool filters, and introduces focused XDC tests.

1- XDC custom incoming filter
The old XDC filter was effectively a sign-transaction filter. It now contains broader XDC-specific incoming validation, so it was renamed to reflect that role:
SignTransactionFilter -> XdcIncomingTxFilter

Checks now handled there:

  • Special/sign transaction validation (existing behavior)
  • XDC min gas price validation for non-special txs
  • TRC21 transaction validation

2- Changes in txpool filters
Only adding checks in XDC incoming filter is not enough to match TRC21 behavior, because balance checks are enforced in common txpool filters before final acceptance. XdcIncomingTxFilter is added last. So there could be tx which are not accepted before reaching this filter.
BalanceZeroFilter and BalanceTooLowFilter were modified by adding a ITxPoolCostAndFundsProvider that would handle:

  • additional spendable funds (token fee capacity) - GetAdditionalFunds
  • custom cost calculation for TRC21 txs - TryGetTransactionCost

Non-TRC21 transactions fall back to the default cost path.

References on xdc side:

cicr99 added 6 commits March 11, 2026 11:06
# Conflicts:
#	src/Nethermind/Nethermind.Xdc.Test/Helpers/XdcTestBlockchain.cs
#	src/Nethermind/Nethermind.Xdc/InitializeBlockchainXdc.cs
#	src/Nethermind/Nethermind.Xdc/TxPool/SignTransactionFilter.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant