Skip to content

System Test: Applications work with state archival #70

@sreuland

Description

@sreuland

What problem does your feature solve?

no coverage over aspects of state expiration and eviction on ledger entries and the expectation on how downstream applications should participate with it.

What would you like to see?

New test feature - Applications participate with State Archival. The feature is a test suite, it can provide multiple test cases specific to triggering aspects of state archival, each case has multiple steps and assertions.

  • Contract code expiry:
           compile contract using cli ->
           install contract code in js/cli -> 
           deploy contract code in js/cli -> 
           wait, let it expire after 10 ledgers -> 
           use js/cli to invoke fn on expired contract -> 
           assert whether it gets error on invoke or autorestore? -> 
           if error, no autorestore expected ->
             use js/cli to restore contract ->
             use js/cli to invoke fn on restored contract ->
             assert success
           assert success
             
    
  • Contract code eviction: similar to Contract code expiry test case, waits additional ledger's time to allow eviction to be triggered first.
  • Contract data expiry:
      compile contract using cli ->
      install contract code in js/cli -> 
      deploy contract code in js/cli ->
      use js/cli to invoke contract fn -> 
      contract creates ledger entries for data  ->
      wait, let contract data ledger entry expire after 10 ledgers ->
      use js/cli to invoke fn on contract that attempts to access expired data entries -> 
      assert outcome, should entries be autorestored through tx sim and no error or error? -> 
      if error, no autorestore expected ->
        use js/cli to restore contract ->
        use js/cli to invoke fn on restored contract ->
        assert success
      assert success  
  • Contract data eviction: similar to Contract data expiry test case, waits additional ledger's time to allow eviction to be triggered first.
  • others ...

Identify how expired/evicted behavior can be triggered on the target network during the test timeframe. This seems like it will only be possible on a 'local' network in the quickstart container and have ability to set the core flags forOVERRIDE_EVICTION_PARAMS_FOR_TESTING and TESTING_* to accelerate the expiration/expiry timeframes down to a couple ledgers of minimal time.

Since these tests likely will require only running against a 'local' network, the test runtime should skip running this Feature if TARGET_NETWORK=local is not present on test runtime and log out that it skipped due to the local network requirement.

The contracts themselves which tests use can come from stellar/soroban-examples. Unless, these test cases can benefit from new contract which is purpose built to enable testing expiration in which case the new contract rust code should be maintained internally in system-test.

What alternatives are there?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    To Do

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions