hashgraph / hedera-services

Crypto, token, consensus, file, and smart contract services for the Hedera public ledger
Apache License 2.0
295 stars 127 forks source link

feat: HIP-904 Add crypto transfer fee calculations - FeeCalculator refactored version #13942

Closed bilyana-gospodinova closed 3 months ago

bilyana-gospodinova commented 3 months ago

Description: This pr is a clone of https://github.com/hashgraph/hedera-services/pull/13853. This pr aims to be opened against develop without needing all the logic from https://github.com/hashgraph/hedera-services/pull/13687 only needing the feature flag.

As we only want this pr to contain the crypto transfer fee calculations and be independent from the other changes in https://github.com/hashgraph/hedera-services/pull/13687. This makes it easier for review. This pr will have duplicated logic from 13687 only the logic that adds the maxAutoAssocation feature flag.

This PR adds the needed changes in the calculations needed for HIP-904. Now the sender of a crypto transfer is charged for the auto association slots if the unlimitedAutoAssociations flag is enabled.

Fixes https://github.com/hashgraph/hedera-services/issues/13375

github-actions[bot] commented 3 months ago

Node: HAPI Test (Token) Results

 20 files   20 suites   5m 46s :stopwatch: 265 tests 265 :white_check_mark: 0 :zzz: 0 :x: 340 runs  340 :white_check_mark: 0 :zzz: 0 :x:

Results for commit fb5da63c.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 3 months ago

Node: HAPI Test (Node Death Reconnect) Results

3 tests   3 :white_check_mark:  6m 48s :stopwatch: 3 suites  0 :zzz: 3 files    0 :x:

Results for commit fb5da63c.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 3 months ago

Node: HAPI Test (Restart) Results

3 tests   3 :white_check_mark:  5m 57s :stopwatch: 3 suites  0 :zzz: 3 files    0 :x:

Results for commit fb5da63c.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 3 months ago

Node: Unit Test Results

  1 552 files    1 552 suites   2h 57m 40s :stopwatch: 108 600 tests 108 541 :white_check_mark: 59 :zzz: 0 :x: 116 894 runs  116 835 :white_check_mark: 59 :zzz: 0 :x:

Results for commit fb5da63c.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 3 months ago

Node: HAPI Test (Crypto) Results

 24 files   24 suites   13m 11s :stopwatch: 365 tests 365 :white_check_mark: 0 :zzz: 0 :x: 372 runs  372 :white_check_mark: 0 :zzz: 0 :x:

Results for commit fb5da63c.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 3 months ago

Node: HAPI Test (Misc) Results

 51 files   51 suites   21m 22s :stopwatch: 357 tests 357 :white_check_mark: 0 :zzz: 0 :x: 375 runs  375 :white_check_mark: 0 :zzz: 0 :x:

Results for commit fb5da63c.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 3 months ago

Node: HAPI Test (Time Consuming) Results

19 tests   19 :white_check_mark:  22m 45s :stopwatch:  4 suites   0 :zzz:  4 files     0 :x:

Results for commit fb5da63c.

:recycle: This comment has been updated with latest results.

github-actions[bot] commented 3 months ago

Node: HAPI Test (Smart Contract) Results

 72 files   72 suites   23m 51s :stopwatch: 617 tests 617 :white_check_mark: 0 :zzz: 0 :x: 669 runs  669 :white_check_mark: 0 :zzz: 0 :x:

Results for commit fb5da63c.

:recycle: This comment has been updated with latest results.

codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 63.88889% with 26 lines in your changes missing coverage. Please review.

Project coverage is 58.28%. Comparing base (9973fae) to head (fb5da63). Report is 66 commits behind head on develop.

Files Patch % Lines
...va/com/hedera/node/app/fees/FeeCalculatorImpl.java 19.04% 17 Missing :warning:
.../node/app/hapi/fees/calc/OverflowCheckingCalc.java 50.00% 0 Missing and 3 partials :warning:
...va/com/hedera/node/app/fees/NoOpFeeCalculator.java 0.00% 2 Missing :warning:
.../com/hedera/node/app/fees/ChildFeeContextImpl.java 66.66% 1 Missing :warning:
.../java/com/hedera/node/app/fees/FeeContextImpl.java 66.66% 1 Missing :warning:
...p/workflows/handle/flow/DispatchHandleContext.java 0.00% 1 Missing :warning:
.../impl/handlers/TokenAssociateToAccountHandler.java 95.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #13942 +/- ## ============================================= - Coverage 67.58% 58.28% -9.30% + Complexity 36486 22085 -14401 ============================================= Files 3732 2883 -849 Lines 149767 109715 -40052 Branches 15571 11165 -4406 ============================================= - Hits 101223 63950 -37273 + Misses 44179 42228 -1951 + Partials 4365 3537 -828 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.