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

Extract message sending from prover & verifier SMs #965

Merged
merged 23 commits into from
Sep 1, 2023

Conversation

mirgee
Copy link
Contributor

@mirgee mirgee commented Aug 31, 2023

Extracts message sending out of prover and verifier state machines and handlers. Transition functions are now returning messages constructed to be sent and are not accepting message-sending closures.

Prover

Handlers

  • send_proposal -> build_presentation_proposal
  • send_presentation -> mark_presentation_sent
  • Removed set_presentation

State machine

  • send_presentation_proposal -> build_presentation_proposal
  • send_presentation -> mark_presentation_sent (now throws in invalid state)
  • Added get_problem_report, get_presentation_proposal
  • Removed set_presentation

Verifier

Handlers

  • send_presentation_request -> mark_presentation_request_sent (now throws in invalid state, TODO: better name)
  • set_request -> set_presentation_request
  • Removed mark_presentation_request_msg_sent, get_presentation_request

State machine

  • set_request -> set_presentation_request
  • mark_presentation_request_msg_sent -> mark_presentation_request_sent
  • Added get_final_message

verify_presentation now generates and stores either presentation or problem report, which can then be retrieved via get_final_message.

Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
@mirgee mirgee linked an issue Aug 31, 2023 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Aug 31, 2023

Codecov Report

Merging #965 (b33f23d) into main (313db9f) will decrease coverage by 0.03%.
Report is 2 commits behind head on main.
The diff coverage is 45.67%.

@@            Coverage Diff             @@
##             main     #965      +/-   ##
==========================================
- Coverage   39.25%   39.23%   -0.03%     
==========================================
  Files         417      415       -2     
  Lines       28959    28867      -92     
  Branches     6186     6173      -13     
==========================================
- Hits        11368    11325      -43     
+ Misses      14250    14202      -48     
+ Partials     3341     3340       -1     
Flag Coverage Δ
unittests-aries-vcx 39.23% <45.67%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
aries_vcx/tests/utils/devsetup_util.rs 52.70% <0.00%> (-1.04%) ⬇️
...otocols/proof_presentation/prover/state_machine.rs 45.68% <20.83%> (+2.88%) ⬆️
...es_vcx/src/handlers/proof_presentation/verifier.rs 44.44% <24.44%> (-6.30%) ⬇️
...ries_vcx/src/handlers/proof_presentation/prover.rs 44.26% <28.57%> (+0.35%) ⬆️
...ocols/proof_presentation/verifier/state_machine.rs 52.32% <34.48%> (-3.63%) ⬇️
aries_vcx/tests/utils/scenarios.rs 82.83% <89.65%> (-0.28%) ⬇️
...tation/prover/states/presentation_proposal_sent.rs 38.46% <100.00%> (ø)
aries_vcx/tests/test_creds_proofs.rs 88.39% <100.00%> (+0.07%) ⬆️
aries_vcx/tests/utils/devsetup_alice.rs 72.34% <100.00%> (ø)
aries_vcx/tests/utils/devsetup_faber.rs 80.50% <100.00%> (ø)

... and 17 files with indirect coverage changes

Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
…presentation

Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
…ame to set_presentation_request

Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
…rom verify_presentation and return final message

Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
@mirgee mirgee marked this pull request as ready for review August 31, 2023 14:44
@mirgee mirgee marked this pull request as draft August 31, 2023 14:56
@hyperledger hyperledger deleted a comment from Patrik-Stas Aug 31, 2023
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Patrik-Stas
Patrik-Stas previously approved these changes Sep 1, 2023
Copy link
Contributor

@Patrik-Stas Patrik-Stas left a comment

Choose a reason for hiding this comment

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

Left some comments, consider them, but generally lgtm.

In line with Connection protocol, Didexchange protocol, changes done in Issuer/Verifier I'd suggest to get rid of marker states, but that's again something that can be discussed and addressed outside of this PR.

Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
@mirgee mirgee marked this pull request as ready for review September 1, 2023 14:08
@Patrik-Stas Patrik-Stas merged commit 429feca into main Sep 1, 2023
30 checks passed
@Patrik-Stas Patrik-Stas deleted the refactor/presentation-ioless branch September 1, 2023 15:15
bobozaur pushed a commit that referenced this pull request Sep 14, 2023
* Extract message sending from prover & verifier SMs (#965)

Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Bogdan Mircea <mirceapetrebogdan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IO for prover and verifier as opt-in
3 participants