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

feat: implement system contract versioning foundation #17611

Merged
merged 3 commits into from
Feb 3, 2025

Conversation

lukelee-sl
Copy link
Member

Description:
Implement foundational changes for system contract versioning. Current state is that the feature is turned off with only calls to 0x167 allowed for HTS system contracts

Related issue(s):

Fixes #17493

Notes for reviewer:

Checklist

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

Signed-off-by: Luke Lee <luke.lee@hashgraph.com>
@lukelee-sl lukelee-sl added this to the v0.60 milestone Jan 29, 2025
@lukelee-sl lukelee-sl self-assigned this Jan 29, 2025
@lukelee-sl lukelee-sl requested review from tinker-michaelj and a team as code owners January 29, 2025 18:07
Copy link

codacy-production bot commented Jan 29, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -1.00%) 73.33%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (d5864cd) 98536 71807 72.87%
Head commit (e79e856) 98616 (+80) 71861 (+54) 72.87% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#17611) 90 66 73.33%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

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

Project coverage is 68.92%. Comparing base (d5864cd) to head (e79e856).
Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
...cts/hts/address_0x16c/balanceof/BalanceOfCall.java 0.00% 14 Missing ⚠️
...s/address_0x16c/balanceof/BalanceOfTranslator.java 69.23% 4 Missing ⚠️
...contract/impl/exec/utils/SystemContractMethod.java 86.36% 2 Missing and 1 partial ⚠️
...t/impl/exec/systemcontracts/HtsSystemContract.java 75.00% 1 Missing and 1 partial ⚠️
...t/impl/exec/systemcontracts/HasSystemContract.java 50.00% 1 Missing ⚠️
...t/impl/exec/systemcontracts/HssSystemContract.java 50.00% 1 Missing ⚠️
...ec/systemcontracts/common/AbstractCallAttempt.java 66.66% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #17611      +/-   ##
============================================
- Coverage     68.92%   68.92%   -0.01%     
- Complexity    22849    22861      +12     
============================================
  Files          2629     2633       +4     
  Lines         98753    98834      +81     
  Branches      10257    10258       +1     
============================================
+ Hits          68063    68118      +55     
- Misses        26794    26820      +26     
  Partials       3896     3896              
Files with missing lines Coverage Δ
...a/com/hedera/node/config/data/ContractsConfig.java 100.00% <ø> (ø)
...pl/exec/processors/CustomMessageCallProcessor.java 88.18% <100.00%> (+1.94%) ⬆️
...mpl/exec/processors/Hts0x16cTranslatorsModule.java 100.00% <100.00%> (ø)
...act/impl/exec/processors/HtsTranslatorsModule.java 100.00% <ø> (ø)
...contract/impl/exec/processors/ProcessorModule.java 100.00% <100.00%> (ø)
...mpl/exec/systemcontracts/AbstractFullContract.java 100.00% <100.00%> (ø)
...ec/systemcontracts/ExchangeRateSystemContract.java 96.00% <100.00%> (+0.34%) ⬆️
...mpl/exec/systemcontracts/HederaSystemContract.java 100.00% <ø> (ø)
.../impl/exec/systemcontracts/PrngSystemContract.java 97.10% <100.00%> (+0.04%) ⬆️
...contracts/common/AbstractNativeSystemContract.java 61.33% <100.00%> (-0.51%) ⬇️
... and 16 more

... and 24 files with indirect coverage changes

Impacted file tree graph

david-bakin-sl
david-bakin-sl previously approved these changes Jan 30, 2025
Copy link
Member

@david-bakin-sl david-bakin-sl left a comment

Choose a reason for hiding this comment

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

LGTM - good start at this feature!

I will add to my new smart contract service metrics epic a task to consider per-address metrics, e.g., how many times 0x167 is called vs 0x169, etc.

Signed-off-by: Luke Lee <luke.lee@hashgraph.com>
Copy link
Member

@david-bakin-sl david-bakin-sl left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@stoyanov-st stoyanov-st left a comment

Choose a reason for hiding this comment

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

LGTM, I guess we can move the 0x167 system contracts to a new address_0x167 dir at some point?
This a great effort @lukelee-sl
Thank you!

Copy link
Member

@Neeharika-Sompalli Neeharika-Sompalli left a comment

Choose a reason for hiding this comment

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

LGTM from hedera-services changes ! Thanks @lukelee-sl

@lukelee-sl lukelee-sl merged commit 54596ec into main Feb 3, 2025
45 of 46 checks passed
@lukelee-sl lukelee-sl deleted the 17494-base-system-contract-versioning branch February 3, 2025 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create system contract version base implementation
4 participants