Skip to content

Commit 7a6c972

Browse files
scripts: only use all at once restart for set revert mode.
1 parent be0bd78 commit 7a6c972

File tree

1 file changed

+15
-28
lines changed

1 file changed

+15
-28
lines changed

scripts/prod/set_node_revert_mode.py

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def set_revert_mode(
3838
project_name: str,
3939
should_revert: bool,
4040
revert_up_to_block: int,
41-
restart_strategy: RestartStrategy,
4241
):
4342
config_overrides = {
4443
"revert_config.should_revert": should_revert,
@@ -59,7 +58,7 @@ def set_revert_mode(
5958
post_restart_instructions,
6059
)
6160
restarter = ServiceRestarter.from_restart_strategy(
62-
restart_strategy,
61+
RestartStrategy.ALL_AT_ONCE,
6362
namespace_and_instruction_args,
6463
Service.Core,
6564
)
@@ -76,41 +75,34 @@ def main():
7675
usage_example = """
7776
Examples:
7877
# Set revert mode up to a specific block
79-
%(prog)s --namespace apollo-sepolia-integration --num-nodes 3 -t all_at_once --revert-only --revert_up_to_block 12345
80-
%(prog)s -n apollo-sepolia-integration -N 3 -t one_by_one --revert-only -b 12345
78+
%(prog)s --namespace apollo-sepolia-integration --num-nodes 3 --revert-only --revert_up_to_block 12345
79+
%(prog)s -n apollo-sepolia-integration -N 3 --revert-only -b 12345
8180
8281
# Set revert mode using feeder URL to get current block
83-
%(prog)s --namespace apollo-sepolia-integration --num-nodes 3 -t all_at_once --revert-only --feeder-url feeder.integration-sepolia.starknet.io
84-
%(prog)s -n apollo-sepolia-integration -N 3 -t one_by_one --revert-only -f feeder.integration-sepolia.starknet.io
82+
%(prog)s --namespace apollo-sepolia-integration --num-nodes 3 --revert-only --feeder-url feeder.integration-sepolia.starknet.io
83+
%(prog)s -n apollo-sepolia-integration -N 3 --revert-only -f feeder.integration-sepolia.starknet.io
8584
8685
# Disable revert mode
87-
%(prog)s --namespace apollo-sepolia-integration --num-nodes 3 -t all_at_once --disable-revert-only
88-
%(prog)s -n apollo-sepolia-integration -N 3 -t one_by_one --disable-revert-only
86+
%(prog)s --namespace apollo-sepolia-integration --num-nodes 3 --disable-revert-only
87+
%(prog)s -n apollo-sepolia-integration -N 3 --disable-revert-only
8988
9089
# Set revert mode with cluster prefix
91-
%(prog)s -n apollo-sepolia-integration -N 3 -c my-cluster -t all_at_once --revert-only -b 12345
90+
%(prog)s -n apollo-sepolia-integration -N 3 -c my-cluster --revert-only -b 12345
9291
9392
# Set revert mode with feeder URL and cluster prefix
94-
%(prog)s -n apollo-sepolia-integration -N 3 -c my-cluster -t one_by_one --revert-only -f feeder.integration-sepolia.starknet.io
95-
96-
# Disable revert mode without restarting nodes
97-
%(prog)s -n apollo-sepolia-integration -N 3 -t no_restart --disable-revert-only
98-
99-
# Set revert mode with explicit restart
100-
%(prog)s -n apollo-sepolia-integration -N 3 -t all_at_once --revert-only -b 12345
101-
102-
# Set revert mode with feeder URL and explicit restart
103-
%(prog)s -n apollo-sepolia-integration -N 3 -t one_by_one --revert-only -f feeder.integration-sepolia.starknet.io
93+
%(prog)s -n apollo-sepolia-integration -N 3 -c my-cluster --revert-only -f feeder.integration-sepolia.starknet.io
10494
10595
# Set revert mode starting from specific node index
106-
%(prog)s -n apollo-sepolia-integration -N 3 -i 5 -t all_at_once --revert-only -b 12345
96+
%(prog)s -n apollo-sepolia-integration -N 3 -i 5 --revert-only -b 12345
10797
10898
# Set revert mode with feeder URL starting from specific node index
109-
%(prog)s -n apollo-sepolia-integration -N 3 -i 5 -t one_by_one --revert-only -f feeder.integration-sepolia.starknet.io
99+
%(prog)s -n apollo-sepolia-integration -N 3 -i 5 --revert-only -f feeder.integration-sepolia.starknet.io
110100
"""
111101

112102
args_builder = ApolloArgsParserBuilder(
113-
"Sets or unsets the revert mode for the sequencer nodes", usage_example
103+
"Sets or unsets the revert mode for the sequencer nodes",
104+
usage_example,
105+
include_restart_strategy=False,
114106
)
115107

116108
revert_group = args_builder.parser.add_mutually_exclusive_group()
@@ -136,15 +128,12 @@ def main():
136128
# TODO(guy.f): Remove this when we rely on metrics for restarting.
137129
args_builder.add_argument(
138130
"--project-name",
131+
required=True,
139132
help="The name of the project to get logs from. If One_By_One strategy is used, this is required.",
140133
)
141134

142135
args = args_builder.build()
143136

144-
if args.restart_strategy == RestartStrategy.ONE_BY_ONE and args.project_name is None:
145-
print_error("Error: --project-name is required when using One_By_One strategy")
146-
sys.exit(1)
147-
148137
should_revert = not args.disable_revert_only
149138
if should_revert:
150139
if args.feeder_url is None and args.revert_up_to_block is None:
@@ -181,7 +170,6 @@ def main():
181170
args.project_name,
182171
True,
183172
revert_up_to_block,
184-
args.restart_strategy,
185173
)
186174
if should_disable_revert:
187175
print_colored(f"\nDisabling revert mode")
@@ -192,7 +180,6 @@ def main():
192180
args.project_name,
193181
False,
194182
18446744073709551615,
195-
args.restart_strategy,
196183
)
197184

198185

0 commit comments

Comments
 (0)