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
0.38.x: Move (some) signatures and decoders of versioned ABIs to a dedicated location #6569
0.38.x: Move (some) signatures and decoders of versioned ABIs to a dedicated location #6569
Conversation
…location (Essentially a cherry-pick from develop, but before that PR got merged to develop. But see PR #6564.) Start of a new method for having one-stop-shopping for everything we need related to system contract ABIs. Signed-off-by: David Bakin <117694041+david-bakin-sl@users.noreply.github.com>
Signed-off-by: David Bakin <117694041+david-bakin-sl@users.noreply.github.com>
…removed Signed-off-by: David Bakin <117694041+david-bakin-sl@users.noreply.github.com>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## release/0.38 #6569 +/- ##
===================================================
+ Coverage 67.97% 91.00% +23.03%
+ Complexity 22317 17294 -5023
===================================================
Files 2018 1327 -691
Lines 135994 49700 -86294
Branches 7686 4998 -2688
===================================================
- Hits 92437 45230 -47207
+ Misses 42060 3515 -38545
+ Partials 1497 955 -542
☔ View full report in Codecov by Sentry. |
SonarCloud Quality Gate failed. |
...ava/com/hedera/node/app/service/mono/store/contracts/precompile/impl/SystemContractAbis.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a comment on the PR. Other changes LGTM
(Essentially a cherry-pick from develop, but done on my machine before the merge to develop happened. See #6564 for the original PR.)
Start of a new method for having one-stop-shopping for everything we
need related to system contract ABIs. (Subsequent additions will
include all system contract ABIs, and then moving to use this enum
as the source of ground truth for ABI (names, selectors, etc.)
everywhere.
N.B.: The initial goal of this is to simplify correct maintenance by putting everything related to our ABI in one place, instead of being scattered all over the place the way it is now. The ultimate goal is to generate this enum from the ground truth Solidity system contracts in our smart contracts repo.
Of the versioned ABIs, in this PR are: burn, mint, update token expiry info.
Subsequent PR will add all the creates, crypto transfer, and update token info.
Signed-off-by: David Bakin 117694041+david-bakin-sl@users.noreply.github.comDescription:
Related issue(s):
Fixes #6559
Notes for reviewer:
The meat is in the new enum
SystemContractAbis
which provides an enum element for each versioned ABI that supplies things like its selector and its decoder and also other interesting stuff. All the versioned ABIs are in there, and the unit test checks that the selectors computed from the signatures given match the ones we depend on inAbiConstants
.The enum contains all versioned ABIs though this PR only has fixed up the code for burn, mint, and update token expiry.
Future work will finish the work on incorporating the versioned ABIs from this enum into the precompiles, add all the non-versioned ABIs, and eventually refactor with an aim of eliminating other files where this stuff is scattered about, including
ParsingConstants
andDecodingFacade
. We should also generateAbiConstants
.Checklist