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: clear "side-effect fields" after switch a child record from SUCCESS to REVERTED_SUCCESS #10385

Merged

Conversation

thenswan
Copy link
Contributor

@thenswan thenswan commented Dec 8, 2023

Description:
Clear "side-effect fields" after switch a child record from SUCCESS to REVERTED_SUCCESS.

Related issue(s):
Fixes #10308

Notes for reviewer:
At first, I followed this strategy to remove side-effect fields:

  • Find specs with system contract call with REVERTED_SUCCESS
  • Fuzzy match them mod vs mono (individual specs)
  • Clear side-effect fields based on results of fuzzy matching

What did I check:

  • ContractMintHTSSuite.rollbackOnFailedMintAfterFungibleTransfer() — side-effect fields removed in prev PR
  • ContractDeleteSuite.cannotUseMoreThanChildContractLimit() — checked records and didn’t find any side-effect fields under REVERTED_SUCCESS
  • LazyCreateThroughPrecompileSuite.erc20TransferLazyCreate() — checked and removed automatic_token_associations under REVERTED_SUCCESS
  • LazyCreateThroughPrecompileSuite.erc721TransferFromLazyCreate() — checked records and didn’t find any side-effect fields under REVERTED_SUCCESS
  • LazyCreateThroughPrecompileSuite.erc20TransferFromLazyCreate() is still WIP and I can’t check it
  • Create2OperationSuite.canUseAliasesInPrecompilesAndContractKeys() is still WIP and I can’t check it

Other side-effect fields were mentioned in the issue (ones I that didnt encounter while did relevant spec fuzzy matching, like: transferList, created ids in the transactionReceipt, etc.) I added anyway from from mono TxnReceipt#Builder.revert() and ExpirableTxnRecord#Builder.nullOutSideEffectFields().

Checklist

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

@thenswan
Copy link
Contributor Author

thenswan commented Dec 8, 2023

@tinker-michaelj can you please take a look?

Copy link

github-actions bot commented Dec 8, 2023

Node: HAPI Test (Crypto) Results

211 tests  ±0   204 ✔️ +3   18m 24s ⏱️ + 1m 46s
  22 suites ±0       7 💤  - 3 
  22 files   ±0       0 ±0 

Results for commit a4fd7a1. ± Comparison against base commit 6f00b68.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 8, 2023

Node: HAPI Test (Token) Results

189 tests  ±0   189 ✔️ ±0   17m 56s ⏱️ +18s
  13 suites ±0       0 💤 ±0 
  13 files   ±0       0 ±0 

Results for commit a4fd7a1. ± Comparison against base commit 6f00b68.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 8, 2023

Node: Unit Test Results

    2 291 files  ±0      2 291 suites  ±0   1h 0m 28s ⏱️ + 13m 57s
118 428 tests +2  118 394 ✔️ +2  34 💤 ±0  0 ±0 
126 849 runs  +2  126 815 ✔️ +2  34 💤 ±0  0 ±0 

Results for commit a4fd7a1. ± Comparison against base commit 6f00b68.

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Dec 8, 2023

Codecov Report

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

Comparison is base (6f00b68) 63.02% compared to head (a4fd7a1) 63.03%.
Report is 23 commits behind head on develop.

Files Patch % Lines
...dle/record/SingleTransactionRecordBuilderImpl.java 96.15% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10385      +/-   ##
=============================================
+ Coverage      63.02%   63.03%   +0.01%     
- Complexity     30803    30813      +10     
=============================================
  Files           3359     3361       +2     
  Lines         135279   135392     +113     
  Branches       14074    14086      +12     
=============================================
+ Hits           85256    85347      +91     
- Misses         46683    46690       +7     
- Partials        3340     3355      +15     

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

Copy link

github-actions bot commented Dec 8, 2023

Node: HAPI Test (Time Consuming) Results

21 tests  ±0     9 ✔️ ±0   24m 59s ⏱️ -13s
  2 suites ±0   12 💤 ±0 
  2 files   ±0     0 ±0 

Results for commit a4fd7a1. ± Comparison against base commit 6f00b68.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 8, 2023

Node: HAPI Test (Misc) Results

419 tests   - 1   320 ✔️ ±0   27m 26s ⏱️ + 3m 23s
  73 suites  - 1     99 💤  - 1 
  73 files    - 1       0 ±0 

Results for commit a4fd7a1. ± Comparison against base commit 6f00b68.

This pull request removes 1 test.
com.hedera.services.bdd.suites.regression.PrecompileMintThrottlingCheck ‑ precompileNftMintsAreLimitedByConsThrottle
This pull request skips 1 and un-skips 1 tests.
com.hedera.services.bdd.suites.file.FileUpdateSuite ‑ optimisticSpecialFileUpdate
com.hedera.services.bdd.suites.regression.AddressAliasIdFuzzing ‑ addressAliasIdFuzzing

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 8, 2023

Node: E2E Test Results

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

Results for commit a4fd7a1. ± Comparison against base commit 6f00b68.

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 Dec 8, 2023

Node: Integration Test Results

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

Results for commit a4fd7a1. ± Comparison against base commit 6f00b68.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 8, 2023

Node: HAPI Test (Smart Contract) Results

398 tests  +1   360 ✔️ +4   48m 7s ⏱️ + 2m 45s
  55 suites ±0     38 💤  - 3 
  55 files   ±0       0 ±0 

Results for commit a4fd7a1. ± Comparison against base commit 6f00b68.

♻️ This comment has been updated with latest results.

@thenswan thenswan self-assigned this Dec 11, 2023
@thenswan thenswan added Limechain Work planned for the LimeChain team Modularization Issues or PRs related to modularization labels Dec 11, 2023
@thenswan thenswan marked this pull request as ready for review December 11, 2023 09:37
@thenswan thenswan requested a review from a team as a code owner December 11, 2023 09:37
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.

For fields other than Bytes, we want to reset values to null instead of DEFAULT since only null will omit the field from the serialized message.

…ESS to REVERTED_SUCCESS

Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
@thenswan thenswan force-pushed the 10308-clear-side-effects-after-REVERTED_SUCCESS branch from 45e1092 to cc51672 Compare December 12, 2023 15:29
…ESS to REVERTED_SUCCESS

Signed-off-by: Nikita Lebedev <nikita.lebedev@limechain.tech>
Signed-off-by: Nikita Lebedev <nikita.lebedev@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, ty @thenswan !

@tinker-michaelj tinker-michaelj merged commit 741094c into develop Dec 14, 2023
36 checks passed
@tinker-michaelj tinker-michaelj deleted the 10308-clear-side-effects-after-REVERTED_SUCCESS branch December 14, 2023 22:11
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 Modularization Issues or PRs related to modularization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mod-service needs equivalent to ExpirableTxnRecord#Builder.revert()
2 participants