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

feat: Add fee for topic with custom fee creation #17407

Open
wants to merge 8 commits into
base: hip-991-topic-fees
Choose a base branch
from

Conversation

ibankov
Copy link
Contributor

@ibankov ibankov commented Jan 16, 2025

Description:
Adding fee for creating topic with custom fees. The fee should be 2$.

Related issue(s):
#17393
Fixes #
#17393
Notes for reviewer:

Checklist

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

@ibankov ibankov added the Topic Fees HIP-991 implementation label Jan 16, 2025
@ibankov ibankov added this to the v0.59 milestone Jan 16, 2025
@ibankov ibankov self-assigned this Jan 16, 2025
@ibankov ibankov requested a review from hendrikebbers January 16, 2025 09:02
Signed-off-by: ibankov <[email protected]>
@ibankov ibankov linked an issue Jan 16, 2025 that may be closed by this pull request
Signed-off-by: ibankov <[email protected]>
Copy link

codacy-production bot commented Jan 16, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 77.27%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (88ec619) 96540 68989 71.46%
Head commit (f62c3b0) 96557 (+17) 69002 (+13) 71.46% (+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 (#17407) 22 17 77.27%

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

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link

codecov bot commented Jan 16, 2025

Codecov Report

Attention: Patch coverage is 63.63636% with 8 lines in your changes missing coverage. Please review.

Project coverage is 67.57%. Comparing base (88ec619) to head (f62c3b0).
Report is 1 commits behind head on hip-991-topic-fees.

Files with missing lines Patch % Lines
...app/hapi/utils/fee/ConsensusServiceFeeBuilder.java 60.00% 5 Missing and 1 partial ⚠️
...sus/impl/handlers/ConsensusCreateTopicHandler.java 66.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@                   Coverage Diff                    @@
##             hip-991-topic-fees   #17407      +/-   ##
========================================================
- Coverage                 67.57%   67.57%   -0.01%     
- Complexity                22159    22168       +9     
========================================================
  Files                      2589     2589              
  Lines                     96757    96774      +17     
  Branches                  10126    10131       +5     
========================================================
+ Hits                      65385    65396      +11     
- Misses                    27616    27620       +4     
- Partials                   3756     3758       +2     
Files with missing lines Coverage Δ
...edera/node/app/hapi/utils/CommonPbjConverters.java 68.59% <100.00%> (+0.15%) ⬆️
...sus/impl/handlers/ConsensusCreateTopicHandler.java 88.04% <66.66%> (-1.85%) ⬇️
...app/hapi/utils/fee/ConsensusServiceFeeBuilder.java 89.47% <60.00%> (-5.65%) ⬇️

... and 15 files with indirect coverage changes

Impacted file tree graph

Signed-off-by: ibankov <[email protected]>
* createTopicTxBody.getAutoRenewPeriod().getSeconds();
// Scale the rbs based on topic size and custom fees
extraRbsServices =
(getTopicRamBytes(variableSize) + bytesNeededToRepr(createTopicTxBody.getCustomFeesList()))
Copy link
Member

Choose a reason for hiding this comment

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

nit : bytesNeededToRepr(createTopicTxBody.getCustomFeesList())) can be added inside getTopicRamBytes

Copy link
Member

@Neeharika-Sompalli Neeharika-Sompalli left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks @ibankov
We need to also ask @netopyr and update fee-calculator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Topic Fees HIP-991 implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom fee for creating a topic
2 participants