split_gossip_messages:
https://github.com/solana-labs/solana/blob/a97c04b40/core/src/cluster_info.rs#L1536-L1574
splits crds-values into chunks to fit into a gossip packet. However it is
using a global upper-bound for the header-size across all protocols:
https://github.com/solana-labs/solana/blob/a97c04b40/core/src/cluster_info.rs#L90-L93
This can be wasteful as the specific gossip protocol can have smaller
header than this upper-bound (e.g. Protocol::PushMessage is 170 bytes
smaller). Adding more crds-values in one gossip packet can avoid the
overheads of separate packets and reduce total number of bytes sent over
the wire.
This commit updates the splitting function to take a max-chunk-size
argument. At call-site, this value is set to the size of the protocol
which the values are sent over.
(cherry picked from commit 5e8490ab9d)
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
In several places in gossip code, the entire crds table is scanned only
to filter out nodes' contact infos. Currently on mainnet, crds table is
of size ~70k, while there are only ~470 nodes. So the full table scan is
inefficient. Instead we may maintain an index of only nodes' contact
infos.
(cherry picked from commit cbea9ebc34)
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
The --rpc-pubsub-enable-vote-subscription flag may be used to enable it.
The current vote subscription is problematic because it emits a
notification for *every* vote, so hundreds a second in a real cluster.
Critically it's also missing information about *who* is voting,
rendering all those notifications practically useless.
Until these two issues can be resolved, the vote subscription is not
much more than a potential DoS vector.
(cherry picked from commit 5d72e52ad0)
Co-authored-by: Michael Vines <mvines@gmail.com>
* ip-echo-server: Name the header length magic number
(cherry picked from commit aab5f24518)
* ip-echo-server: Add helper to compute reply length
(cherry picked from commit 7481ba5618)
* ip-echo-server: Limit socket read to expected reply length
(cherry picked from commit d2cfeb31b9)
Co-authored-by: Trent Nelson <trent@solana.com>
* docs: Wrap RPC `getAccountInfo` at 80 char
(cherry picked from commit 1d7c00c915)
* docs: Consistently use "jsonParsed" param for RPC `getAccountInfo`
(cherry picked from commit 87924c7111)
* docs: Consistent used of "jsonParsed" throughout RPC reference
(cherry picked from commit fb815294b3)
Co-authored-by: Trent Nelson <trent@solana.com>
* Test for different ancestors with mismatch bank hash
* Test cleanup
* Remove nondeterministic ancestor check
* Update timestamp bounding feature key
* Update design doc
* Filter recent_timestamps to nodes voting within the last epoch
Co-authored-by: Stephen Akridge <sakridge@gmail.com>
Co-authored-by: Stephen Akridge <sakridge@gmail.com>
Packet::from_data is ignoring serialization errors:
https://github.com/solana-labs/solana/blob/d08c3232e/sdk/src/packet.rs#L42-L48
This is likely never useful as the packet will be sent over the wire
taking bandwidth but at the receiving end will either fail to
deserialize or it will be invalid.
This commit will propagate the errors out of the function to the
call-site, allowing the call-site to handle the error.
(cherry picked from commit 73ac104df2)
Co-authored-by: behzad nouri <behzadnouri@gmail.com>