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

Improvements to slotting conversions / TimeInterpreter #1943

Merged
merged 13 commits into from
Jul 28, 2020

Commits on Jul 28, 2020

  1. Use MVar instead of TVar (Maybe ) to store TimeInterpreter

    On launch, the TimeInterpreter may not have been fetched from the node.
    
    Instead returning the singleEraInterpreter for the first era, it seems
    safer to block until fetched.
    
    I imagine there could be race conditions where we would sometimes return
    completely wrong time data when in Shelley, just after starting the
    node. Not completely sure, but I hope there shouldn't be any drawbacks
    with blocking.
    Anviking authored and KtorZ committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    42dc9fc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c1e8b17 View commit details
    Browse the repository at this point in the history
  3. Simplify constructors of TimeInterpreter

    Anviking authored and KtorZ committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    e4a754e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c5794e7 View commit details
    Browse the repository at this point in the history
  5. Add endTimeOfEpoch and test

    Anviking authored and KtorZ committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    3e9ed4e View commit details
    Browse the repository at this point in the history
  6. Make network_tip and next_epoch optional

    If the node is not enough in-sync, we cannot know them.
    Anviking authored and KtorZ committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    8845de8 View commit details
    Browse the repository at this point in the history
  7. Use TimeInterpreter for pool retirements

    Anviking authored and KtorZ committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    b30a596 View commit details
    Browse the repository at this point in the history
  8. Lower MsgInterpreterPastHorizon to Error

    Anviking authored and KtorZ committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    5d0bd90 View commit details
    Browse the repository at this point in the history
  9. *If* the time of the tip ever fails, don't crash

    But rather respond with NotResponding.
    Anviking authored and KtorZ committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    fd3af1c View commit details
    Browse the repository at this point in the history
  10. Fix overflow in syncProgress calculation

    Anviking authored and KtorZ committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    8954723 View commit details
    Browse the repository at this point in the history
  11. Add regression test for syncProgress overflow

    It fails without the recent fix
    Anviking authored and KtorZ committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    39c4106 View commit details
    Browse the repository at this point in the history
  12. remove 'unsafeRunExceptT' calls on the time interpreter

      Instead, we do not push the exception down to every caller but rather, throw it as an exception in the network layer. The rationale is that, this exception can only occur when both conditions are met:
    
      a) The node is still syncing and doesn't yet know about any hard-fork.
      b) A time beyond the node's foreseeable future is queried.
    
      While syncing in Byron these two conditions can't be met (times referenced in blocks are neccessarily before the node's tip and can't be beyond its foreseeable future. There's the case of delegation certificates and or transaction TTL but these only exists in Shelley, where the foreseeable future is so far, unlimited.
      Yet, there are points in the API where a time that is far beyond the node's tip can be provided and that is:
    
      - As filtering parameter when listing transactions.
      - As current time when looking at network parameters.
    Anviking authored and KtorZ committed Jul 28, 2020
    Configuration menu
    Copy the full SHA
    9405535 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    c46082b View commit details
    Browse the repository at this point in the history