Closed tayfunelmas closed 1 month ago
Pre-review - this has the potential to break a few nayduck tests since the localnet subcommand API is changing. Can you check and fix any breakages there?
Do you need the flexibility to configure each node separately as archival or rpc? If not I think the interface would be cleaner with just providing the number of each type of nodes e.g. --validators-num 4 --rpc-num 1 --archival-num 1
. This would make the first 4 nodes validators, the next one rpc and the last one archival. WDYT?
Attention: Patch coverage is 94.18182%
with 16 lines
in your changes missing coverage. Please review.
Project coverage is 71.76%. Comparing base (
8fee337
) to head (491aaf4
).
Files | Patch % | Lines |
---|---|---|
integration-tests/src/node/mod.rs | 0.00% | 10 Missing :warning: |
neard/src/cli.rs | 42.85% | 4 Missing :warning: |
nearcore/src/config.rs | 99.22% | 1 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Pre-review - this has the potential to break a few nayduck tests since the localnet subcommand API is changing. Can you check and fix any breakages there?
This will likely break the existing users of nearup
tool (frozen repo), as it uses the flag as a boolean. I in fact changed the tool in my fork.
Regarding nayduck: I see that nayduck tests do not use the --archival-nodes
flag but they update the config after init_cluster
function to explicitly set archive
to true before starting the nodes (example test).
I will run the nayduck anyways, thanks for the notice.
Do you need the flexibility to configure each node separately as archival or rpc? If not I think the interface would be cleaner with just providing the number of each type of nodes e.g.
--validators-num 4 --rpc-num 1 --archival-num 1
. This would make the first 4 nodes validators, the next one rpc and the last one archival. WDYT?
Good point. Right, I do not need to specifically point to certain nodes and in most cases the archival and rpc nodes would be separate from the validator nodes.
But (differently from the archival-nodes
flag), the flag for specifying the number of non-validator nodes is used extensively in the code/tests, so replacing or complementing it with num-archival/rpc-nodes
kind of flags would be a larger change.
Just in case can you schedule a nayduck run on this? ./scripts/nayduck.py
should do the trick.
(This change is to test archival nodes in a localnet for any archival node improvements.)
The
neard localnet
command does not have flexibility to configure archival and RPC nodes separately from the other validator and non-validator nodes. For example today--archival-nodes
is a boolean flag and makes all nodes archival nodes. Similarly--tracked-shards
specify the shards tracked by all the nodes. Thus, there is no way to have some validator nodes tracking no shards (single-shard tracking) and separate archival/RPC nodes tracking all shards. Especially after stateless validation gets effective, validators will start tracking single/some shards, while we can archival and RPC nodes to track all shards.To support this for localnet setup, we add flags to the
neard localnet
command to create non-validator nodes configured as archival and RPC nodes. These nodes track all shards even if the validators run with single-shard tracking enabled. This allows to run aneard localnet
command, for example, to have 4 validator nodes to track single-shard, 1 archival node to track all shards, and 1 RPC node to track all shards as follows:Other changes:
Remove
--archive
flag, since it is not used in rest of the code and instead the new flag should be used.Remove the function param
local_port
since it is always true.Rename functions from
create_testnet_config...
tocreate_localnet_config...
.NEXT: We will update the appropriate code (eg. nayduck tests) in follow-up PRs to use the new flags
--non-validators-archival
and --non-validators-rpc` instead of setting up a regular non-validator node and updating its config separately.