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

patches bug where the 1st coding shred is not inserted into blockstore#25916

Merged
behzadnouri merged 1 commit intosolana-labs:masterfrom
behzadnouri:insert-1st-code
Jun 16, 2022
Merged

patches bug where the 1st coding shred is not inserted into blockstore#25916
behzadnouri merged 1 commit intosolana-labs:masterfrom
behzadnouri:insert-1st-code

Conversation

@behzadnouri
Copy link
Copy Markdown
Contributor

Problem

StandardBroadcastRun::insert skips 1st shred with index zero because
the 1st data shred is inserted synchronously:
https://github.com/solana-labs/solana/blob/53695ecd2/core/src/broadcast_stage/standard_broadcast_run.rs#L239-L246
https://github.com/solana-labs/solana/blob/53695ecd2/core/src/broadcast_stage/standard_broadcast_run.rs#L334-L339

#7481
which added this code was not inserting coding shreds into blockstore.
Starting with
#8899
coding shreds are inserted into blockstore as well as data shreds, but
the insert logic erroneously skips first coding shred because it does
not check if shred is code or data.

Summary of Changes

  • check if the shred is code or data.

StandardBroadcastRun::insert skips 1st shred with index zero because
the 1st *data* shred is inserted synchronously:
https://github.com/solana-labs/solana/blob/53695ecd2/core/src/broadcast_stage/standard_broadcast_run.rs#L239-L246
https://github.com/solana-labs/solana/blob/53695ecd2/core/src/broadcast_stage/standard_broadcast_run.rs#L334-L339

solana-labs#7481
which added this code was not inserting coding shreds into blockstore.
Starting with
solana-labs#8899
coding shreds are inserted into blockstore as well as data shreds, but
the insert logic erroneously skips first coding shred because it does
not check if shred is code or data.
} else {
shreds.to_vec()
};
let mut shreds = Arc::try_unwrap(shreds).unwrap_or_else(|shreds| (*shreds).clone());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sneaky little try_unwrap() optimization here 😃 . Should only work if the broadcast finishes with its version of these shreds before we insert here.

@behzadnouri behzadnouri merged commit eacb918 into solana-labs:master Jun 16, 2022
@behzadnouri behzadnouri deleted the insert-1st-code branch June 16, 2022 13:59
mergify Bot pushed a commit that referenced this pull request Jun 16, 2022
#25916)

StandardBroadcastRun::insert skips 1st shred with index zero because
the 1st *data* shred is inserted synchronously:
https://github.com/solana-labs/solana/blob/53695ecd2/core/src/broadcast_stage/standard_broadcast_run.rs#L239-L246
https://github.com/solana-labs/solana/blob/53695ecd2/core/src/broadcast_stage/standard_broadcast_run.rs#L334-L339

#7481
which added this code was not inserting coding shreds into blockstore.
Starting with
#8899
coding shreds are inserted into blockstore as well as data shreds, but
the insert logic erroneously skips first coding shred because it does
not check if shred is code or data.

(cherry picked from commit eacb918)
mergify Bot pushed a commit that referenced this pull request Jun 16, 2022
#25916)

StandardBroadcastRun::insert skips 1st shred with index zero because
the 1st *data* shred is inserted synchronously:
https://github.com/solana-labs/solana/blob/53695ecd2/core/src/broadcast_stage/standard_broadcast_run.rs#L239-L246
https://github.com/solana-labs/solana/blob/53695ecd2/core/src/broadcast_stage/standard_broadcast_run.rs#L334-L339

#7481
which added this code was not inserting coding shreds into blockstore.
Starting with
#8899
coding shreds are inserted into blockstore as well as data shreds, but
the insert logic erroneously skips first coding shred because it does
not check if shred is code or data.

(cherry picked from commit eacb918)
mergify Bot added a commit that referenced this pull request Jun 16, 2022
#25916) (#26005)

StandardBroadcastRun::insert skips 1st shred with index zero because
the 1st *data* shred is inserted synchronously:
https://github.com/solana-labs/solana/blob/53695ecd2/core/src/broadcast_stage/standard_broadcast_run.rs#L239-L246
https://github.com/solana-labs/solana/blob/53695ecd2/core/src/broadcast_stage/standard_broadcast_run.rs#L334-L339

#7481
which added this code was not inserting coding shreds into blockstore.
Starting with
#8899
coding shreds are inserted into blockstore as well as data shreds, but
the insert logic erroneously skips first coding shred because it does
not check if shred is code or data.

(cherry picked from commit eacb918)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
mergify Bot added a commit that referenced this pull request Jun 16, 2022
#25916) (#26006)

StandardBroadcastRun::insert skips 1st shred with index zero because
the 1st *data* shred is inserted synchronously:
https://github.com/solana-labs/solana/blob/53695ecd2/core/src/broadcast_stage/standard_broadcast_run.rs#L239-L246
https://github.com/solana-labs/solana/blob/53695ecd2/core/src/broadcast_stage/standard_broadcast_run.rs#L334-L339

#7481
which added this code was not inserting coding shreds into blockstore.
Starting with
#8899
coding shreds are inserted into blockstore as well as data shreds, but
the insert logic erroneously skips first coding shred because it does
not check if shred is code or data.

(cherry picked from commit eacb918)

Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants