-
Notifications
You must be signed in to change notification settings - Fork 9
chore: Remove BlockAcknowledgement.block_root_hash from Publisher API #1407
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>
Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>
Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>
Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>
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.
LGTM 💯
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.
LG, I have a concern however for the simulator startup data. @AlfredoG87 this could interfere with you long-running tests?
@@ -66,8 +66,7 @@ public void onNext(final PublishStreamResponse publishStreamResponse) { | |||
if (publishStreamResponse.hasAcknowledgement()) { | |||
final BlockAcknowledgement ack = publishStreamResponse.getAcknowledgement(); | |||
try { | |||
startupData.updateLatestAckBlockStartupData( | |||
ack.getBlockNumber(), ack.getBlockRootHash().toByteArray()); | |||
startupData.updateLatestAckBlockStartupData(ack.getBlockNumber()); |
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.
Please note that the startup data will stop functioning w/o the hash to be saved on disk. This means that the next startup will be w/o previous hash and everything will be broken after that. We should add a way to save the current hash (as it is generated by the simulator) and then retrieving and storing that in the proper place once ack is received.
if (enabled) { | ||
// @todo(904) we need the correct response code, currently it seems that | ||
// the response code is not being set correctly? The if check should | ||
// be different and based on the response code, only saving | ||
Files.write(latestAckBlockNumberPath, String.valueOf(blockNumber).getBytes()); | ||
Files.write(latestAckBlockHashPath, blockHash); |
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 do not think we can omit this, we simply need another way to supply the hash.
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## main #1407 +/- ##
============================================
+ Coverage 81.19% 81.26% +0.07%
+ Complexity 994 990 -4
============================================
Files 113 113
Lines 4456 4441 -15
Branches 467 464 -3
============================================
- Hits 3618 3609 -9
+ Misses 634 629 -5
+ Partials 204 203 -1
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
Reviewer Notes
BlockAcknowledgement.block_root_hash
is present in the publisher API but outdated and not utilized by CNblock_stream_publish_service.proto
)blockHash
from SimulatorStartupData.updateLatestAckBlockStartupData that was utilized as theblockRootHash
on an acknowledged block. ALso simplify logic given fewer casesblockRootHash
logic fromSimulatorStartupDataImplTest
logicSimulatorStartupDataImplTest
coverage withtestFailedInitializationUnavailableBlockNumberFile
PublishStreamObserverTest
withverifyUpdateLatestAckBlockStartupDataHandlesIOException()
and a correction of BlockAcknowledgment in responseRelated Issue(s)
Fixes #1395