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 v0.51 evm module and HAS functions #13326

Merged
merged 9 commits into from
May 17, 2024

Conversation

lukelee-sl
Copy link
Member

@lukelee-sl lukelee-sl commented May 15, 2024

Description:
Third in the series of tasks for HIP-906.

  • Create the v0.51 version of the evm.
  • Implement hbarAllowance and hbarApprove function calls in the Hedera Account Service system contract.
  • Add a feature flag for turning off calls to Hedera Account Service.

Related issue(s):

Fixes #13181

Notes for reviewer:
xTests will be forthcoming in a future pr.
Substituting the redirectForAccount proxy contract byte code will also be in the next pr.
Most of the new logic is centered around hbarAllowanceTranslator, hbarAllowanceCall, hbarApproveTranslator and hbarApproveCall

Checklist

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

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
…pt through the proxy

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
@lukelee-sl lukelee-sl self-assigned this May 15, 2024
@lukelee-sl lukelee-sl requested review from tinker-michaelj and a team as code owners May 15, 2024 18:38
Copy link

github-actions bot commented May 15, 2024

Node: HAPI Test (Misc) Results

468 tests   458 ✅  40m 19s ⏱️
 77 suites   10 💤
 77 files      0 ❌

Results for commit f7868ff.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 15, 2024

Node: HAPI Test (Restart) Results

2 tests   2 ✅  8m 33s ⏱️
2 suites  0 💤
2 files    0 ❌

Results for commit f7868ff.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 15, 2024

Node: HAPI Test (Node Death Reconnect) Results

2 tests   2 ✅  9m 26s ⏱️
2 suites  0 💤
2 files    0 ❌

Results for commit f7868ff.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 15, 2024

Node: HAPI Test (Smart Contract) Results

604 tests   604 ✅  1h 9m 47s ⏱️
 63 suites    0 💤
 63 files      0 ❌

Results for commit f7868ff.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 15, 2024

Node: HAPI Test (Crypto) Results

335 tests   335 ✅  41m 20s ⏱️
 25 suites    0 💤
 25 files      0 ❌

Results for commit f7868ff.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 15, 2024

Node: HAPI Test (Token) Results

237 tests   235 ✅  20m 35s ⏱️
 17 suites    2 💤
 17 files      0 ❌

Results for commit f7868ff.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 15, 2024

Node: HAPI Test (Time Consuming) Results

21 tests   21 ✅  54m 28s ⏱️
 3 suites   0 💤
 3 files     0 ❌

Results for commit f7868ff.

♻️ This comment has been updated with latest results.

@lukelee-sl lukelee-sl changed the title 13181 evm v 51 updates feat: implement v0.51 evm module and HAS functions May 15, 2024
Copy link

github-actions bot commented May 15, 2024

Node: Unit Test Results

  2 315 files  + 7    2 315 suites  +7   3h 26m 54s ⏱️ - 2m 22s
119 005 tests +27  118 938 ✅ +27  67 💤 ±0  0 ❌ ±0 
127 566 runs  +27  127 499 ✅ +27  67 💤 ±0  0 ❌ ±0 

Results for commit f7868ff. ± Comparison against base commit dc3d3ae.

This pull request removes 3998 and adds 3789 tests. Note that renamed tests count towards both.

  
             IssuerDN: CN=s-aaaa
            SubjectDN: CN=s-aaaa
           Final Date: Fri Jan 01 00:00:00 UTC 2100
           Public Key: RSA Public Key [2e:28:bc:1e:d3:83:25:92:8e:cb:98:b1:b6:84:06:9c:d5:d8:14:d5],[56:66:d1:a4]
           Start Date: Sat Jan 01 00:00:00 UTC 2000
         SerialNumber: 12482092706667292405
        modulus: c1a0ff5d2372b53d12d12bb87dd03f5e…
        modulus: c1a0ff5d2372b53d12d12bb87dd03f5…
…
com.hedera.node.app.grpc.impl.netty.GrpcServiceBuilderTest ‑ [4] 

com.hedera.node.app.grpc.impl.netty.GrpcServiceBuilderTest ‑ [6] 

com.hedera.node.app.grpc.impl.netty.GrpcServiceBuilderTest ‑ [7]   
  
com.hedera.node.app.service.contract.impl.test.exec.systemcontracts.HasSystemContractTest ‑ haltsAndConsumesRemainingGasIfConfigIsOff()
com.hedera.node.app.service.contract.impl.test.exec.systemcontracts.has.HasCallAttemptTest ‑ constructsHbarAllowanceDirect()
com.hedera.node.app.service.contract.impl.test.exec.systemcontracts.has.HasCallAttemptTest ‑ constructsHbarAllowanceProxy()
com.hedera.node.app.service.contract.impl.test.exec.systemcontracts.has.HasCallAttemptTest ‑ constructsHbarApproveDirect()
com.hedera.node.app.service.contract.impl.test.exec.systemcontracts.has.HasCallAttemptTest ‑ constructsHbarApproveProxy()
com.hedera.node.app.service.contract.impl.test.exec.systemcontracts.has.HasCallAttemptTest ‑ invalidSelectorLeadsToMissingCall()
com.hedera.node.app.service.contract.impl.test.exec.systemcontracts.has.HasCallAttemptTest ‑ returnNullAccountIfAccountNotFound()
…

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented May 15, 2024

Codecov Report

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

Project coverage is 61.77%. Comparing base (dc3d3ae) to head (f7868ff).
Report is 12 commits behind head on develop.

Files Patch % Lines
...pp/service/contract/impl/exec/v051/V051Module.java 0.00% 34 Missing ⚠️
...ontract/impl/exec/v051/Version051FeatureFlags.java 0.00% 4 Missing ⚠️
...act/impl/exec/processors/HasTranslatorsModule.java 0.00% 3 Missing ⚠️
...ntracts/has/hbarapprove/HbarApproveTranslator.java 92.30% 1 Missing and 2 partials ⚠️
...t/impl/exec/systemcontracts/HasSystemContract.java 60.00% 1 Missing and 1 partial ⚠️
...contracts/has/hbarallowance/HbarAllowanceCall.java 91.30% 1 Missing and 1 partial ⚠️
...cts/has/hbarallowance/HbarAllowanceTranslator.java 92.00% 1 Missing and 1 partial ⚠️
...e/app/service/contract/impl/exec/FeatureFlags.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #13326      +/-   ##
=============================================
+ Coverage      61.74%   61.77%   +0.03%     
- Complexity     31248    31299      +51     
=============================================
  Files           3446     3453       +7     
  Lines         141289   141443     +154     
  Branches       14779    14791      +12     
=============================================
+ Hits           87233    87377     +144     
- Misses         50170    50173       +3     
- Partials        3886     3893       +7     

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

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.

At this point I've just checked the plumbing which looks fine.

Still to do: The 4 key classes Hbar{Allowance|Approve}{Call|Translator} and the tests.

Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
@lukelee-sl lukelee-sl marked this pull request as draft May 15, 2024 21:24
Signed-off-by: lukelee-sl <luke.lee@swirldslabs.com>
@lukelee-sl lukelee-sl marked this pull request as ready for review May 16, 2024 14:05
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 @lukelee-sl !

@lukelee-sl lukelee-sl merged commit 24ef3ac into develop May 17, 2024
47 of 49 checks passed
@lukelee-sl lukelee-sl deleted the 13181-evm-v-51-updates branch May 17, 2024 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants