Skip to content

Conversation

@cmickeyb
Copy link
Contributor

@cmickeyb cmickeyb commented Jun 11, 2025

A number of relatively small fixes.

  1. reduce the verbosity of one error message
  2. remove the secp256k1 python module from dependencies
  3. address the new way that setuptools installs extra binaries

Note... there is a bigger problem that has to be addressed with the python package structure to bring it up to date with best practices.

Signed-off-by: Mic Bowman <mic.bowman@intel.com>
@cmickeyb cmickeyb requested a review from Copilot June 11, 2025 22:42
@cmickeyb cmickeyb self-assigned this Jun 11, 2025

This comment was marked as outdated.

cmickeyb and others added 3 commits June 11, 2025 16:43
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Mic Bowman <cmickeyb@gmail.com>
Signed-off-by: Mic Bowman <mic.bowman@intel.com>
The current version of python setuptools no longer puts binary files
in the same name directory tree as the python libraries. As a result,
the eservice and pservice enclaves could not be found and loaded.

This commit addresses the problem with several changes:

1) the names of the enclave libraries are now unique
(libpdo-eservice-enclave.signed.so and
libpdo-pservice-enclave.signed.so)

2) the enclave libraries are installed into the PDO_HOME directory
tree (in the lib directory). This directory is now created when the
rest of the enviroment is created.

3) the search path used by the pservice and eservice python
modules reflect the new location.

4) cachetools is explicitly installed

Signed-off-by: Mic Bowman <mic.bowman@intel.com>
@cmickeyb cmickeyb changed the title Make the exception log go away if shell verbose mode is set Several relatively small fixes primarily motivated by changes in the python setuptools Jun 17, 2025
@cmickeyb cmickeyb requested a review from Copilot June 17, 2025 23:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the Python packaging and enclave library handling to align with recent setuptools changes, removes the unused secp256k1 dependency, and standardizes binary and project naming for both pservice and eservice.

  • Remove secp256k1 imports and wrapper class; update Python requirements.
  • Introduce lib install directory in setup scripts and update enclave binary names.
  • Refactor enclave library lookup to use find_file_in_path, adjust logging and error reporting.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
python/pdo/common/keys.py Drop secp256k1 import and TransactionKeys class
pservice/setup.py Add lib_dir mapping; rename enclave shared object
pservice/pdo/pservice/pdo_enclave.py Refactor __find_enclave_library; adjust logging and config
pservice/lib/libpdo_enclave/CMakeLists.txt Rename project to libpdo-pservice-enclave
pservice/Makefile Update ENCLAVE_LIB path
eservice/setup.py Mirror setup changes for eservice
eservice/pdo/eservice/pdo_enclave.py Refactor lookup; hard-coded enclave count; logging fixes
eservice/lib/libpdo_enclave/CMakeLists.txt Rename project to libpdo-eservice-enclave
eservice/Makefile Update ENCLAVE_LIB path
client/pdo/client/builder/shell.py Log full exception only when verbose is enabled
build/python_requirements.txt Remove secp256k1; add cachetools
build/Makefile Create opt/pdo/lib directory
Comments suppressed due to low confidence (5)

pservice/pdo/pservice/pdo_enclave.py:153

  • Avoid hard-coding the number of enclaves; restore reading from config.get('NumberOfEnclaves', 1) or make it configurable again.
    if not _ias:

pservice/pdo/pservice/pdo_enclave.py:170

  • [nitpick] Using error for what appears to be informational debug output may clutter logs; consider using logger.debug or logger.info here instead.
            update_sig_rl()

pservice/pdo/pservice/pdo_enclave.py:178

  • [nitpick] This status message is not an error; switch to info or debug to reflect normal operation.
# -----------------------------------------------------------------

eservice/pdo/eservice/pdo_enclave.py:153

  • This hard-coded enclave count overrides configuration; consider restoring the original config.get('NumberOfEnclaves') logic.
    NumberOfEnclaves = 2

eservice/pdo/eservice/pdo_enclave.py:91

  • This raise appears after a return and will never execute; adjust indentation so the exception is thrown when lookup fails.
    raise IOError("Could not find enclave shared object: {}".format(enclave_file_name))

Signed-off-by: Mic Bowman <mic.bowman@intel.com>
@cmickeyb cmickeyb merged commit 31068c0 into hyperledger-labs:main Jun 18, 2025
5 checks passed
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.

1 participant