* Reject close of active vote accounts (#22651)
* 10461 Reject close of vote accounts unless it earned no credits in the previous epoch. This is checked by comparing current epoch (from clock sysvar) with the most recent epoch with credits in vote state.
(cherry picked from commit 75563f6c7b)
# Conflicts:
# programs/vote/src/vote_processor.rs
# programs/vote/src/vote_state/mod.rs
# runtime/src/bank.rs
# sdk/program/src/instruction.rs
# sdk/program/src/program_error.rs
# storage-proto/proto/transaction_by_addr.proto
# storage-proto/src/convert.rs
* Resolve merge conflicts
* lint
* Clippy cleanup
* Add import to test module
* remove vote processor
* Update test_abi_digest hash
* cleanup
Co-authored-by: Will Hickey <csu_hickey@yahoo.com>
Co-authored-by: Will Hickey <will.hickey@solana.com>
* tracks erasure coding shreds' indices explicitly (#21822)
The indices for erasure coding shreds are tied to data shreds:
https://github.com/solana-labs/solana/blob/90f41fd9b/ledger/src/shred.rs#L921
However with the upcoming changes to erasure schema, there will be more
erasure coding shreds than data shreds and we can no longer infer coding
shreds indices from data shreds.
The commit adds constructs to track coding shreds indices explicitly.
(cherry picked from commit 65d59f4ef0)
# Conflicts:
# core/benches/retransmit_stage.rs
# core/benches/shredder.rs
# core/src/broadcast_stage/broadcast_duplicates_run.rs
# core/src/broadcast_stage/broadcast_fake_shreds_run.rs
# core/src/broadcast_stage/fail_entry_verification_broadcast_run.rs
# core/src/window_service.rs
# ledger/src/blockstore.rs
# ledger/src/shred.rs
# ledger/tests/shred.rs
* removes mergify merge conflicts
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
* removes next_shred_index from return value of entries to shreds api (#21961)
next-shred-index is already readily available from returned data shreds.
The commit simplifies the api for upcoming changes to erasure coding
schema which will require explicit tracking of indices for coding shreds
as well as data shreds.
(cherry picked from commit 89d66c3210)
# Conflicts:
# core/benches/shredder.rs
# core/src/broadcast_stage/broadcast_duplicates_run.rs
# core/src/broadcast_stage/broadcast_fake_shreds_run.rs
# core/src/broadcast_stage/fail_entry_verification_broadcast_run.rs
# core/src/broadcast_stage/standard_broadcast_run.rs
# gossip/src/duplicate_shred.rs
# ledger/src/blockstore.rs
# ledger/src/shred.rs
# ledger/tests/shred.rs
* removes mergify merge conflicts
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
* uses Option<Slot> for SlotMeta.parent_slot (#21808)
SlotMeta.parent_slot for the head of a detached chain of slots is
unknown and that is indicated by u64::MAX which lacks type-safety:
https://github.com/solana-labs/solana/blob/6c108c8fc/ledger/src/blockstore_meta.rs#L203-L205
The commit changes the type to Option<Slot>. Backward compatibility is
maintained by customizing serde serialize/deserialize implementations.
(cherry picked from commit 8d980f07ba)
# Conflicts:
# core/src/repair_generic_traversal.rs
# ledger-tool/src/main.rs
# ledger/src/blockstore.rs
* removes mergify merge conflicts
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
* 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>