hedera-services icon indicating copy to clipboard operation
hedera-services copied to clipboard

feat: implement base hedera account service system contract classes

Open lukelee-sl opened this issue 9 months ago • 8 comments

Description: Expand the system contract class hierarchy to accommodate the Hedera account service system contract base classes (HasSystemContract, HasCallAttempt, HasCallFactory) while maximizing reuse.

  • Create a common interface for HtsCallFactory and HasCallFactory called CallFactory
  • Common code from HtsCallAttempt and HasCallAttempt was moved to AbstractCallAttempt
  • Common code from HtsSystemContract and HasSystemContract were moved to a new common AbstractNativeSystemContract class. HtsSystemContract and HasSystemContract are now trivial.

Originally planned on making dagger updates here but the pr was starting to get long. Will make those changes and the unit tests noted below in a future pr.

Related issue(s):

Fixes #13136

Notes for reviewer:

No unit tests yet for HasCallFactory and HasCallAttempt. Tests require at least one implementation of translator and call classes which will be coming in a subsequent pr. Tests will be added at that time.

Test coverage for HasSystemContract as the class is trivial and most of the work is done in AbstractNativeSystemContract which is exercised via HtsSystemContractTest

Checklist

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

lukelee-sl avatar May 09 '24 01:05 lukelee-sl

Node: HAPI Test (Restart) Results

2 tests   2 :white_check_mark:  8m 42s :stopwatch: 2 suites  0 :zzz: 2 files    0 :x:

Results for commit 0f2171d9.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 09 '24 01:05 github-actions[bot]

Node: HAPI Test (Node Death Reconnect) Results

2 tests   2 :white_check_mark:  9m 6s :stopwatch: 2 suites  0 :zzz: 2 files    0 :x:

Results for commit 0f2171d9.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 09 '24 01:05 github-actions[bot]

Node: HAPI Test (Token) Results

235 tests   233 :white_check_mark:  21m 5s :stopwatch:  17 suites    2 :zzz:  17 files      0 :x:

Results for commit 0f2171d9.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 09 '24 01:05 github-actions[bot]

Node: HAPI Test (Crypto) Results

335 tests   335 :white_check_mark:  38m 6s :stopwatch:  25 suites    0 :zzz:  25 files      0 :x:

Results for commit 0f2171d9.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 09 '24 02:05 github-actions[bot]

Node: HAPI Test (Misc) Results

464 tests   454 :white_check_mark:  39m 39s :stopwatch:  77 suites   10 :zzz:  77 files      0 :x:

Results for commit 0f2171d9.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 09 '24 02:05 github-actions[bot]

Node: HAPI Test (Time Consuming) Results

21 tests   21 :white_check_mark:  54m 20s :stopwatch:  3 suites   0 :zzz:  3 files     0 :x:

Results for commit 0f2171d9.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 09 '24 02:05 github-actions[bot]

Node: Unit Test Results

  2 305 files  ±0    2 305 suites  ±0   3h 10m 48s :stopwatch: + 31m 57s 118 955 tests ±0  118 888 :white_check_mark: ±0  67 :zzz: ±0  0 :x: ±0  127 516 runs  ±0  127 449 :white_check_mark: ±0  67 :zzz: ±0  0 :x: ±0 

Results for commit 0f2171d9. ± Comparison against base commit c428dcae.

This pull request removes 4010 and adds 3775 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: c1a0ff5d2372b53d12d12bb87dd03f5…
   Address[id=0,nickname=6gMRfXH4,selfName=aaaa,weight=1000,hostnameInternal=127.0.0.1,portInternalIpv4=18307,hostnameExternal=66.134.70.238,portExternalIpv4=18307,sigPublicKey=<null>,agreePublicKey=<null>,sigCert=com.swirlds.platform.crypto.SerializableX509Certificate@3216ef5b,agreeCert=com.swirlds.platform.crypto.SerializableX509Certificate@63195a11,memo=TItEZMvg],
…
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.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [10] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@1ce460ab
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [11] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@d3ca4097
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [12] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@b921ee3a
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [13] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@4fad55a0
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [14] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@3b127b5e
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [15] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@c49af692
com.hedera.node.app.service.mono.state.codec.VirtualKeySerdesAdapterTest ‑ [16] com.hedera.node.app.service.mono.state.codec.VirtualBlobKey@42a65bfd
…

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 09 '24 02:05 github-actions[bot]

Node: HAPI Test (Smart Contract) Results

592 tests   592 :white_check_mark:  1h 11m 29s :stopwatch:  63 suites    0 :zzz:  63 files      0 :x:

Results for commit 0f2171d9.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar May 09 '24 02:05 github-actions[bot]

Unfortunate that HAS becomes Has in camel-case (though an acronym that's the rule) because that makes methods look like predicates and just looks confusing for class names. Oh well.

david-bakin-sl avatar May 14 '24 15:05 david-bakin-sl