Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

uses enum for shred type (backport #21333)#22147

Merged
mergify[bot] merged 3 commits intov1.8from
mergify/bp/v1.8/pr-21333
Dec 31, 2021
Merged

uses enum for shred type (backport #21333)#22147
mergify[bot] merged 3 commits intov1.8from
mergify/bp/v1.8/pr-21333

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Dec 28, 2021

This is an automatic backport of pull request #21333 done by Mergify.
Cherry-pick of 57057f8 has failed:

On branch mergify/bp/v1.8/pr-21333
Your branch is up to date with 'origin/v1.8'.

You are currently cherry-picking commit 57057f8d3.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   Cargo.lock
	modified:   core/src/window_service.rs
	modified:   gossip/src/duplicate_shred.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   core/src/retransmit_stage.rs
	both modified:   gossip/src/cluster_info.rs
	both modified:   ledger/Cargo.toml
	both modified:   ledger/src/blockstore.rs
	both modified:   ledger/src/shred.rs

Cherry-pick of 48dfdfb has failed:

On branch mergify/bp/v1.8/pr-21333
Your branch is ahead of 'origin/v1.8' by 1 commit.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 48dfdfb4d.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   core/src/window_service.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   ledger/src/blockstore.rs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

@mergify mergify Bot added the conflicts label Dec 28, 2021
@mergify mergify Bot added automerge Merge this Pull Request automatically once CI passes and removed automerge Merge this Pull Request automatically once CI passes labels Dec 28, 2021
@sakridge
Copy link
Copy Markdown
Contributor

why do we need this in 1.8?

@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Dec 28, 2021

automerge label removed due to a CI failure

@behzadnouri
Copy link
Copy Markdown
Contributor

why do we need this in 1.8?

Cluster needs to be fully on #21623 before I can safely push follow up changes; and so I am back-porting earlier changes that #21623 either depends on or will merge conflict.

@sakridge
Copy link
Copy Markdown
Contributor

None of those changes sound like they should be in 1.8 either? Why wouldn’t we test on 1.9 and then wait for mainnet to be on that version?

@behzadnouri
Copy link
Copy Markdown
Contributor

None of those changes sound like they should be in 1.8 either? Why wouldn’t we test on 1.9 and then wait for mainnet to be on that version?

Carl wanted the #22141 and #22139 backports so that backport of #20873 would be easier. Those changes are from back in August.

The other backports are related to shreds/erasure-coding/blockstore, which are working towards implementing:
https://discord.com/channels/428295358100013066/478692221441409024/901255427369627678

which will then generate more coding shreds than data shreds. Because there are more coding shreds than data shreds, the indices of coding shreds no longer align with data shreds and we need for example #21600 to track position of coding shreds explicitly and #21623 to track first coding index.

It will cause backward incompatibility issue if a node running master or v1.9 becomes the leader and generates more coding shreds than the data shreds, whereas the cluster does not yet have above patches to be able to digest these shreds. So we need these backports to v1.8 so that master/v1.9 is backward compatible with mainnet.

@mergify mergify Bot added the automerge Merge this Pull Request automatically once CI passes label Dec 30, 2021
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Dec 30, 2021

automerge label removed due to a CI failure

@mergify mergify Bot added automerge Merge this Pull Request automatically once CI passes and removed automerge Merge this Pull Request automatically once CI passes labels Dec 30, 2021
@behzadnouri behzadnouri force-pushed the mergify/bp/v1.8/pr-21333 branch from 97a809d to eafe111 Compare December 30, 2021 20:05
@solana-grimes
Copy link
Copy Markdown
Contributor

😱 New commits were pushed while the automerge label was present.

@solana-grimes solana-grimes removed the automerge Merge this Pull Request automatically once CI passes label Dec 30, 2021
@mergify mergify Bot added the automerge Merge this Pull Request automatically once CI passes label Dec 30, 2021
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Dec 30, 2021

automerge label removed due to a CI failure

@mergify mergify Bot added automerge Merge this Pull Request automatically once CI passes and removed automerge Merge this Pull Request automatically once CI passes labels Dec 30, 2021
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Dec 31, 2021

automerge label removed due to a CI failure

@mergify mergify Bot removed the automerge Merge this Pull Request automatically once CI passes label Dec 31, 2021
@behzadnouri
Copy link
Copy Markdown
Contributor

@Mergifyio rebase

Current code is using u8 which does not have any type-safety and can
contain invalid values:
https://github.com/solana-labs/solana/blob/66fa062f1/ledger/src/shred.rs#L167

Checks for invalid shred-types are scattered through the code:
https://github.com/solana-labs/solana/blob/66fa062f1/ledger/src/blockstore.rs#L849-L851
https://github.com/solana-labs/solana/blob/66fa062f1/ledger/src/shred.rs#L346-L348

The commit uses enum for shred type with #[repr(u8)]. Backward
compatibility is maintained by implementing Serialize and Deserialize
compatible with u8, and adding a test to assert that.

(cherry picked from commit 57057f8)

# Conflicts:
#	core/src/retransmit_stage.rs
#	gossip/src/cluster_info.rs
#	ledger/Cargo.toml
#	ledger/src/blockstore.rs
#	ledger/src/shred.rs
(cherry picked from commit 48dfdfb)

# Conflicts:
#	ledger/src/blockstore.rs
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Dec 31, 2021

rebase

✅ Branch has been successfully rebased

@jstarry jstarry force-pushed the mergify/bp/v1.8/pr-21333 branch from eafe111 to c3b4b11 Compare December 31, 2021 00:22
@mergify mergify Bot added the automerge Merge this Pull Request automatically once CI passes label Dec 31, 2021
@mergify
Copy link
Copy Markdown
Contributor Author

mergify Bot commented Dec 31, 2021

automerge label removed due to a CI failure

@mergify mergify Bot added automerge Merge this Pull Request automatically once CI passes and removed automerge Merge this Pull Request automatically once CI passes labels Dec 31, 2021
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 31, 2021

Codecov Report

Merging #22147 (c3b4b11) into v1.8 (ec970f9) will decrease coverage by 0.0%.
The diff coverage is 96.5%.

@@            Coverage Diff            @@
##             v1.8   #22147     +/-   ##
=========================================
- Coverage    81.5%    81.5%   -0.1%     
=========================================
  Files         459      459             
  Lines      130934   130957     +23     
=========================================
+ Hits       106835   106843      +8     
- Misses      24099    24114     +15     

@mergify mergify Bot merged commit a53dd61 into v1.8 Dec 31, 2021
@mergify mergify Bot deleted the mergify/bp/v1.8/pr-21333 branch December 31, 2021 16:47
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2022

This PR has been automatically locked since there has not been any activity in past 14 days after it was merged.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

automerge Merge this Pull Request automatically once CI passes conflicts locked PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants