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

blockstore: store first received coding shred index in ErasureMeta #961

Merged
merged 2 commits into from
Apr 22, 2024

Conversation

AshwinSekar
Copy link

Reuse the __unused_size : usize field in ErasureMeta to store the index of the first received coding shred for the FEC set.

Split from #835
Contributes to solana-labs#34897

Copy link

mergify bot commented Apr 22, 2024

Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis.

@codecov-commenter
Copy link

codecov-commenter commented Apr 22, 2024

Codecov Report

Attention: Patch coverage is 88.46154% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 81.8%. Comparing base (14d6c79) to head (bf5a23a).
Report is 15 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master     #961     +/-   ##
=========================================
- Coverage    81.9%    81.8%   -0.1%     
=========================================
  Files         853      853             
  Lines      231797   231824     +27     
=========================================
+ Hits       189845   189852      +7     
- Misses      41952    41972     +20     

@@ -125,9 +125,8 @@ pub struct ErasureMeta {
set_index: u64,
/// First coding index in the FEC set
first_coding_index: u64,
/// Size of shards in this erasure set
#[serde(rename = "size")]
__unused_size: usize,

Choose a reason for hiding this comment

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

I think it is safe to change type from usize to u64 for consistency and fewer type-casts.
usize is serialized as u64 anyways:
https://github.com/serde-rs/serde/blob/f6623a365/serde/src/ser/impls.rs#L28

@AshwinSekar AshwinSekar merged commit f133697 into anza-xyz:master Apr 22, 2024
38 checks passed
mergify bot pushed a commit that referenced this pull request Apr 22, 2024
)

* blockstore: store first received coding shred index in ErasureMeta

* pr feedback: use u64 instead of usize

(cherry picked from commit f133697)

# Conflicts:
#	ledger/src/blockstore_meta.rs
@AshwinSekar AshwinSekar deleted the erasure-meta-index branch April 22, 2024 23:23
AshwinSekar added a commit that referenced this pull request Apr 23, 2024
)

* blockstore: store first received coding shred index in ErasureMeta

* pr feedback: use u64 instead of usize

(cherry picked from commit f133697)

# Conflicts:
#	ledger/src/blockstore_meta.rs
AshwinSekar added a commit that referenced this pull request Apr 23, 2024
…Meta (backport of #961) (#981)

* blockstore: store first received coding shred index in ErasureMeta (#961)

* blockstore: store first received coding shred index in ErasureMeta

* pr feedback: use u64 instead of usize

(cherry picked from commit f133697)

# Conflicts:
#	ledger/src/blockstore_meta.rs

* fix blockstore_meta conflict

---------

Co-authored-by: Ashwin Sekar <ashwin@anza.xyz>
Co-authored-by: Ashwin Sekar <ashwin@solana.com>
anwayde pushed a commit to firedancer-io/agave that referenced this pull request Jul 23, 2024
…Meta (backport of anza-xyz#961) (anza-xyz#981)

* blockstore: store first received coding shred index in ErasureMeta (anza-xyz#961)

* blockstore: store first received coding shred index in ErasureMeta

* pr feedback: use u64 instead of usize

(cherry picked from commit f133697)

# Conflicts:
#	ledger/src/blockstore_meta.rs

* fix blockstore_meta conflict

---------

Co-authored-by: Ashwin Sekar <ashwin@anza.xyz>
Co-authored-by: Ashwin Sekar <ashwin@solana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants