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

ADR-05: run trace against testnet #13

Open
andrey-kuprianov opened this issue Jul 13, 2022 · 1 comment
Open

ADR-05: run trace against testnet #13

andrey-kuprianov opened this issue Jul 13, 2022 · 1 comment
Assignees

Comments

@andrey-kuprianov
Copy link
Contributor

andrey-kuprianov commented Jul 13, 2022

Background/Motivation

The user has generated a test trace in the ITF format, and wants to execute it against the testnet, so that to make sure the testnet behaves as expected.

Linked documents: ADR

Description

The format of the proposed CLI command is:

atomkraft run <trace>

where:

  • <trace> is the (path to) ITF trace;

Upon successful execution the user is notified about it; no further action is necessary. Upon unsuccessful execution, the error should be presented to the user, and all the information needed to reproduce the error should be saved (details to be clarified).

Prerequisites

  • Atomkraft can communicate with the blockchain (init command has been successful)
  • The blockchain reactor is available (reactor command has been executed, and the user has filled the reactor stub with the method implementations)
  • The reactor has all methods implemented correctly

Technical details

  • The implementation should be able to efficiently check the above prerequisites.
    • E.g. for the first two, the project configuration should hold the entries, showing that the respective commands have been executed.
    • The pointers to the setup script, and to the reactor should be present in the configuration, such that they are picked up by this implementation.
  • While the above commands could have been executed successfully, it doesn't guarantee that the pieces match together. E.g. the errors below may happen, and should be differentiated from the real errors (mismatch of trace expectations to the behavior of the blockchain)
    • init might have been executed, but the blockchain binary was moved, or vanished from the PATH, or changed.
    • reactor has been executed, but the list of actions for which the stub was generated doesn't cover all actions present in the trace.
    • Reactor stub has been filled, but the file doesn't compile, or some error in one of the action handlers occurs at runtime.
  • When a real error in the testnet occurs:
    • the error summary needs to be presented to the user
    • the error details need to be saved, for possible later inspection:
      • the trace
      • the blockchain configuration
      • the setup and reactor scripts
      • the complete output
@ivan-gavran
Copy link
Collaborator

The description looks good.

There is one major thing worth discussing in our meeting: this issue uses a lot the statefulness of the CLI.
Is this a good thing, to assume CLI to be stateful? I am unsure.

If we decide to have a stateful CLI, then we need to agree on how all the components would communicate (e.g., a shared config files with flags corresponding to whether prerequisite commands have been executed, which reactor file to use etc.).

If, on the contrary, we decide against sharing state, then the command atomkraft run trace reactor chain.

I am genuinely unsure about whether having a stateful CLI is good or bad (not advocating for the latter).

@andrey-kuprianov andrey-kuprianov added this to the Atomkraft prototype milestone Jul 14, 2022
@andrey-kuprianov andrey-kuprianov changed the title Prototype: run trace against testnet ADR-05: run trace against testnet Jul 14, 2022
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

No branches or pull requests

2 participants