-
Notifications
You must be signed in to change notification settings - Fork 29
refactor: switch block prod test to mixed UTxO backends #3259
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
Conversation
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.
Pull request overview
This PR refactors the block production test to use mixed UTxO backends (mem/disk) instead of mixed P2P/legacy network topologies. The test infrastructure now tracks and records the UTxO backend type for each pool node rather than its network topology configuration.
Key Changes:
- Updated environment variable from
MIXED_P2P=1toMIXED_UTXO_BACKENDS="mem disk"with additional timeout configuration - Replaced topology-based logic with backend-based logic for pool node configuration tracking
- Updated database schema to store backend information instead of topology information
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/test_block_production.sh | Updated comments and environment variables to reference UTxO backends instead of P2P/legacy topologies; removed unused NODE_REV and CI_BYRON_CLUSTER variables |
| cardano_node_tests/tests/test_blocks.py | Refactored backend determination logic, updated database schema from topology to backend tracking, and simplified pool backend assignment logic |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
99bb642 to
506cc85
Compare
506cc85 to
ff7061d
Compare
Update the block production test to use mixed UTxO backends ("mem" and
"disk") instead of mixed P2P/legacy topologies. The test now records
the backend type in the database and test output, and the helper
script sets the MIXED_UTXO_BACKENDS environment variable accordingly.
ff7061d to
f0255f6
Compare
Add `block_production_graph.py` script to generate a bar chart of total blocks per backend from an SQLite database. Update dependencies in `pyproject.toml` and `poetry.lock` to include matplotlib and seaborn, enabling statistical data visualization. Register the script as a CLI entry point under `block-production-graph`.
f0255f6 to
cc5edb1
Compare
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.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
Comments suppressed due to low confidence (1)
cardano_node_tests/tests/test_blocks.py:359
- A new cursor is created inside _save_state on each call but the connection is not committed before closing the cursor in nested functions. While the commit is being called (line 358), if an exception occurs between cursor creation and commit, the cursor won't be closed properly. Consider using a context manager with
with conn.cursor() as cur:instead of manually closing cursors to ensure proper resource cleanup.
cur = conn.cursor()
for pool_id_dec, num_blocks in blocks_before.items():
pool_rec = pool_mapping[pool_id_dec]
pool_idx = tp.cast(int, pool_rec["pool_idx"])
cur.execute(
"INSERT INTO blocks VALUES (?, ?, ?, ?, ?, ?)",
(
rand,
curr_epoch - 1,
pool_rec["pool_id"],
pool_idx,
_get_pool_utxo_backend(pool_idx),
num_blocks,
),
)
conn.commit()
cur.close()
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Update the block production test to use mixed UTxO backends ("mem" and "disk") instead of mixed P2P/legacy topologies. The test now records the backend type in the database and test output, and the helper script sets the MIXED_UTXO_BACKENDS environment variable accordingly.