Skip to content
This repository was archived by the owner on Oct 25, 2021. It is now read-only.

Conversation

YaronWittenstein
Copy link
Contributor

@YaronWittenstein YaronWittenstein commented Sep 11, 2021

In order to streamline things regarding the SVM integration - this API documents in high-level how the go-svm new API will look

@YaronWittenstein YaronWittenstein self-assigned this Sep 11, 2021
@YaronWittenstein YaronWittenstein added documentation Improvements or additions to documentation svm labels Sep 11, 2021
@YaronWittenstein YaronWittenstein marked this pull request as ready for review September 11, 2021 17:18
Copy link
Member

@noamnelke noamnelke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only had one comment, I think everything else we discussed is covered here 👍🏻

(we also discussed having a CLI for encoding transactions and possibly pre-generating addresses, but I think this is off-topic for this readme)


Go bindings for [SVM](https://github.com/spacemeshos/svm)

## Project structure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README shouldn't be used only for High-level API specs. You can leave the existed info as is, at least until we'll do some changes there.

Each `Message` will be accompanied by the `Envelope` to form together a complete binary Transaction.

In addition to the explicit data sent over-the-wire, there will be implicit fields inferred from it.
One such example, is the `Transaction Id`. For the context of this document, we won't regard these implied fields as part of the Transaction.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plz elaborate on who's side role is it to infer these fields (specifically Transaction Id), and how.


- `Deploy Message` - For deploying Templates.
- `Spawn Message` - For Spawning new accounts out of existing Templates.
- `Call Message` - For calling an existing accounts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"For calling an existing accounts." -> "For calling a function on an existing account." ?


### Deploy Message

The `Deploy Message` will be generated by the `Template compiler`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate more on that? What exactly is the Template compiler, how should it be used, etc.

### Deploy Message

The `Deploy Message` will be generated by the `Template compiler`.
Right now it'll be using the `SVM SDK`, but in the future there might be more ways to achieve that.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SVM SDK -- plz provide a link for more info.


#### Call

Performs the actual calling an `Account`. Returns a `CallReceipt` in return.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason why you didn't include Call function signature?

### Verify

Performs the `verify` stage as dictated by the [Account Unification](https://github.com/spacemeshos/SMIPS/issues/49) design.
Since the `verify` flow involves the running Wasm function as done when running a `Call` transaction, the output will be of type `CallReceipt` as well.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it end up returning only a boolean value?


### Rewind

Rewinds the `Global State` to an historical layer.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate more on the use-case and how should it be used? Also, it's not clear from what SVM gets its notion of layers.

func Commit(rt Runtime) State
```

If the persistence operation failed - then it's an undefined behavior.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it may fail due to internal issues, why isn't it returning an error as well?

### SvmError

```go
struct SvmError {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plz elaborate more on this.
Also, you described other types' fields with a bulleted list. Any reason why it's different here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation svm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants