Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
refactor: adapt StatsSigningTestingTool to work with Bytes wrapper for transactions #17144
base: main
Are you sure you want to change the base?
refactor: adapt StatsSigningTestingTool to work with Bytes wrapper for transactions #17144
Changes from 13 commits
63edb17
50669f7
fd7222c
a7d6e22
b4dcec7
8478fd9
2c6d151
b67ca58
2145caa
9315b1c
c26e80d
a3d2c8b
7520540
c82d849
dcb186e
3d56d76
4e9ef8b
0cc6405
f3fd9b8
09bba4d
734ed9a
90f12bc
c91aa49
9877ca8
e8e5eae
24c549a
8a809cf
fd85b62
2ab240e
289fe7c
32c9803
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Check warning on line 321 in platform-sdk/platform-apps/tests/StatsSigningTestingTool/src/main/java/com/swirlds/demo/stats/signing/StatsSigningTestingToolMain.java
Codecov / codecov/patch
platform-sdk/platform-apps/tests/StatsSigningTestingTool/src/main/java/com/swirlds/demo/stats/signing/StatsSigningTestingToolMain.java#L321
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.
You can return after this, since the application should not do anything with the system transactions other than invoke the callback.
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.
Good idea. Fixed
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.
add nullity annotation
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.
Added
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.
this does not work if they happen to be the same size, so we need a definitive way of differentiating them
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.
Added additional logic that follows the transaction bytes structure from
TransactionCodec
. Now the algorithm checks if we have the correct size for the different segments on the correct positions and whether we have any bytes left after we load thedata segment
(which is the last one), using thedata length
value before it. I believe it will be very unlikely to have a system transaction that will cover all the additional checks I've added.Another approach, which will be more harming for the performance, is trying to parse the transactions bytes to a
StateSignatureTransaction
pbj type for each incoming transaction.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.
while this makes it very unlikely to confuse the two, it is still theoretically possible. so why not make it simpler and be 100% sure?
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.
I added a simpler approach for filtering system transactions.
Check warning on line 217 in platform-sdk/platform-apps/tests/StatsSigningTestingTool/src/main/java/com/swirlds/demo/stats/signing/SttTransactionPool.java
Codecov / codecov/patch
platform-sdk/platform-apps/tests/StatsSigningTestingTool/src/main/java/com/swirlds/demo/stats/signing/SttTransactionPool.java#L217