Boostrap app structure - #2
Conversation
Introduces the core framework and the first scenario for testing SV2 endpoints: - scenario.rs: AppType (pool, job-declarator-server, template-provider), TestResult, and Scenario abstraction - setup_connection: happy-path and error-case SetupConnection handshakes, with AppType-derived protocols and flags (e.g. DECLARE_TX_DATA for JDS) - sv2-compliance CLI: test a single endpoint via --endpoint/--app-type, with optional --scenario filter and -v logging - integration tests against a local pool and JDS
Adds the ability to run scenarios against multiple endpoints from a single config file: - config.rs: Config/Site model with optional pool_address and jds_address, parsed from a TOML file - runner.rs: builds targets from the config and runs scenarios against each, printing a per-site summary - CLI: --config conflicts with --endpoint and drives batch mode - targets.example.toml: sample config with pool and JDS sites - integration tests covering config parsing and batch runs
The repository rustfmt.toml uses unstable options (imports_granularity, imports_layout, etc.), so formatting is applied with nightly rustfmt to match the intended style.
- test: installs capnp + libcapnp-dev, caches cargo and the unpacked Bitcoin Core under template-provider/, runs cargo test --all-targets - fmt: rustfmt --check on nightly to honor the unstable options in rustfmt.toml - clippy: -D warnings over all targets
|
I'm still exploring things at a very superficial level... just manually trying to run and see what happens I launched a local SRI Pool and ran: all good but then I killed SRI Pool and tried to run again: a few observations:
|
|
@lucasbalieiro I spent a few hours for the past few days trying to create a mental model of where this is going overall it seems to be in an interesting direction I had a few things I was going to point out on the code diff, but then I decided to ask for many pre-requisites, it ended up taking an approach that's very similar to what we have here... which is a solid indicator that there's not too much ambiguity in the design space, and we were already going in the right direction here but for some other things, it took a different approach... I took time to review those divergences and I feel they're worth consideration (especially encapsulation) so I'm creating #3 as an alternative to this so we can compare trade-offs |
|
closing this in favor #3 |
closes #1
this PR bootstraps the app and establishes the initial structure that future compliance scenarios will follow.
I know this is a larger-than-usual PR because it lays down the initial infrastructure. At this stage, I'm mainly looking for feedback on the overall architecture and project structure, so there's no need to spend too much time reviewing implementation details.
The goal is to establish a framework that makes adding new scenarios straightforward, without requiring changes to the execution framework. The
SetupConnectionscenario included in this PR serves as the reference implementation for future scenarios.Currently, the application can connect to SV2 endpoints (Pools and Job Declarator Servers), execute protocol compliance scenarios, and report pass/fail results. Scenarios can be run against a single endpoint or against multiple deployments defined in a TOML configuration file.
What's included
A library plus a CLI (
src/bin/sv2_compliance.rs) for running compliance scenarios against individual endpoints or batches of deployments.A generic scenario framework (
src/scenario.rs) built aroundAppTypeandScenario.The first compliance scenario (
src/setup_connection/), organized as the template for future scenarios.TOML-based batch execution (
src/config.rsandsrc/runner.rs).GitHub Actions CI running:
cargo test --all-targetscargo clippy --all-targets -- -D warningscargo fmt --all -- --check(nightly)Adding new scenarios
Adding a new scenario should only require:
src/<scenario>/with arun(endpoint, app_type)entrypoint.src/bin/sv2_compliance.rswithScenario::new(...).Once registered, it automatically works with both single-endpoint and TOML-based batch execution, and can be filtered with
--scenario.