Skip to content

Audit fixes #18

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Audit fixes #18

wants to merge 4 commits into from

Conversation

SCMusson
Copy link
Collaborator

Starting on audit recommendations. The following are implemented

  • lru_cache on uplc_unflat
  • Evaluation of scripts can't use more resources than defined in protocol
  • For submit_tx calls, check requested ExUnits are valid before execution.
  • Maximum transaction size limits.

For allowing sessions to be shared between server workers the only real in-memory solution I can find seems to be using Redis.
This requires a Redis server to be set up in the background and currently I am just pickling entire Sessions for every API call.
Redis could also provide solutions for rate limiting and session cleanup which I will look into if we decide to move forward with Redis.

TODO assuming we move forward with Redis:

  • Rate limiting
  • Session cleanup
  • Some Caching solution for sessions rather than retrieving and unpickling every API call.
  • Refactor object serialisation by replacing full-object pickling with a more granular strategy, enabling selective updates and reducing unnecessary overhead.

The only other solutions I can think of for sharing sessions among workers is some kind of database. Redis, being in-memory, should be faster.

@coveralls
Copy link

coveralls commented Apr 20, 2025

Pull Request Test Coverage Report for Build 14646549674

Details

  • 38 of 111 (34.23%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-2.9%) to 82.508%

Changes Missing Coverage Covered Lines Changed/Added Lines %
plutus_bench/mock.py 18 36 50.0%
plutus_bench/mockfrost/server.py 18 73 24.66%
Files with Coverage Reduction New Missed Lines %
plutus_bench/mockfrost/server.py 1 46.77%
Totals Coverage Status
Change from base Build 13635867589: -2.9%
Covered Lines: 1599
Relevant Lines: 1938

💛 - Coveralls

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