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 E2E tests for contract termination #899

Merged
merged 28 commits into from
Jul 26, 2022
Merged

Commits on Jul 20, 2022

  1. Add E2E test for contract migration

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 20, 2022
    Configuration menu
    Copy the full SHA
    4d14788 View commit details
    Browse the repository at this point in the history
  2. Make migration test do a V1 -> V2 migration

    While V2 -> V2 is also valuable, this is the more complex flow and therefore
    the most valuable to test.
    
    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 20, 2022
    Configuration menu
    Copy the full SHA
    9c65181 View commit details
    Browse the repository at this point in the history
  3. Bring back SPI route for resetting FireFly

    POST to /spi/reset will perform a soft restart of everything, including
    reloading the config from disk.
    
    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 20, 2022
    Configuration menu
    Copy the full SHA
    2180dfd View commit details
    Browse the repository at this point in the history
  4. Perform E2E reset with API rather than ff

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 20, 2022
    Configuration menu
    Copy the full SHA
    0a4e6b8 View commit details
    Browse the repository at this point in the history
  5. Clean up initialization of ff_system namespace

    Ensure the multiparty contract is configured early enough for the
    network version to be inspected during namespace init.
    
    Initialize ff_system if ANY namespace uses multiparty V1 (not just
    the default namespace).
    
    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 20, 2022
    Configuration menu
    Copy the full SHA
    0e8780d View commit details
    Browse the repository at this point in the history
  6. Add a cancellable context to blockchain/token events

    Allows callback handlers to wait on event processing to finish, if
    desired.
    
    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 20, 2022
    Configuration menu
    Copy the full SHA
    f642cbf View commit details
    Browse the repository at this point in the history
  7. Remove unnecessary use of bound_callbacks

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 20, 2022
    Configuration menu
    Copy the full SHA
    ee981ad View commit details
    Browse the repository at this point in the history
  8. Additional cleanup around ff_system

    Do not attempt to stop the ff_system orchestrator - it's actually possible that
    there may be unaggregated pins prior to the "terminate" event. Therefore, we
    must continue listening indefinitely even if the handler is likely to be idle.
    
    Also added some TODOs for next steps.
    
    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 20, 2022
    Configuration menu
    Copy the full SHA
    c9b1f45 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2022

  1. update namespace & orchestrator tests

    Signed-off-by: Alex Shorsher <alex.shorsher@kaleido.io>
    shorsher committed Jul 21, 2022
    Configuration menu
    Copy the full SHA
    8a1b061 View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'upstream/main' into e2e

    Signed-off-by: Alex Shorsher <alex.shorsher@kaleido.io>
    shorsher committed Jul 21, 2022
    Configuration menu
    Copy the full SHA
    2cabfb8 View commit details
    Browse the repository at this point in the history
  3. check terminated contract versions for v1

    Signed-off-by: Alex Shorsher <alex.shorsher@kaleido.io>
    shorsher committed Jul 21, 2022
    Configuration menu
    Copy the full SHA
    f46b501 View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2022

  1. updated namespace manager tests

    Signed-off-by: Alex Shorsher <alex.shorsher@kaleido.io>
    shorsher committed Jul 22, 2022
    Configuration menu
    Copy the full SHA
    281d643 View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2022

  1. Update CLI version in manifest

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 25, 2022
    Configuration menu
    Copy the full SHA
    96a2cb2 View commit details
    Browse the repository at this point in the history
  2. Fix test filename

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 25, 2022
    Configuration menu
    Copy the full SHA
    f03be50 View commit details
    Browse the repository at this point in the history
  3. Move contract version into "info" struct

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 25, 2022
    Configuration menu
    Copy the full SHA
    351c443 View commit details
    Browse the repository at this point in the history
  4. Misc log and comment cleanup

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 25, 2022
    Configuration menu
    Copy the full SHA
    aaac857 View commit details
    Browse the repository at this point in the history
  5. Remove FireFly subscription before changing active contract

    Also remove duplicate caching of network version.
    
    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 25, 2022
    Configuration menu
    Copy the full SHA
    39a5f4d View commit details
    Browse the repository at this point in the history
  6. Remove duplicate call to ConfigureContract

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 25, 2022
    Configuration menu
    Copy the full SHA
    a8a638f View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2022

  1. Allow tx IDs to be reused on different namespaces

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    54c2409 View commit details
    Browse the repository at this point in the history
  2. Match V1 batch events to the appropriate subscription to avoid duplic…

    …ates
    
    If a subscription was created with a valid namespace name, and a V1 BatchPin
    event is received on that subsscription with a different namespace name
    embedded, simply drop it at the plugin layer. This will avoid passing an
    extra de-duplication burden up to the event managers.
    
    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    b820899 View commit details
    Browse the repository at this point in the history
  3. Wait for termination event instead of using sleep

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    879aa82 View commit details
    Browse the repository at this point in the history
  4. Record network action events on every namespace that receives them

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    e5ca216 View commit details
    Browse the repository at this point in the history
  5. There Can Only Be One [multiparty V1 contract]

    Because ff_system is global, the contract instance is global. The address
    can never change, and a second V1 contract can never be used. Adjust the
    core logic to enforce this.
    
    This also means splitting the E2E suite, as a V2->V2 migration is simple
    to test over and over, but a V1->V2 migration can only be done once per
    stack. This special test will have to be run infrequently under controlled
    circumstances.
    
    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    9d1d635 View commit details
    Browse the repository at this point in the history
  6. Group test runners together in one folder

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    5fa0571 View commit details
    Browse the repository at this point in the history
  7. Fix linting errors in tests

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    1fc8c05 View commit details
    Browse the repository at this point in the history
  8. Fix GET for namespace

    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    d6d1095 View commit details
    Browse the repository at this point in the history
  9. Remove duplicate insert of namespace

    This is already handled by namespace manager, not orchestrator.
    
    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    4791ee7 View commit details
    Browse the repository at this point in the history
  10. Namespace manager should own all namespace objects

    Pass around a pointer to orchestrator and any children, but retain a single
    copy of the namespace owned by namespace manager. Also use pointers for the
    contract information to avoid unnecessary copies.
    
    Signed-off-by: Andrew Richardson <andrew.richardson@kaleido.io>
    awrichar committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    eb2afa8 View commit details
    Browse the repository at this point in the history