* uses Option<u64> for SlotMeta.last_index (#21775)
SlotMeta.last_index may be unknown and current code is using u64::MAX to
indicate that:
https://github.com/solana-labs/solana/blob/6c108c8fc/ledger/src/blockstore_meta.rs#L169-L174
This lacks type-safety and can introduce bugs if not always checked for
Several instances of slot_meta.last_index + 1 are also subject to
overflow.
This commit updates the type to Option<u64>. Backward compatibility is
maintained by customizing serde serialize/deserialize implementations.
(cherry picked from commit e08139f949)
# Conflicts:
# core/src/repair_generic_traversal.rs
# ledger/src/blockstore.rs
# ledger/src/blockstore_meta.rs
* removes mergify merge conflicts
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
* adds back ErasureMeta::first_coding_index field (#21623)
https://github.com/solana-labs/solana/pull/16646
removed first_coding_index since the field is currently redundant and
always equal to fec_set_index.
However, with upcoming changes to erasure coding schema, this will no
longer be the same as fec_set_index and so requires a separate field to
represent.
(cherry picked from commit 49ba09b333)
# Conflicts:
# ledger/src/blockstore.rs
* removes mergify merge conflicts
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Problem
Blockstore currently removes erasure shreds if the data shreds are
successfully recovered on insert, which is an issue if we want to
serve coding shreds over repair.
Summary of Changes
This diff keeps all coding shreds even on successful recovery and
changes change the signature of prev_inserted_codes to immutable
reference to ensure its immunity.
Fixes#20968
(cherry picked from commit 3aa49e2c69)
Co-authored-by: Yueh-Hsuan Chiang <93241502+yhchiang-sol@users.noreply.github.com>
* Clean up before credits_auto_rewind
* Use `=` intead of `|=` for mutable bool
(cherry picked from commit 545c97f903)
Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
* Update ping to transfer to self, with rotating amount (#22657)
* Update ping to transfer to self, with rotating amount
* Remove balance check
(cherry picked from commit 90689585ef)
# Conflicts:
# cli/src/cluster_query.rs
* Fix api diff
Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
Co-authored-by: Tyera Eulberg <tyera@solana.com>
* Set the correct root in block commitment cache initialization
* clean up test
* bump
(cherry picked from commit d9c259a231)
# Conflicts:
# replica-node/src/replica_node.rs
Co-authored-by: Justin Starry <justin@solana.com>
* spl-associated-token-account: Add feature for new program (#22648)
* spl-associated-token-account: Add feature for new program
* Address feedback
(cherry picked from commit fc21af4e6e)
# Conflicts:
# runtime/src/bank.rs
# runtime/src/lib.rs
# sdk/src/feature_set.rs
* Fix merge conflicts
Co-authored-by: Jon Cinque <jon.cinque@gmail.com>
* improves sigverify discard_excess_packets performance (#22577)
As shown by the added benchmark, current code does worse if there is a
spam address plus a lot of unique addresses.
on current master:
test bench_packet_discard_many_senders ... bench: 1,997,960 ns/iter (+/- 103,715)
test bench_packet_discard_mixed_senders ... bench: 14,256,116 ns/iter (+/- 534,865)
test bench_packet_discard_single_sender ... bench: 1,306,809 ns/iter (+/- 61,992)
with this commit:
test bench_packet_discard_many_senders ... bench: 1,644,025 ns/iter (+/- 83,715)
test bench_packet_discard_mixed_senders ... bench: 1,089,789 ns/iter (+/- 86,324)
test bench_packet_discard_single_sender ... bench: 955,234 ns/iter (+/- 55,953)
(cherry picked from commit dcf44d2523)
# Conflicts:
# core/benches/sigverify_stage.rs
# core/src/sigverify_stage.rs
* removes mergify merge conflicts
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
* discard time histogram
* closer to the if
* update
(cherry picked from commit e616a7ebfc)
# Conflicts:
# core/src/sigverify_stage.rs
Co-authored-by: anatoly yakovenko <anatoly@solana.com>
* consolidate execute timings to a common module
* Add execute metrics
* Add metrics for executor creation
* Use saturating_add_assign macro
Co-authored-by: Trent Nelson <trent@solana.com>
Co-authored-by: Carl Lin <carl@solana.com>
avoid bad performance of remove(0) for a single sender
(cherry picked from commit 49443406fd)
# Conflicts:
# core/src/sigverify_stage.rs
Co-authored-by: sakridge <sakridge@gmail.com>
* implements copy-on-write for staked-nodes (#19090)
Bank::staked_nodes and Bank::epoch_staked_nodes redundantly clone
staked-nodes HashMap even though an immutable reference will suffice:
https://github.com/solana-labs/solana/blob/a9014cece/runtime/src/vote_account.rs#L77
This commit implements copy-on-write semantics for staked-nodes by
wrapping the underlying HashMap in Arc<...>.
(cherry picked from commit f302774cf7)
# Conflicts:
# runtime/src/bank.rs
# runtime/src/stakes.rs
# runtime/src/vote_account.rs
* removes backport merge conflicts
Co-authored-by: behzad nouri <behzadnouri@gmail.com>