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

fix: end exclusive parse namespace end share range #2208

Merged
merged 5 commits into from
Aug 4, 2023

Conversation

rach-id
Copy link
Member

@rach-id rach-id commented Aug 3, 2023

Fixes the range to support end exclusive share ranges

@rach-id rach-id added the bug Something isn't working label Aug 3, 2023
@rach-id rach-id self-assigned this Aug 3, 2023
@MSevey MSevey requested a review from a team August 3, 2023 17:06
@codecov-commenter
Copy link

Codecov Report

Merging #2208 (7c66e61) into main (b3b8611) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #2208   +/-   ##
=======================================
  Coverage   24.86%   24.86%           
=======================================
  Files         127      127           
  Lines       14326    14326           
=======================================
  Hits         3562     3562           
  Misses      10397    10397           
  Partials      367      367           
Files Changed Coverage Δ
pkg/proof/querier.go 21.50% <100.00%> (ø)

@@ -133,7 +133,7 @@ func ParseNamespace(rawShares []shares.Share, startShare, endShare int) (appns.N
return appns.Namespace{}, fmt.Errorf("end share %d cannot be lower than starting share %d", endShare, startShare)
}

if endShare >= len(rawShares) {
if endShare > len(rawShares) {
Copy link
Member Author

Choose a reason for hiding this comment

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

[note to reviewers]
Since the share ranges are range exclusive, then they can be == len(shares). If not, then the last share will never be proved

Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

One blocking question

pkg/proof/proof_test.go Outdated Show resolved Hide resolved
pkg/proof/proof_test.go Outdated Show resolved Hide resolved
pkg/proof/proof_test.go Outdated Show resolved Hide resolved
pkg/proof/proof_test.go Outdated Show resolved Hide resolved
@MSevey MSevey requested a review from a team August 3, 2023 19:51
@rach-id rach-id merged commit 0c55a6e into celestiaorg:main Aug 4, 2023
20 checks passed
@rootulp rootulp added the backport:v1.x PR will be backported automatically to the v1.x branch upon merging label May 16, 2024
mergify bot pushed a commit that referenced this pull request May 16, 2024
<!--
Please read and fill out this form before submitting your PR.

Please make sure you have reviewed our contributors guide before
submitting your
first PR.
-->

## Overview

Fixes the range to support end exclusive share ranges

## Checklist

<!--
Please complete the checklist to ensure that the PR is ready to be
reviewed.

IMPORTANT:
PRs should be left in Draft until the below checklist is completed.
-->

- [ ] New and updated code has appropriate documentation
- [ ] New and updated code has new and/or updated testing
- [ ] Required CI checks are passing
- [ ] Visual proof for any user facing features like CLI or
documentation updates
- [ ] Linked issues closed with keywords

---------

Co-authored-by: Rootul P <[email protected]>
(cherry picked from commit 0c55a6e)

# Conflicts:
#	pkg/proof/proof_test.go
rootulp added a commit that referenced this pull request May 16, 2024
…3491)

This is an automatic backport of pull request #2208 done by
[Mergify](https://mergify.com).

Motivated by this [Slack
thread](https://celestia-team.slack.com/archives/C03MP6DPLAD/p1715891011859219).
It seems like we forgot to backport this fix. cc: @rach-id

---------

Co-authored-by: CHAMI Rachid <[email protected]>
Co-authored-by: Rootul Patel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:v1.x PR will be backported automatically to the v1.x branch upon merging bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants