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

JDC does not exchange messages with TP in Integration Tests #1420

Open
plebhash opened this issue Jan 29, 2025 · 0 comments
Open

JDC does not exchange messages with TP in Integration Tests #1420

plebhash opened this issue Jan 29, 2025 · 0 comments
Labels
bug Something isn't working integration-tests

Comments

@plebhash
Copy link
Collaborator

while working on #1419 I noticed that JDC is not connecting to TP

here's a little snippet that illustrates the problem:

#[tokio::test]
async fn jdc_test() {
    let (_tp, tp_addr) = start_template_provider(None).await;
    let (_pool, pool_addr) = start_pool(Some(tp_addr)).await;
    let (_jds, jds_addr) = start_jds(tp_addr).await;

    let (sniffer_pool, sniffer_pool_addr) =
        start_sniffer("0".to_string(), pool_addr, false, None).await;

    let (sniffer_jds, sniffer_jds_addr) =
        start_sniffer("1".to_string(), jds_addr, false, None).await;

    let (sniffer_tp, sniffer_tp_addr) =
        start_sniffer("2".to_string(), tp_addr, false, None).await;

    let (_jdc, jdc_addr) = start_jdc(sniffer_pool_addr, sniffer_tp_addr, sniffer_jds_addr).await;
    let (_translator, tproxy_addr) = start_sv2_translator(jdc_addr).await;

    println!("sniffer_pool {:?}", sniffer_pool.next_message_from_downstream());
    println!("sniffer_pool {:?}", sniffer_pool.next_message_from_upstream());

    println!("sniffer_jds {:?}", sniffer_jds.next_message_from_downstream());
    println!("sniffer_jds {:?}", sniffer_jds.next_message_from_upstream());
    
    println!("sniffer_tp {:?}", sniffer_tp.next_message_from_downstream());
    println!("sniffer_tp {:?}", sniffer_tp.next_message_from_upstream());
}

the behavior:

    Finished test [optimized + debuginfo] target(s) in 0.91s
     Running tests/jds_integration.rs (/Users/plebhash/develop/stratum/roles/target/debug/deps/jds_integration-caf345f2043f64aa)

running 1 test
sniffer_pool Some((0, Common(SetupConnection(SetupConnection { protocol: MiningProtocol, min_version: 2, max_version: 2, flags: 6, endpoint_host: Owned([48, 46, 48, 46, 48, 46, 48]), endpoint_port: 50, vendor: Owned([]), hardware_version: Owned([]), firmware: Owned([]), device_id: Owned([]) }))))
sniffer_pool Some((1, Common(SetupConnectionSuccess(SetupConnectionSuccess { used_version: 2, flags: 6 }))))
sniffer_jds Some((0, Common(SetupConnection(SetupConnection { protocol: JobDeclarationProtocol, min_version: 2, max_version: 2, flags: 1, endpoint_host: Owned([49, 50, 55, 46, 48, 46, 48, 46, 49]), endpoint_port: 57389, vendor: Owned([]), hardware_version: Owned([]), firmware: Owned([]), device_id: Owned([]) }))))
sniffer_jds Some((1, Common(SetupConnectionSuccess(SetupConnectionSuccess { used_version: 2, flags: 1 }))))
sniffer_tp None
sniffer_tp None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working integration-tests
Projects
None yet
Development

No branches or pull requests

1 participant