-
Notifications
You must be signed in to change notification settings - Fork 664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
archive flag for turning off GC #2099
Conversation
Codecov Report
@@ Coverage Diff @@
## staging #2099 +/- ##
===========================================
- Coverage 86.83% 86.82% -0.02%
===========================================
Files 177 177
Lines 34123 34134 +11
===========================================
+ Hits 29632 29636 +4
- Misses 4491 4498 +7
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this looks correct
near/src/main.rs
Outdated
@@ -78,6 +78,7 @@ fn main() { | |||
.arg(Arg::with_name("network-addr").long("network-addr").help("Customize network listening address (useful for running multiple nodes on the same machine)").takes_value(true)) | |||
.arg(Arg::with_name("rpc-addr").long("rpc-addr").help("Customize RPC listening address (useful for running multiple nodes on the same machine)").takes_value(true)) | |||
.arg(Arg::with_name("telemetry-url").long("telemetry-url").help("Customize telemetry url").takes_value(true)) | |||
.arg(Arg::with_name("archive").long("archive").help("Keep old blocks in the storage (default false)").takes_value(true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is takes_value=true
, if it's a boolean?
Look at fast
parameter above for the init
on line 66.
Separately, no need to provide the default, it is common sense that if there's a flag, than omitting it is the reverse of its behavior (whomever added produce_empty_blocks
above for some reason also chose to make it a string parameter, but booleans should be takes_value=false
, and not specify default value in the docs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except issue Alex asked for, looks good to me
I don't like the solution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we extend the idea of @Kouprin and @mfornet for the adversarial node:
We are going to have several types of nodes in our system:
- regular node (the only node for which we will be distributing the docker image);
- archival node;
- debug/diagnostics node;
- adversarial node.
To run any of the above nodes, except the regular one, the user needs to provide the following three things:
- The code should be compiled with the feature flag that guards conditional compilation;
- The node should be started with a special command line flag;
- There should be an intent file next to the node.
For example, if we want to run adversarial node we should compile it with adversarial_you_will_be_slashed
feature, then pass --adversarial_you_will_be_slashed
flag and create adversarial_you_will_be_slashed.txt
file before starting the node.
Pros:
- Uniform treatment of various types of the node:
- Adversarial node and debug/diagnostics node use conditional compilation anyway;
- Conditional compilation allows having optional external dependencies that might be used by heavy versions of the node, like "archival node" and "debug/diagnostics node";
- Triple opt-in makes it really hard for someone to launch the wrong node accidentally. There is no need to have a clean-up step where we yank adversarial code when merging into master;
WDYT @Kouprin , @SkidanovAlex , @mfornet ?
Is it a separate issue, isn't it? |
@nearmax I'm okay with accepting this as is now and creating a new issue for you idea. |
If we go with the above proposal then the code in this PR should be changed. Instead of threading |
Ok |
There are different issues. This one is exactly for creating ability of system to turn off GC. Your suggestion is about how to make up the way of node running. This is great, but it's still different. |
Fixes #2094.