Skip to content

Commit

Permalink
Merge branch 'dev' into feature/asyncFlagSet
Browse files Browse the repository at this point in the history
  • Loading branch information
plebhash authored Jul 28, 2024
2 parents 9a72e42 + 1062ec7 commit cbb1330
Show file tree
Hide file tree
Showing 14 changed files with 554 additions and 202 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/mg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ jobs:
- name: Run jds-do-not-stackoverflow-when-no-token
run: sh ./test/message-generator/test/jds-do-not-stackoverflow-when-no-token/jds-do-not-stackoverflow-when-no-token.sh

jds-receive-solution-while-processing-declared-job:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install cargo-llvm-cov
run: cargo install cargo-llvm-cov
- name: Run jds-receive-solution-while-processing-declared-job
run: sh ./test/message-generator/test/jds-receive-solution-while-processing-declared-job/jds-receive-solution-while-processing-declared-job.sh

pool-sri-test-1-standard:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -171,6 +181,7 @@ jobs:
jds-do-not-fail-on-wrong-tsdatasucc,
jds-do-not-panic-if-jdc-close-connection,
jds-do-not-stackoverflow-when-no-token,
jds-receive-solution-while-processing-declared-job,
pool-sri-test-1-standard,
pool-sri-test-close-channel,
pool-sri-test-extended_0,
Expand All @@ -192,6 +203,7 @@ jobs:
[ "${{ needs.jds-do-not-fail-on-wrong-tsdatasucc.result }}" != "success" ] ||
[ "${{ needs.jds-do-not-panic-if-jdc-close-connection.result }}" != "success" ] ||
[ "${{ needs.jds-do-not-stackoverflow-when-no-token.result }}" != "success" ] ||
[ "${{ needs.jds-receive-solution-while-processing-declared-job.result }}" != "success" ] ||
[ "${{ needs.pool-sri-test-1-standard.result }}" != "success" ] ||
[ "${{ needs.pool-sri-test-close-channel.result }}" != "success" ] ||
[ "${{ needs.pool-sri-test-extended_0.result }}" != "success" ] ||
Expand Down
4 changes: 4 additions & 0 deletions INTEROPERABILITY-TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

How to test Sv2 compliant software against the SRI implementation.

## Requirements

- [Cargo LLVM Cov](https://github.com/taiki-e/cargo-llvm-cov#installation)

## With Message Generator (MG)

First thing you need to write a test that can be executed by the message generator. In order to do
Expand Down
12 changes: 6 additions & 6 deletions roles/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 20 additions & 29 deletions roles/jd-server/src/lib/job_declarator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,26 +294,19 @@ impl JobDeclaratorDownstream {
Some(JobDeclaration::SubmitSolution(message)) => {
match Self::collect_txs_in_job(self_mutex.clone()) {
Ok(_) => {
info!(
"All transactions in downstream job are recognized correctly by the JD Server"
);
let hexdata =
match JobDeclaratorDownstream::get_block_hex(
self_mutex.clone(),
message,
) {
Ok(inner) => inner,
Err(e) => {
error!(
"Received solution but encountered error: {:?}",
e
);
recv.close();
//TODO should we brake it?
break;
}
};
let _ = new_block_sender.send(hexdata).await;
info!("All transactions in downstream job are recognized correctly by the JD Server");
match JobDeclaratorDownstream::get_block_hex(
self_mutex.clone(),
message,
) {
Ok(hexdata) => {
let _ =
new_block_sender.send(hexdata).await;
}
Err(e) => {
handle_result!(tx_status, Err(*e))
}
};
}
Err(error) => {
error!("Missing transactions: {:?}", error);
Expand All @@ -333,22 +326,20 @@ impl JobDeclaratorDownstream {
.unwrap();
tokio::select! {
_ = JDsMempool::add_tx_data_to_mempool(mempool, retrieve_transactions) => {
let hexdata = match JobDeclaratorDownstream::get_block_hex(
match JobDeclaratorDownstream::get_block_hex(
self_mutex.clone(),
message.clone(),
) {
Ok(inner) => inner,
Ok(hexdata) => {
let _ = new_block_sender.send(hexdata).await;
},
Err(e) => {
error!(
"Error retrieving transactions: {:?}",
e
handle_result!(
tx_status,
Err(*e)
);
recv.close();
//TODO should we brake it?
break;
}
};
let _ = new_block_sender.send(hexdata).await;
}
_ = tokio::time::sleep(Duration::from_secs(60)) => {}
}
Expand Down
Loading

0 comments on commit cbb1330

Please sign in to comment.