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

fix: tests from LeakyContractTestsSuite #9997

Merged
merged 14 commits into from Dec 6, 2023

Conversation

MrValioBg
Copy link
Contributor

@MrValioBg MrValioBg commented Nov 20, 2023

Fix tests from LeakyContractTestsSuite.

Description:

  1. In this PR we add check for noncesExternalizationEnabled flag in RootProxyWorldUpdater in order to fix contractCreateNoncesExternalizationHappyPath & shouldReturnNullWhenContractsNoncesExternalizationFlagIsDisabled tests.

  2. Since limit feature flag won't be supported anymore we just fix the HAPI test autoAssociationSlotsAppearsInInfo

Related issue(s):

Fixes #9402
#9408

Checklist

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

…onfiguration when externalizing nonces. Add additional check for exceeded associations.

Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
@MrValioBg MrValioBg self-assigned this Nov 20, 2023
@MrValioBg MrValioBg added the Limechain Work planned for the LimeChain team label Nov 20, 2023
Copy link

github-actions bot commented Nov 20, 2023

Node: Unit Test Results

    2 288 files  +  5      2 288 suites  +5   42m 35s ⏱️ - 4m 28s
118 397 tests +32  118 363 ✔️ +32  34 💤 ±0  0 ±0 
126 769 runs  +86  126 735 ✔️ +86  34 💤 ±0  0 ±0 

Results for commit fcabed2. ± Comparison against base commit edc657a.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 20, 2023

Node: E2E Test Results

    1 files  ±    0      1 suites  ±0   21m 55s ⏱️ + 21m 55s
311 tests +310  311 ✔️ +311  0 💤 ±0  0  - 1 
333 runs  +332  333 ✔️ +333  0 💤 ±0  0  - 1 

Results for commit fcabed2. ± Comparison against base commit edc657a.

This pull request removes 1 and adds 311 tests. Note that renamed tests count towards both.
EndToEndTests ‑ initializationError
EndToEndTests ‑ ADDRESS_BOOK_CONTROLCanUpdateADDRESS_BOOK
EndToEndTests ‑ ADDRESS_BOOK_CONTROLCanUpdateNODE_DETAILS
EndToEndTests ‑ AccountsGetPayerRecordsIfSoConfigured
EndToEndTests ‑ Acct57CanMakeSmallChanges
EndToEndTests ‑ Acct57CantMakeLargeChanges
EndToEndTests ‑ AddingSignaturesToExecutedTxFails
EndToEndTests ‑ AddingSignaturesToExecutedTxFailsWithLongTermEnabled
EndToEndTests ‑ AddingSignaturesToNonExistingTxFails
EndToEndTests ‑ AddingSignaturesToNonExistingTxFailsWithLongTermEnabled
EndToEndTests ‑ AddressAliasIdFuzzing
…

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 20, 2023

Node: Integration Test Results

279 tests  ±0   279 ✔️ +1   28m 30s ⏱️ +12s
    5 suites ±0       0 💤 ±0 
    5 files   ±0       0  - 1 

Results for commit fcabed2. ± Comparison against base commit edc657a.

♻️ This comment has been updated with latest results.

Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
Copy link

github-actions bot commented Nov 20, 2023

Node: HAPI Test Results

1 245 tests  ±0   914 ✔️ +3   1h 35m 0s ⏱️ +40s
   166 suites ±0   331 💤  - 3 
   166 files   ±0       0 ±0 

Results for commit a3c04e0. ± Comparison against base commit fe5882f.

♻️ This comment has been updated with latest results.

@MrValioBg MrValioBg marked this pull request as ready for review November 20, 2023 15:54
@MrValioBg MrValioBg marked this pull request as draft November 21, 2023 08:18
Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (edc657a) 65.27% compared to head (fcabed2) 63.11%.
Report is 58 commits behind head on develop.

Files Patch % Lines
...ice/contract/impl/state/RootProxyWorldUpdater.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #9997      +/-   ##
=============================================
- Coverage      65.27%   63.11%   -2.16%     
- Complexity     30202    30723     +521     
=============================================
  Files           3329     3335       +6     
  Lines         126937   134142    +7205     
  Branches       13198    13915     +717     
=============================================
+ Hits           82853    84659    +1806     
- Misses         40868    46139    +5271     
- Partials        3216     3344     +128     

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

@MrValioBg MrValioBg marked this pull request as ready for review November 21, 2023 09:08
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.

The nonceInfo feature flag is recent enough, and your implementation is very clean, so keeping that in mod-service seems totally reasonable.

But the token associations limit feature flag we will never re-enable. So continuing to enforce it and adding noticeable code to do so doesn't really make sense. 😞

I think we should remove those changes and replace existing spec autoAssociationSlotsAppearsInInfo() with,

    @HapiTest
    private HapiSpec autoAssociationSlotsAppearsInInfo() {
        final int maxAutoAssociations = 100;
        final String CONTRACT = "Multipurpose";

        return propertyPreservingHapiSpec("autoAssociationSlotsAppearsInInfo")
                .preserving(CONTRACT_ALLOW_ASSOCIATIONS_PROPERTY)
                .given(overriding(
                        CONTRACT_ALLOW_ASSOCIATIONS_PROPERTY,
                        "true"))
                .when()
                .then(
                        newKeyNamed(ADMIN_KEY),
                        uploadInitCode(CONTRACT),
                        contractCreate(CONTRACT).adminKey(ADMIN_KEY).maxAutomaticTokenAssociations(maxAutoAssociations),
                        getContractInfo(CONTRACT)
                                .has(ContractInfoAsserts.contractWith().maxAutoAssociations(maxAutoAssociations))
                                .logged());
    }

…be supported.

Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
…no longer support feature flag for limit

Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
Copy link

github-actions bot commented Nov 23, 2023

Node: HAPI Test (Time Consuming) Results

21 tests  ±0     9 ✔️ +5   26m 3s ⏱️ + 19m 52s
  2 suites ±0   12 💤  - 5 
  2 files   ±0     0 ±0 

Results for commit fcabed2. ± Comparison against base commit edc657a.

♻️ This comment has been updated with latest results.

Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
Copy link

github-actions bot commented Nov 23, 2023

Node: HAPI Test (Crypto) Results

211 tests  ±0   201 ✔️ ±0   21m 25s ⏱️ + 4m 18s
  22 suites ±0     10 💤 ±0 
  22 files   ±0       0 ±0 

Results for commit fcabed2. ± Comparison against base commit edc657a.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 23, 2023

Node: HAPI Test (Token) Results

190 tests  ±0   188 ✔️ ±0   17m 57s ⏱️ -33s
  13 suites ±0       2 💤 ±0 
  13 files   ±0       0 ±0 

Results for commit fcabed2. ± Comparison against base commit edc657a.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 23, 2023

Node: HAPI Test (Misc) Results

419 tests  +1   316 ✔️ +43   27m 5s ⏱️ + 6m 39s
  73 suites ±0   103 💤  - 42 
  73 files   ±0       0 ±  0 

Results for commit fcabed2. ± Comparison against base commit edc657a.

This pull request removes 3 and adds 4 tests. Note that renamed tests count towards both.
com.hedera.services.bdd.suites.schedule.ScheduleExecutionSpecs ‑ aSuiteSetup
com.hedera.services.bdd.suites.schedule.ScheduleExecutionSpecs ‑ zSuiteCleanup
com.hedera.services.bdd.suites.schedule.ScheduleSignSpecs ‑ bumpThirdNestedThresholdSigningReq
com.hedera.services.bdd.suites.fees.CongestionPricingSuite ‑ canUpdateMultipliersDynamically2
com.hedera.services.bdd.suites.schedule.ScheduleExecutionSpecs ‑ scheduledSystemDeleteUnauthorizedPayerFails
com.hedera.services.bdd.suites.schedule.ScheduleExecutionSpecs ‑ suiteCleanup
com.hedera.services.bdd.suites.schedule.ScheduleExecutionSpecs ‑ suiteSetup
This pull request removes 3 skipped tests and adds 3 skipped tests. Note that renamed tests count towards both.
com.hedera.services.bdd.suites.schedule.ScheduleExecutionSpecs ‑ aSuiteSetup
com.hedera.services.bdd.suites.schedule.ScheduleExecutionSpecs ‑ zSuiteCleanup
com.hedera.services.bdd.suites.schedule.ScheduleSignSpecs ‑ bumpThirdNestedThresholdSigningReq
com.hedera.services.bdd.suites.schedule.ScheduleExecutionSpecs ‑ scheduledSystemDeleteUnauthorizedPayerFails
com.hedera.services.bdd.suites.schedule.ScheduleExecutionSpecs ‑ suiteCleanup
com.hedera.services.bdd.suites.schedule.ScheduleExecutionSpecs ‑ suiteSetup

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Nov 23, 2023

Node: HAPI Test (Smart Contract) Results

405 tests   - 5   325 ✔️ +13   45m 10s ⏱️ + 4m 45s
  56 suites ±0     80 💤  - 18 
  56 files   ±0       0 ±  0 

Results for commit fcabed2. ± Comparison against base commit edc657a.

This pull request removes 6 and adds 1 tests. Note that renamed tests count towards both.
com.hedera.services.bdd.suites.contract.precompile.ContractKeysStillWorkAsExpectedSuite ‑ contractCanStillTransferItsOwnAssets
com.hedera.services.bdd.suites.contract.precompile.ContractKeysStillWorkAsExpectedSuite ‑ contractKeysWorkAsExpectedForFungibleTokenMgmt
com.hedera.services.bdd.suites.contract.precompile.ContractKeysStillWorkAsExpectedSuite ‑ fallbackFeeForHtsPayerMustSign
com.hedera.services.bdd.suites.contract.precompile.ContractKeysStillWorkAsExpectedSuite ‑ fallbackFeePayerMustSign
com.hedera.services.bdd.suites.contract.precompile.ContractKeysStillWorkAsExpectedSuite ‑ fixedFeeFailsWhenDisabledButWorksWhenEnabled
com.hedera.services.bdd.suites.contract.precompile.ContractKeysStillWorkAsExpectedSuite ‑ topLevelSigsStillWorkWithDefaultGrandfatherNum
com.hedera.services.bdd.suites.contract.precompile.ApproveAllowanceSuite ‑ nftAutoCreationIncludeAllowanceCheck
This pull request removes 6 skipped tests and adds 1 skipped test. Note that renamed tests count towards both.
com.hedera.services.bdd.suites.contract.precompile.ContractKeysStillWorkAsExpectedSuite ‑ contractCanStillTransferItsOwnAssets
com.hedera.services.bdd.suites.contract.precompile.ContractKeysStillWorkAsExpectedSuite ‑ contractKeysWorkAsExpectedForFungibleTokenMgmt
com.hedera.services.bdd.suites.contract.precompile.ContractKeysStillWorkAsExpectedSuite ‑ fallbackFeeForHtsPayerMustSign
com.hedera.services.bdd.suites.contract.precompile.ContractKeysStillWorkAsExpectedSuite ‑ fallbackFeePayerMustSign
com.hedera.services.bdd.suites.contract.precompile.ContractKeysStillWorkAsExpectedSuite ‑ fixedFeeFailsWhenDisabledButWorksWhenEnabled
com.hedera.services.bdd.suites.contract.precompile.ContractKeysStillWorkAsExpectedSuite ‑ topLevelSigsStillWorkWithDefaultGrandfatherNum
com.hedera.services.bdd.suites.contract.precompile.ApproveAllowanceSuite ‑ nftAutoCreationIncludeAllowanceCheck

♻️ This comment has been updated with latest results.

@MrValioBg
Copy link
Contributor Author

The nonceInfo feature flag is recent enough, and your implementation is very clean, so keeping that in mod-service seems totally reasonable.

But the token associations limit feature flag we will never re-enable. So continuing to enforce it and adding noticeable code to do so doesn't really make sense. 😞

I think we should remove those changes and replace existing spec autoAssociationSlotsAppearsInInfo() with,

    @HapiTest
    private HapiSpec autoAssociationSlotsAppearsInInfo() {
        final int maxAutoAssociations = 100;
        final String CONTRACT = "Multipurpose";

        return propertyPreservingHapiSpec("autoAssociationSlotsAppearsInInfo")
                .preserving(CONTRACT_ALLOW_ASSOCIATIONS_PROPERTY)
                .given(overriding(
                        CONTRACT_ALLOW_ASSOCIATIONS_PROPERTY,
                        "true"))
                .when()
                .then(
                        newKeyNamed(ADMIN_KEY),
                        uploadInitCode(CONTRACT),
                        contractCreate(CONTRACT).adminKey(ADMIN_KEY).maxAutomaticTokenAssociations(maxAutoAssociations),
                        getContractInfo(CONTRACT)
                                .has(ContractInfoAsserts.contractWith().maxAutoAssociations(maxAutoAssociations))
                                .logged());
    }

Understood! I Implemented the changes :)

@mustafauzunn mustafauzunn requested review from tinker-michaelj and removed request for tinker-michaelj November 30, 2023 11:05
@mustafauzunn mustafauzunn changed the title Fix tests from LeakyContractTestsSuite fix: tests from LeakyContractTestsSuite Dec 1, 2023
tinker-michaelj
tinker-michaelj previously approved these changes Dec 1, 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.

LGTM, ty @mustafauzunn !

Signed-off-by: Valentin Valkanov <valentin.valkanov@limechain.tech>
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, tyvm @MrValioBg !

@mustafauzunn mustafauzunn merged commit ebe2039 into develop Dec 6, 2023
25 of 27 checks passed
@mustafauzunn mustafauzunn deleted the 08896-fix-leaky-tests-add-additional-checks branch December 6, 2023 07:07
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
None yet
3 participants