Skip to content

fix: Adjust block access service to be correct without workarounds #1147

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

Merged
merged 1 commit into from
May 15, 2025

Conversation

jsync-swirlds
Copy link
Contributor

@jsync-swirlds jsync-swirlds commented May 14, 2025

Reviewer Notes

  • Modified the proto definition to remove unverified and prevent calling with both latest and a block number.
  • Added an "invalid" response and removed the verified/unverified responses
  • Removed unnecessary prefixes in the response enum names
  • Removed check for both fields set in Java (it's no longer possible).
  • Fixed up all references
  • Removed tests that set both fields as it's no longer possible (the last one set is the only one set).

Related Issue(s)

Fixes #1148

@jsync-swirlds jsync-swirlds added this to the 0.11.0 milestone May 14, 2025
@jsync-swirlds jsync-swirlds self-assigned this May 14, 2025
@jsync-swirlds jsync-swirlds added Bug A error that causes the feature to behave differently than what was expected based on design docs Block Node Issues/PR related to the Block Node. labels May 14, 2025
@jsync-swirlds jsync-swirlds force-pushed the block-access-proto-fix branch 2 times, most recently from 19f50f4 to c045b0f Compare May 14, 2025 23:34
@jsync-swirlds jsync-swirlds marked this pull request as ready for review May 14, 2025 23:34
@jsync-swirlds jsync-swirlds requested review from a team as code owners May 14, 2025 23:34
@jsync-swirlds jsync-swirlds force-pushed the block-access-proto-fix branch from c045b0f to 1cfcf70 Compare May 15, 2025 01:11
Copy link
Contributor

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

1st pass looks looks good on simplifying the logic

@jsync-swirlds jsync-swirlds force-pushed the block-access-proto-fix branch from 1cfcf70 to 0f0a1c9 Compare May 15, 2025 16:10
* Modified the proto definition to remove unverified and prevent calling with both latest and a block number.
* Added an "invalid" response and removed the verified/unverified responses
* Removed unnecessary prefixes in the response enum names
* Removed check for both fields set in Java (it's no longer possible).
* Fixed up all references
* Removed tests that set both fields as it's no longer possible (the last one set is the only one set).

Signed-off-by: Joseph S <121976561+jsync-swirlds@users.noreply.github.com>
@jsync-swirlds jsync-swirlds force-pushed the block-access-proto-fix branch from 0f0a1c9 to 9feb19c Compare May 15, 2025 16:13
Copy link
Contributor

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

LG

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

fun fact:

you can actually request the latest block either way:

{
    "retrieve_latest": true
}
{
    "block_number": "18446744073709551615"
}

@jsync-swirlds
Copy link
Contributor Author

jsync-swirlds commented May 15, 2025

LGTM

fun fact:

you can actually request the latest block either way:

Yes, I thought it might smooth the change if either works. We can always make the small change so it only works with the flag set in a later update.

@jsync-swirlds jsync-swirlds merged commit 5598d82 into main May 15, 2025
14 of 15 checks passed
@jsync-swirlds jsync-swirlds deleted the block-access-proto-fix branch May 15, 2025 22:29
Copy link

codecov bot commented May 15, 2025

Codecov Report

Attention: Patch coverage is 45.45455% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../node/access/service/BlockAccessServicePlugin.java 45.45% 6 Missing ⚠️

❌ Your patch status has failed because the patch coverage (45.45%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

@@             Coverage Diff              @@
##               main    #1147      +/-   ##
============================================
+ Coverage     84.48%   84.66%   +0.18%     
+ Complexity      919      915       -4     
============================================
  Files           104      104              
  Lines          3725     3717       -8     
  Branches        400      398       -2     
============================================
  Hits           3147     3147              
+ Misses          427      418       -9     
- Partials        151      152       +1     
Files with missing lines Coverage Δ Complexity Δ
.../node/access/service/BlockAccessServicePlugin.java 77.58% <45.45%> (-4.24%) 8.00 <0.00> (-3.00)

... and 2 files with indirect coverage changes

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

AlfredoG87 pushed a commit that referenced this pull request May 15, 2025
…1147)

Signed-off-by: Joseph S <121976561+jsync-swirlds@users.noreply.github.com>
AlfredoG87 pushed a commit that referenced this pull request May 15, 2025
…1147)

Signed-off-by: Joseph S <121976561+jsync-swirlds@users.noreply.github.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
AlfredoG87 added a commit that referenced this pull request May 16, 2025
…and final RC version. (#1153)

Signed-off-by: Joseph S <121976561+jsync-swirlds@users.noreply.github.com>
Signed-off-by: Alfredo Gutierrez Grajeda <alfredo@hashgraph.com>
Co-authored-by: Joseph S <121976561+jsync-swirlds@users.noreply.github.com>
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. Bug A error that causes the feature to behave differently than what was expected based on design docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling of "latest" and "last block number" in block access API is not entirely correct
3 participants