Skip to content

Fixes/Optimizations for the Mithril Aggregator #116

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

Merged
merged 5 commits into from
Apr 14, 2022

Conversation

Alenar
Copy link
Collaborator

@Alenar Alenar commented Apr 13, 2022

#109 :

  • update release_max_level_debug
  • Specify port binding for the docker run example in tge README so we can reach the aggregator in that case
  • Add a graceful shutdown so a Ctrl+C stop the aggregator even in a container
  • Move openapi.yaml to mithril-network/ and update all the dependencies
  • Add previous_hash field to /certificate_pending as explained in Add missing field in OpenAPI specification #112

@Alenar Alenar force-pushed the djo/109-fixopti-aggregator branch from 3da20b9 to 0a44226 Compare April 13, 2022 16:11
@Alenar Alenar requested review from jpraynaud and a user April 13, 2022 16:15
@github-actions
Copy link

github-actions bot commented Apr 13, 2022

Unit Test Results

1 files  ±0  1 suites  ±0   0s ⏱️ ±0s
5 tests ±0  5 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 1674f77. ± Comparison against base commit 47cf084.

♻️ This comment has been updated with latest results.

Copy link
Member

@jpraynaud jpraynaud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect such changes to be kind of reflected in a test somewhere but perhaps this is taken into account by our existing API spec test? I mean, if I change the API only, without changing the Rust data structure, does this break a test?

@Alenar
Copy link
Collaborator Author

Alenar commented Apr 14, 2022

@abailly-iohk This is taken in account by our API spec test, adding the previous_spec field in the openapi without changing the code yielded this:

$ cargo test
    Finished test [unoptimized + debuginfo] target(s) in 0.05s
     Running unittests (target/debug/deps/mithril_aggregator-519222e6fa3cf851)

running 8 tests
test http_server::tests::test_snapshots_get_ok ... ok
test http_server::tests::test_register_signatures_post_ok ... ok
test http_server::tests::test_certificate_certificate_hash_get_ok ... ok
test apispec::tests::test_apispec_validate_ok ... FAILED
test http_server::tests::test_register_signer_post_ok ... ok
test http_server::tests::test_snapshot_digest_get_ok ... ok
test http_server::tests::test_certificate_pending_get_ok ... FAILED
test apispec::tests::test_apispec_validate_errors ... ok

failures:

---- apispec::tests::test_apispec_validate_ok stdout ----
thread 'apispec::tests::test_apispec_validate_ok' panicked at 'assertion failed: APISpec::from_file(API_SPEC_FILE).method(&Method::GET.as_str()).path(&\"/certificate-pending\").validate_request(&Null).unwrap().validate_response(&Response::<Bytes>::new(Bytes::from(json!(fake_data\n                                ::\n                                certificate_pending()).to_string().into_bytes()))).is_ok()', src/apispec.rs:127:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- http_server::tests::test_certificate_pending_get_ok stdout ----
thread 'http_server::tests::test_certificate_pending_get_ok' panicked at 'OpenAPI error: "\"previous_hash\" is a required property"', src/http_server.rs:202:14


failures:
    apispec::tests::test_apispec_validate_ok
    http_server::tests::test_certificate_pending_get_ok

test result: FAILED. 6 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.05s

error: test failed, to rerun pass '--bin mithril-aggregator'

@Alenar Alenar force-pushed the djo/109-fixopti-aggregator branch from 0a44226 to 1674f77 Compare April 14, 2022 08:41
@ghost
Copy link

ghost commented Apr 14, 2022

Great, that's what I expected!

@Alenar Alenar closed this Apr 14, 2022
@Alenar Alenar reopened this Apr 14, 2022
@Alenar Alenar merged commit dde947e into main Apr 14, 2022
@Alenar Alenar deleted the djo/109-fixopti-aggregator branch April 14, 2022 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants