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

Add support for non-mainnet request cache validation thresholds #3508

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Oct 10, 2024

  1. Add support for non-mainnet request cache validation thresholds:

    - If non-mainnet ethereum, allow the use of an integer value for the
      request cache validation threshold. Pre-configure "safe" default
      values for some common non-mainnet chain ids based on their
      varied finality mechanisms.
    
    - This integer value represents the number of seconds from time.now()
      that the request cache deems as a safe enough time window to allow
      the request to be cached.
    
    - Update the tests to reflect these changes.
    
    Bonus:
    
    - Add a note to the ``request_mocker`` to make sure that mocked results
      are of the correct expected types based on JSON-RPC spec (e.g. hex
      strings instead of ints for numbers, etc.)
    fselmo committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    313f3f0 View commit details
    Browse the repository at this point in the history
  2. Prevent recursion internally when caching requests; add tests:

    - In order to prevent recursion, we need to turn off caching while we
      make internal calls to get the block information we need. Turn it back
      on via a ``finally`` so we are sure to turn it back on.
    
    - Add some comprehensive tests for the now complex request caching
      functionality due to multi-chain support and internal-based
      caching threshold configuration.
    fselmo committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    213bd59 View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2024

  1. Configuration menu
    Copy the full SHA
    84d3234 View commit details
    Browse the repository at this point in the history