Skip to content
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

STR-1084: Test prover checkpoint runner with unreliable sequencer #686

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import time

import flexitest

from envs import testenv
Expand All @@ -17,20 +19,18 @@

@flexitest.register
class ProverCheckpointRunnerTest(testenv.StrataTester):
"""This tests the prover's checkpoint runner with an unreliable sequencer service."""

def __init__(self, ctx: flexitest.InitContext):
# Increase the proof timeout so that the checkpoint index increments only
# after the prover client submits the corresponding checkpoint proof
rollup_settings = RollupParamsSettings.new_default()
rollup_settings.proof_timeout = PROVER_CHECKPOINT_SETTINGS["PROVER_TIMEOUT_SECONDS"]

# Enable checkpoint proving on the prover client
prover_settings = ProverClientSettings.new_default()
prover_settings.enable_checkpoint_proving = "true"

ctx.set_env(
BasicEnvConfig(
pre_generate_blocks=101,
prover_client_settings=prover_settings,
prover_client_settings=ProverClientSettings.new_with_proving(),
rollup_settings=rollup_settings,
)
)
Expand All @@ -56,3 +56,20 @@ def main(self, ctx: flexitest.RunContext):
),
timeout=PROVER_CHECKPOINT_SETTINGS["PROVER_TIMEOUT_SECONDS"],
)

sequencer.stop()
# Wait some time to make sure checkpoint runner indeed polls
# on the checkpoint with the stopped (unreliable) sequencer.
time.sleep(10)
sequencer.start()
sequencer_rpc = sequencer.create_rpc()

# Wait until another portion of consecutive proofs are generated and verified
# after the restart of the sequencer.
wait_until(
lambda: (
sequencer_rpc.strata_getLatestCheckpointIndex()
== PROVER_CHECKPOINT_SETTINGS["CONSECUTIVE_PROOFS_REQUIRED"] * 2
),
timeout=PROVER_CHECKPOINT_SETTINGS["PROVER_TIMEOUT_SECONDS"],
)
Loading