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

04632 Fuzzing test for LazyCreate through precompiles #6527

Merged
merged 20 commits into from May 23, 2023

Conversation

agadzhalov
Copy link
Contributor

Description:
Fuzzing testing for LazyCreate through precompiles

LazyCreate - unique account creation which happens when we transfer funds to previously non-existing EVM address accounts. Automatically creates a hollow account.

For the purpose of the test we have to randomly generate EVM addresses and send funds/tokens to those addresses through precompile.

Five different test cases for transfer through precompile:

  • HBAR transfer
  • Fungible token transfer
  • Non fungible token transfer
  • ERC20 transfer
  • ERC721 transfer

Additional information:

  • In order for HBAR transfer to work properly through precompile contracts.precompile.atomicCryptoTransfer.enabled needs to be set to TRUE
  • Because of facing NO_REMAINING_AUTOMATIC_ASSOCIATIONS error, CryptoUpdate logic was implemented to set maxAutomaticAssociations to a bigger number
  • Because fuzzing test are ran concurrently it is possible after calling one ContractCall, another ContractCall to be called before the execution of CryptoUpdate and again NO_REMAINING_AUTOMATIC_ASSOCIATIONS will be thrown.

Related issue(s):

Fixes #4632

Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
… case

Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
…iSpec

Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
…lity

Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
@agadzhalov agadzhalov added Limechain Work planned for the LimeChain team CI:UnitTests labels May 10, 2023
@agadzhalov agadzhalov self-assigned this May 10, 2023
@agadzhalov agadzhalov requested a review from a team as a code owner May 10, 2023 14:30
@github-actions
Copy link

github-actions bot commented May 10, 2023

Node: Unit Test Results

    1 408 files      1 408 suites   1h 31m 44s ⏱️
  98 607 tests   98 600 ✔️ 7 💤 0
103 772 runs  103 765 ✔️ 7 💤 0

Results for commit 97b6b06.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 10, 2023

Node: Integration Test Results

    4 files      4 suites   13m 48s ⏱️
170 tests 170 ✔️ 0 💤 0
172 runs  172 ✔️ 0 💤 0

Results for commit 97b6b06.

♻️ This comment has been updated with latest results.

@github-actions
Copy link

github-actions bot commented May 10, 2023

Node: E2E Test Results

    1 files      1 suites   18m 25s ⏱️
310 tests 310 ✔️ 0 💤 0
328 runs  328 ✔️ 0 💤 0

Results for commit 97b6b06.

♻️ This comment has been updated with latest results.

Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
…ngProviderFactory

Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
Nana-EC
Nana-EC previously approved these changes May 18, 2023
Copy link
Collaborator

@tinker-michaelj tinker-michaelj left a comment

Choose a reason for hiding this comment

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

There are some CryptoUpdate's being submitted that seem they would always fail due to REQUESTED_NUM_AUTOMATIC_ASSOCIATIONS_EXCEEDS_ASSOCIATION_LIMIT; but overall a very clean change-set, LGTM!

Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
@sonarcloud
Copy link

sonarcloud bot commented May 22, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Collaborator

@tinker-michaelj tinker-michaelj left a comment

Choose a reason for hiding this comment

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

LGTM!

@agadzhalov agadzhalov merged commit 9051f30 into develop May 23, 2023
15 of 16 checks passed
@agadzhalov agadzhalov deleted the 04632-fuzztest-lazycreate-precompile-transfer branch May 23, 2023 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Limechain Work planned for the LimeChain team
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add fuzzing tests for transfers through precompile
4 participants