remove disable_block_production_forwarding cli flag (#2687)
(cherry picked from commit df892c4241)
Co-authored-by: Andrew Fitzgerald <apfitzge@gmail.com>
* customizes override logic for gossip ContactInfo (#2579)
If there are two running instances of the same node, we want the
ContactInfo with more recent start time to be propagated through
gossip regardless of wallclocks.
The commit adds custom override logic for ContactInfo to first compare
by outset timestamp.
* updates ContactInfo.outset when hot-swapping identity (#2613)
When hot-swapping identity, ContactInfo.outset should be updated so that
the new ContactInfo overrides older node with the same pubkey.
* patches bug causing false duplicate nodes error (#2666)
The bootstrap code during the validator start pushes a contact-info with
more recent timestamp to gossip. If the node is staked the contact-info
lingers in gossip causing false duplicate node instances when the fully
initialized node joins gossip later on.
The commit refreshes the timestamp on contact-info so that it overrides
the one pushed by bootstrap and avoid false duplicates error.
---------
Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Bound default value for thread pool args (#2599)
The thread pool argument trait declares min/max/default functions. These
functions are then called to provide a default as well as validation
that any user set value on the CLI is within [min(), max()].
Some of the default values are fixed numbers. On a machine with few
enough cores, the default could exceed the max. This would raise an
error when the argument is parsed. This can be worked around by the user
specifying a lower value; however, these flags are still very much
experimental and intentionally hidden.
So, make the default value that is passed to CLAP the min of default()
and max(). This will adjust the default on low core count machines while
leaving settings on sufficient machines untouched.
(cherry picked from commit 094a63476c)
Co-authored-by: steviez <steven@anza.xyz>
Deprecate --rocksdb-shred-compaction fifo (#1882)
The fifo compaction option was originally added to mitigate write
stalls that were occurring with level compaction. Since fifo was
introduced, the level compaction implementation has been optimized
to reduce I/O amplification. With these improvements, level and fifo
are comparable and sticking with level only simplifies things.
For now, only a deprecation warning will be printed. In the next
release branch (2.1.0), specifying fifo will be an error
(cherry picked from commit e15e235ec4)
Co-authored-by: steviez <steven@anza.xyz>
Use num_partitions to find specific stake rewards in partitions (#1677)
* Add helper to find and filter rewards from a slot
* Check feature enabled for desired epoch
* Refactor existing rewards code to support vote-rewards after activation
* Append stake rewards from partitions
* Remove feature deactivation from TestValidator
* Improve comments
* Add comment about retaining feature activation slot logic
* Add custom error and use in getInflationReward
* Review nit
(cherry picked from commit 0496b06f89)
Co-authored-by: Tyera <tyera@anza.xyz>
* file based storages
* pr feedback
* add comments
* add tests for buffered reader and file reader
* fix windows clippy
* pr: update tests for jeff comments
* pr feedback
* fix a bug - read at least default min bytes
* Revert "fix a bug - read at least default min bytes"
This reverts commit 52ccd8e022dd8a047596b95b4ab2abc91c7c983c.
* add test coverages flush, reset, reopen functions for append_vec.rs
* one more dead code
* renames
* renames
* renames
* wee wah wee wah grammar police
* rename
* add debug assert
* use const
* const
* reorder
* reorders and renames
---------
Co-authored-by: HaoranYi <haoran.yi@solana.com>
* use rate limit on connectings
use rate limit on connectings; missing file
* Change connection rate limit to 8/min instead of 4/s
* Addressed some feedback from Trent
* removed some comments
* fix test failures which are opening connections more frequently
* moved the flag up
* turn off rate limiting to debug CI
* Fix CI test failures
* differentiate of the two throttling cases in stats: across connections or per ip addr
* fmt issues
* Addressed some feedback from Trent
* Added unit tests
Cleanup connection cache rate limiter if exceeding certain threshold
missing files
CONNECITON_RATE_LIMITER_CLEANUP_THRESHOLD to 100_000
clippy issue
clippy issue
sort crates
* revert Cargo.lock changes
* Addressed some feedback from Pankaj
By moving the args to the deprecated list, a warning will now be
emitted if any of the args are passed. Additionally, moving them
reduces clutter a bit.
The IP echo server currently spins up a worker thread for every thread
on the machine. Observing some data for nodes,
- MNB validators and RPC nodes look to get several hundred of these
requests per day
- MNB entrypoint nodes look to get 2-3 requests per second on average
In both instances, the current threadpool is severely overprovisioned
which is a waste of resources. This PR plumnbs a flag to control the
number of worker threads for this pool as well as setting a default of
two threads for this server. Two threads allow for one thread to always
listen on the TCP port while the other thread processes requests
Bubble up the constants to the CLI that control the sizes of the
following two thread pools:
- The thread pool used to replay multiple forks in parallel
- The thread pool used to execute transactions in parallel
The default value was previously being determined down where the thread
pool is being created. Providing a default value at the CLI level is
consistent with other args, and gives an operator better visibility into
what the default will actually be
In cluster restart scenarios, an important step is scanning the
Blockstore for blocks that occur after the chosen restart slot with an
incorrect shred version. This check ensures that any blocks that
occurred pre-cluster restart and after the chosen restart slot get
deleted. If a node skips this step, the node can encounter problems when
that block is created again, after the cluster has restarted.
This check only occurs if --wait-for-supermajority AND
--expected-shred-version are set; however, --expected-... is currently
optional when using --wait-...
Our restart instructions typically mention that one should specify
--expected-... as well, but we should just enforce it at the CLI level
to prevent mistakes / wasted time debuggging.
RuntimeConfig doesn't use anything SVM specific and logically belongs
in program runtime rather than SVM. This change moves the definition
of RuntimeConfig struct from the SVM crate to program-runtime and
adjusts `use` statements accordingly.
There are lots of string literals in the /validator directory,
including many for CLI help and error messages. Any string literals
that exceed 100 characters prevent rustfmt from running properly.
This change temporarily set format_string = true in rustfmt.toml, and
then ran the linter on the validator directory. This was followed up
by manually tweaking several strings that were already well crafted
for readability (and within the 100 character limit)