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

Update integration script #3767

Merged
merged 1 commit into from
Oct 17, 2024
Merged
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
15 changes: 15 additions & 0 deletions scripts/auto-integration/run-integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
class ReplicaData:
last_highest_view = 0
last_decided_view = 0
number_of_empty_blocks_proposed = 0
last_synced_block_height = 0
highest_view_updates = 0
decided_view_updates = 0
Expand All @@ -57,6 +58,7 @@ def __init__(self):
self.highest_view_updates = 0
self.decided_view_updates = 0
self.last_decided_view = 0
self.number_of_empty_blocks_proposed = 0
self.synced_block_height_updates = 0
self.tolerance = 5
self.replica_data = {}
Expand All @@ -67,6 +69,7 @@ def table(self):
table.add_column("Port", justify="right", no_wrap=True)
table.add_column("Last Highest View")
table.add_column("Last Decided View")
table.add_column("Num Empty Blocks")
table.add_column("Last Synced Block Height")
table.add_column("Status")

Expand All @@ -75,6 +78,7 @@ def table(self):
str(port),
str(data.last_highest_view),
str(data.last_decided_view),
str(data.number_of_empty_blocks_proposed),
str(data.last_synced_block_height),
"[green]In Sync[/green]"
if data.status
Expand All @@ -87,6 +91,7 @@ def update(self, text: str, port: str):
if port not in self.replica_data:
self.replica_data[port] = ReplicaData()
self.update_last_decided_view(text, port)
self.update_number_of_empty_blocks_proposed(text, port)
self.update_last_highest_view(text, port)
self.update_last_synced_block_height(text, port)

Expand Down Expand Up @@ -118,6 +123,16 @@ def update_last_decided_view(self, text: str, port: str):
self.replica_data[port].status = False
self.failed_views.add(last_decided_view)

def update_number_of_empty_blocks_proposed(self, text: str, port: str):
match = re.search(r"^consensus_number_of_empty_blocks_proposed (\d+)", text, re.MULTILINE)
if match:
number_of_empty_blocks_proposed = int(match.group(1))
if number_of_empty_blocks_proposed > self.replica_data[port].number_of_empty_blocks_proposed:
self.replica_data[port].number_of_empty_blocks_proposed = number_of_empty_blocks_proposed
self.number_of_empty_blocks_proposed = max(
self.number_of_empty_blocks_proposed, self.replica_data[port].number_of_empty_blocks_proposed
)

def update_last_synced_block_height(self, text: str, port: str):
match = re.search(
r"^consensus_last_synced_block_height (\d+)", text, re.MULTILINE
Expand Down