Skip to content

fix: validate all entity IDs in max_custom_fees - #26840

Open
aderevets wants to merge 1 commit into
mainfrom
26528-validate-max-custom-fee-entity-ids
Open

fix: validate all entity IDs in max_custom_fees#26840
aderevets wants to merge 1 commit into
mainfrom
26528-validate-max-custom-fee-entity-ids

Conversation

@aderevets

Copy link
Copy Markdown
Contributor

Validates every entity ID in max_custom_fees at precheck, not just the entry matching the payer. Applies even when the topic has no custom fees or the payer is fee exempt. Invalid IDs return INVALID_MAX_CUSTOM_FEES.

  • CustomFeeLimit.account_id goes through the existing Validations.validateAccountID, plus a shard/realm check. Alias-form IDs stay valid.
  • FixedFee.denominating_token_id, when populated, must be positive and in this network's shard/realm.

Placed in PreCheckValidator.checkMaxCustomFees so it covers both callers: TransactionChecker (top-level and inner-batch txns) and ScheduleCreateHandler (scheduled bodies). Takes shard/realm as longs rather than HederaConfig because hedera-app-spi requires com.hedera.node.config non-transitively.

TOPIC_FEE_190 previously registered token 0.0.0 and asserted success, so it now asserts the rejection. TOPIC_FEE_199 is about a collector not being charged, so its incidental invalid token was swapped for a valid one to keep the test on its own subject.

Closes #26528

Signed-off-by: aderevets <artem.derevets@limechain.tech>
@aderevets
aderevets requested review from a team as code owners August 13, 2026 15:44
@lfdt-bot

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Impacted file tree graph

@@            Coverage Diff            @@
##               main   #26840   +/-   ##
=========================================
  Coverage     70.44%   70.44%           
  Complexity    11667    11667           
=========================================
  Files          2583     2583           
  Lines        108282   108290    +8     
  Branches      12109    12111    +2     
=========================================
+ Hits          76280    76286    +6     
- Misses        28020    28022    +2     
  Partials       3982     3982           
Files with missing lines Coverage Δ Complexity Δ
...era/node/app/spi/validation/PreCheckValidator.java 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
.../hedera/node/app/workflows/TransactionChecker.java 91.34% <100.00%> (+0.04%) 0.00 <0.00> (ø)
.../schedule/impl/handlers/ScheduleCreateHandler.java 92.81% <100.00%> (+0.04%) 28.00 <0.00> (ø)

... and 1 file with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@testlens-app

testlens-app Bot commented Aug 13, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 24f68ef
▶️ Tests: 22040 executed
⚪️ Checks: 54/54 completed


Learn more about TestLens at testlens.app.

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.

Validate all entity IDs in max_custom_fees

2 participants