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

Add missing logics and validations from services #8157

Merged
merged 17 commits into from May 7, 2024

Conversation

zhpetkov
Copy link
Contributor

@zhpetkov zhpetkov commented Apr 22, 2024

Description:
AccessorBasedUsages#estimateCryptoTransfer - token multiplier
Add MirrorNodeEvmProperties in AccessorBasedUsages, ServiceConfiguration. Add feesTransferUsageMultiplier with default value 380 in MirrorNodeEvmProperties. Set token multiplier value from mirrorNodeEvmProperties in AccessorBasedUsages. Modification in AccessorBasedUsagesTest.

HederaSelfDestructOperationV038 - reasonToHalt missing if statements
Add contractIsTokenTreasury, contractHasAnyBalance, contractOwnsNfts in HederaEvmStackedWorldStateUpdater, because they are needed in reasonToHalt statements. Add more tests in HederaSelfDestructOperationV038 - rejectsSelfDestructIfTreasury(), rejectsSelfDestructIfContractHasAnyTokenBalance(), rejectsSelfDestructIfContractHasAnyNfts().

AbstractAutoCreationLogic#create - missing analyzeTokenTransferCreations part
Add tokenAliasMap, analyzeTokenTransferCreations and reset in AbstractAutoCreationLogic. Add getTokenAliasMap in AutoCreationLogic. Add needed modifications in MirrorEvmMessageCallProcessorTest, TransferLogicTest, SyntheticTxnFactoryTest, TransferPrecompileTest. Add new tests in AutoCreationLogicTest.

SyntethicTxnFactory#createHollowAccount - setMaxAutomaticTokenAssociations
Add maxAutoAssociationsin createHollowAccount.

Related issue(s):

Fixes #8056
Fixes #8137

Notes for reviewer:

Checklist

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

Signed-off-by: Zhivko Petkov <zhpetkov9@gmail.com>
Signed-off-by: Zhivko Petkov <zhpetkov9@gmail.com>
Signed-off-by: Zhivko Petkov <zhpetkov9@gmail.com>
Signed-off-by: Zhivko Petkov <zhpetkov9@gmail.com>
Copy link

codecov bot commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 92.30%. Comparing base (9f37404) to head (bd92975).

Files Patch % Lines
...va/com/hedera/mirror/web3/evm/store/StoreImpl.java 70.00% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8157      +/-   ##
============================================
+ Coverage     92.28%   92.30%   +0.01%     
- Complexity     7280     7288       +8     
============================================
  Files           898      899       +1     
  Lines         29338    29355      +17     
  Branches       3575     3583       +8     
============================================
+ Hits          27075    27096      +21     
+ Misses         1446     1439       -7     
- Partials        817      820       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zhpetkov zhpetkov self-assigned this Apr 22, 2024
@zhpetkov zhpetkov added enhancement Type: New feature web3 Area: Web3 API limechain Work planned for the LimeChain team labels Apr 22, 2024
…ructOperationBase

Signed-off-by: Zhivko Petkov <zhpetkov9@gmail.com>
Signed-off-by: Zhivko Petkov <zhpetkov9@gmail.com>
Signed-off-by: Zhivko Petkov <zhpetkov9@gmail.com>
Copy link
Contributor

@mustafauzunn mustafauzunn left a comment

Choose a reason for hiding this comment

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

What is the difference between this pr and #8074

@zhpetkov
Copy link
Contributor Author

zhpetkov commented Apr 24, 2024

What is the difference between this pr and #8074

No differences! I merged the main branch into 8056-add-missing-logics-and-validation-part-1 in #8074 and this added 700 new changes and conflicts. I closed #8074, because after merging the main branch It's difficult to review which are my changes.

…onLogic

Signed-off-by: Zhivko Petkov <zhpetkov9@gmail.com>
@steven-sheehy steven-sheehy added this to the 0.104.0 milestone Apr 24, 2024
zhpetkov and others added 2 commits April 30, 2024 19:36
Signed-off-by: Zhivko Petkov <zhpetkov9@gmail.com>
PrecompilePricingUtils - computeViewFunctionGas
Change calculate implementation and now will return a larger of minimum or gas charge plus premium. Add new tests and modify old ones.

AllowanceHelpers - fetchOwxnerAccount
ApproveAllowanceLogic - INVALID_ALLOWANCE_SPENDER_ID
Add loadAccountOrFailWith and validateUsable in Store which help to load the account from the state and throw the given code if an exception occurs due to an invalid account. Add new tests and modify old ones.

---------

Signed-off-by: Zhivko Petkov <zhpetkov9@gmail.com>
@steven-sheehy steven-sheehy modified the milestones: 0.104.0, 0.105.0 May 3, 2024
Copy link
Member

@steven-sheehy steven-sheehy left a comment

Choose a reason for hiding this comment

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

Need to merge and fix DCO

zhpetkov and others added 3 commits May 7, 2024 13:18
Signed-off-by: Zhivko Petkov <zhpetkov9@gmail.com>
Signed-off-by: Zhivko Petkov <119669063+zhpetkov@users.noreply.github.com>
Signed-off-by: Zhivko Petkov <zhpetkov9@gmail.com>
Copy link

sonarcloud bot commented May 7, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@zhpetkov
Copy link
Contributor Author

zhpetkov commented May 7, 2024

Need to merge and fix DCO

Merged.

Copy link
Member

@steven-sheehy steven-sheehy left a comment

Choose a reason for hiding this comment

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

LGTM

@steven-sheehy steven-sheehy merged commit 13d3ede into main May 7, 2024
29 checks passed
@steven-sheehy steven-sheehy deleted the 8056-add-missing-logics-and-validations-p1 branch May 7, 2024 19:08
@steven-sheehy steven-sheehy changed the title Add missing logics and validations from services p1 Add missing logics and validations from services May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type: New feature limechain Work planned for the LimeChain team web3 Area: Web3 API
Projects
None yet
5 participants