Skip to content

Commit

Permalink
Revert fix in db_migration.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tayfunelmas committed Oct 14, 2024
1 parent 9c023d4 commit a1413b2
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions pytest/tests/sanity/db_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,10 @@

NUM_SHARDS = 4
EPOCH_LENGTH = 5
# Used while the node is running with the old binary.
LARGE_GC_NUM_EPOCHS_TO_KEEP = 15
# Used while the node is running with the new binary.
DEFAULT_GC_NUM_EPOCHS_TO_KEEP = 5

# Config to track all shards.
node_config = {
"tracked_shards": list(range(NUM_SHARDS)),
# We should have large enough GC window while the node running with the old binary (2.0), because we need to
# bootstrap the congestion info from the genesis block and the genesis block should not be garbage collected.
# The new binary (2.1) has a mechanism to save the congestion info on disk to be resilient against GC of
# genesis block, however the old binary does not have this mechanism, thus we need to prevent GC to kick in
# before the node transitions to the new binary. Note that, after restarting the node with the new binary
# we can switch back to the usual GC window (see below).
# TODO(#11902): This change for GC can be removed when the old binary version becomes 2.1 in this test.
"gc_num_epochs_to_keep": LARGE_GC_NUM_EPOCHS_TO_KEEP,
}


Expand Down Expand Up @@ -129,9 +117,6 @@ def main():
send_some_tx(node)
unstake_and_stake(nodes[1], node)

height, _ = utils.wait_for_blocks(node, count=1)
assert height < EPOCH_LENGTH * LARGE_GC_NUM_EPOCHS_TO_KEEP, "Node should run without GC"

node.kill()

logging.info(
Expand All @@ -141,7 +126,6 @@ def main():
logging.info("Starting the current node...")
node.near_root = executables.current.root
node.binary_name = executables.current.neard
node.change_config({"gc_num_epochs_to_keep": DEFAULT_GC_NUM_EPOCHS_TO_KEEP})
node.start(boot_node=node)

logging.info("Running the current node...")
Expand Down

0 comments on commit a1413b2

Please sign in to comment.