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

chore: Add factory method for StateSignatureTransaction #17447

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

netopyr
Copy link
Contributor

@netopyr netopyr commented Jan 20, 2025

Description:

This PR adds an implementation of SwirldMain.encodeSystemTransaction() in Hedera.

Related issue(s):

Fixes #17073

Notes for reviewer:

Checklist

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

@netopyr netopyr added this to the v0.59 milestone Jan 20, 2025
@netopyr netopyr self-assigned this Jan 20, 2025
@netopyr netopyr requested review from a team as code owners January 20, 2025 13:20
@netopyr netopyr requested a review from iwsimon January 20, 2025 13:20
Copy link

codacy-production bot commented Jan 20, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.07% (target: -1.00%) 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (3e8fa1f) 97675 71128 72.82%
Head commit (4aabb91) 97978 (+303) 71413 (+285) 72.89% (+0.07%)

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 (#17447) 14 0 0.00%

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 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.

Project coverage is 68.98%. Comparing base (3e8fa1f) to head (4aabb91).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...-app/src/main/java/com/hedera/node/app/Hedera.java 0.00% 14 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main   #17447      +/-   ##
============================================
+ Coverage     68.91%   68.98%   +0.06%     
- Complexity    22667    22770     +103     
============================================
  Files          2613     2619       +6     
  Lines         97892    98282     +390     
  Branches      10156    10184      +28     
============================================
+ Hits          67463    67796     +333     
- Misses        26613    26658      +45     
- Partials       3816     3828      +12     
Files with missing lines Coverage Δ
...-app/src/main/java/com/hedera/node/app/Hedera.java 51.25% <0.00%> (-1.86%) ⬇️

... and 45 files with indirect coverage changes

Impacted file tree graph

iwsimon
iwsimon previously approved these changes Jan 21, 2025
Copy link
Contributor

@iwsimon iwsimon left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @netopyr

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! Thanks @netopyr

final var instant = appContext.instantSource().instant();
final var nodeAccountID = appContext.selfNodeInfoSupplier().get().accountId();

final var transactionValidStart =
Copy link
Collaborator

@tinker-michaelj tinker-michaelj Jan 21, 2025

Choose a reason for hiding this comment

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

Afaict the transactionValidDuration and transactionID#transactionValidStart fields have only very minimal verification here during PreHandleWorkflow and we could set them here to,

  • Duration.DEFAULT
  • Timestamp.DEFAULT

respectively. Unless we want to change that, I would suggest using these DEFAULT values to (1) save a few bytes and (2) avoid implying to the reader taht these transactions get deeper validation downstream.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, good point. For some reason, I was convinced we would check if the time interval was valid. But we cannot do it at this point, of course. I will update the code. Thanks!

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.

Add serialization method for StateSignatureTransaction in hedera.app
4 participants