Skip to content

Conversation

@ibankov
Copy link
Contributor

@ibankov ibankov commented Nov 25, 2025

Description:
Simple fees implementation for Smart Contracts Service.

Related issue(s):

Fixes #

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Signed-off-by: ibankov <[email protected]>
# Conflicts:
#	hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/FacilityInitModule.java
#	hedera-node/hedera-app/src/main/java/com/hedera/node/app/workflows/dispatcher/TransactionDispatcher.java
Signed-off-by: ibankov <[email protected]>
@ibankov ibankov added this to the v0.69 milestone Nov 25, 2025
@ibankov ibankov self-assigned this Nov 25, 2025
@lfdt-bot
Copy link

lfdt-bot commented Nov 25, 2025

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

Status Scanner 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
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...t/impl/calculator/ContractUpdateFeeCalculator.java 87.50% 0 Missing and 1 partial ⚠️

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #22319      +/-   ##
============================================
- Coverage     70.99%   70.96%   -0.03%     
- Complexity    24651    24690      +39     
============================================
  Files          2699     2708       +9     
  Lines        105153   105385     +232     
  Branches      11050    11084      +34     
============================================
+ Hits          74655    74789     +134     
- Misses        26474    26560      +86     
- Partials       4024     4036      +12     
Files with missing lines Coverage Δ Complexity Δ
...s/src/main/java/org/hiero/hapi/fees/FeeResult.java 93.10% <100.00%> (+1.43%) 8.00 <1.00> (+1.00)
.../hedera/node/app/workflows/FacilityInitModule.java 30.00% <100.00%> (+0.88%) 10.00 <1.00> (+1.00)
...pp/workflows/dispatcher/TransactionDispatcher.java 59.34% <100.00%> (ø) 43.00 <0.00> (ø)
...app/service/contract/impl/ContractServiceImpl.java 100.00% <100.00%> (ø) 9.00 <1.00> (+1.00)
...act/impl/calculator/ContractCallFeeCalculator.java 100.00% <100.00%> (ø) 3.00 <3.00> (?)
...t/impl/calculator/ContractCreateFeeCalculator.java 100.00% <100.00%> (ø) 4.00 <4.00> (?)
...t/impl/calculator/ContractDeleteFeeCalculator.java 100.00% <100.00%> (ø) 3.00 <3.00> (?)
...ontract/impl/calculator/EthereumFeeCalculator.java 100.00% <100.00%> (ø) 3.00 <3.00> (?)
...t/impl/calculator/ContractUpdateFeeCalculator.java 87.50% <87.50%> (ø) 3.00 <3.00> (?)

... and 24 files 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.

@codacy-production
Copy link

codacy-production bot commented Nov 25, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (9d7df52) 105281 78776 74.82%
Head commit (2d8b7e7) 105288 (+7) 78779 (+3) 74.82% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#22319) 38 38 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Signed-off-by: ibankov <[email protected]>
@ibankov ibankov linked an issue Nov 25, 2025 that may be closed by this pull request
Signed-off-by: ibankov <[email protected]>
@ibankov ibankov marked this pull request as ready for review November 26, 2025 14:48
@ibankov ibankov requested review from a team and tinker-michaelj as code owners November 26, 2025 14:48
"extras": [
{
"name": "KEYS",
"includedCount": 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we also mention the default gas included? from here its 500k

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed with Michael, I left the gas charging as it is and I'm not considering it as an extra.

Copy link
Contributor

Choose a reason for hiding this comment

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

@Neeharika-Sompalli are you satisfied with this answer? If so I'll approve it.

final long keys = adminKey != null ? countKeys(adminKey) : 0;
final ServiceFeeDefinition serviceDef = lookupServiceFee(feeSchedule, HederaFunctionality.CONTRACT_CREATE);
feeResult.addServiceFee(1, serviceDef.baseFee());
addExtraFee(feeResult, serviceDef, KEYS, feeSchedule, keys);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, This fee calculation says we havee included some gas. Should we account for that?

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.

Smart Contracts support

5 participants