Skip to content

Conversation

Nana-EC
Copy link
Contributor

@Nana-EC Nana-EC commented Jul 22, 2025

Reviewer Notes

BlockAcknowledgement.block_root_hash is present in the publisher API but outdated and not utilized by CN

  • Remove BlockAcknowledgement.block_root_hash from Publisher API (block_stream_publish_service.proto)
  • Remove blockHash from SimulatorStartupData.updateLatestAckBlockStartupData that was utilized as the blockRootHash on an acknowledged block. ALso simplify logic given fewer cases
  • Remove blockRootHash logic from SimulatorStartupDataImplTest logic
  • Increase SimulatorStartupDataImplTest coverage with testFailedInitializationUnavailableBlockNumberFile
  • Fix and increase PublishStreamObserverTest with verifyUpdateLatestAckBlockStartupDataHandlesIOException() and a correction of BlockAcknowledgment in response

Related Issue(s)

Fixes #1395

Signed-off-by: Nana Essilfie-Conduah <nana@swirldslabs.com>
@Nana-EC Nana-EC added this to the 0.15.0 milestone Jul 22, 2025
@Nana-EC Nana-EC self-assigned this Jul 22, 2025
@Nana-EC Nana-EC added Feature Enhancement Enhancing an existing feature driven by business requirements. Typically backwards compatible. Block Node Issues/PR related to the Block Node. Publisher Plugin Issue related to Publisher Plugin Protobuf labels Jul 22, 2025
Nana-EC added 3 commits July 21, 2025 23:45
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>
@Nana-EC Nana-EC marked this pull request as ready for review July 23, 2025 01:19
@Nana-EC Nana-EC requested review from a team as code owners July 23, 2025 01:19
Copy link
Contributor

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

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

LGTM 💯

Copy link
Contributor

@ata-nas ata-nas left a 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());
Copy link
Contributor

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);
Copy link
Contributor

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.

@Nana-EC Nana-EC requested review from a team and removed request for mattp-swirldslabs July 23, 2025 14:56
Copy link

codecov bot commented Jul 23, 2025

Codecov Report

All 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     
Files with missing lines Coverage Δ Complexity Δ
...ock/simulator/grpc/impl/PublishStreamObserver.java 84.37% <100.00%> (+2.55%) 6.00 <0.00> (-1.00) ⬆️
...mulator/startup/impl/SimulatorStartupDataImpl.java 88.46% <100.00%> (+3.46%) 8.00 <0.00> (-4.00) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Nana-EC Nana-EC modified the milestones: 0.15.0, 0.16.0 Jul 30, 2025
@AlfredoG87 AlfredoG87 modified the milestones: 0.16.0, 0.17.0 Aug 13, 2025
@AlfredoG87 AlfredoG87 modified the milestones: 0.17.0, 0.18.0 Aug 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Block Node Issues/PR related to the Block Node. Feature Enhancement Enhancing an existing feature driven by business requirements. Typically backwards compatible. Protobuf Publisher Plugin Issue related to Publisher Plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove BlockAcknowledgement.block_root_hash from Publisher API
3 participants