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

More functions to simplify wawaka contract development #348

Merged
merged 5 commits into from
Feb 1, 2022

Conversation

cmickeyb
Copy link
Contributor

Two new classes of functions for the Wawaka common library:

  • Secrets -- simplify (and standardize) generating messages that can be shared between contracts; a message is encrypted with the contracts encryption key.
  • Attestation -- wrappers for the sgx report verification and processing functions

Add library of common wawaka contract methods.

There are several methods that are common to many contracts. This update provides a base implementation for those methods in order to simplify contract development.

Add common contracts methods for attestations. Provides a wrapper for managing attested contract endpoints. Contract object provides an attestation package that is verified registering the encryption & verification keys for the contract. Useful for building contracts that share secrets.

Update attestation test to use the new helpers. Replace the code in the attestation test with calls packaged in the attestation common contract code. Complete the implementation of the send/recv secret. Complete testing of the new methods.

@cmickeyb cmickeyb added the enhancement New feature or request label Jan 11, 2022
…tion

Two new classes of functions for the Wawaka common library:

* Secrets -- simplify (and standardize) generating messages that can be
shared between contracts; a message is encrypted with the contracts
encryption key.

* Attestation -- wrappers for the sgx report verification and processing
functions

Signed-off-by: Mic Bowman <mic.bowman@intel.com>
There are several methods that are common to many contracts. This
update provides a base implementation for those methods in order to
simplify contract development.

Add common contracts methods for attestations

Provides a wrapper for managing attested contract endpoints.
Contract object provides an attestation package that is verified
registering the encryption & verification keys for the contract.
Useful for building contracts that share secrets.

Signed-off-by: Mic Bowman <mic.bowman@intel.com>
Replace the code in the attestation test with calls packaged
in the attestation common contract code.

Complete the implementation of the send/recv secret.

Complete testing of the new methods.

Signed-off-by: Mic Bowman <mic.bowman@intel.com>
Copy link
Member

@marcelamelara marcelamelara left a comment

Choose a reason for hiding this comment

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

I mostly have comments about naming functions to be a bit more precise/descriptive, but the implementation LGTM.

contracts/wawaka/common/contract/base.h Show resolved Hide resolved
contracts/wawaka/common/StateReference.cpp Outdated Show resolved Hide resolved
contracts/wawaka/common/StateReference.cpp Show resolved Hide resolved
contracts/wawaka/common/Secret.h Show resolved Hide resolved
contracts/wawaka/common/Secret.h Show resolved Hide resolved
Copy link
Member

@bvavala bvavala left a comment

Choose a reason for hiding this comment

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

Mostly some clarifying questions

contracts/wawaka/common/Secret.cpp Outdated Show resolved Hide resolved
contracts/wawaka/common/Secret.h Show resolved Hide resolved
contracts/wawaka/common/Secret.h Show resolved Hide resolved
contracts/wawaka/common/contract/attestation.cpp Outdated Show resolved Hide resolved
Mostly added comments and adjusted permissions on some of the
methods in the attestation contract. Changed the code metadata
to return the code hash. In theory that change isn't necessary
but it does make things easier for some contracts.

Signed-off-by: Mic Bowman <mic.bowman@intel.com>
Copy link
Member

@bvavala bvavala left a comment

Choose a reason for hiding this comment

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

clear for me!

Copy link
Member

@marcelamelara marcelamelara left a comment

Choose a reason for hiding this comment

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

LGTM

@bvavala bvavala merged commit aa2ba6e into hyperledger-labs:main Feb 1, 2022
@cmickeyb cmickeyb deleted the mic.jan11.contracts branch January 25, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants