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

ADR1 #2

Closed
wants to merge 10 commits into from
Closed

ADR1 #2

wants to merge 10 commits into from

Conversation

Kukovec
Copy link
Collaborator

@Kukovec Kukovec commented Apr 3, 2024

Adds initial design documentation.

Rendered doc

@Kukovec Kukovec requested a review from konnov April 3, 2024 10:17
@Kukovec
Copy link
Collaborator Author

Kukovec commented Apr 3, 2024

@thpani @andrey-kuprianov pinging since I can't set reviewers

@konnov konnov requested review from thpani and konnov and removed request for konnov and thpani April 3, 2024 10:33
@konnov
Copy link
Contributor

konnov commented Apr 3, 2024

@thpani @andrey-kuprianov pinging since I can't set reviewers

This looks like a constraint somewhere in the project settings

Copy link
Contributor

@konnov konnov left a comment

Choose a reason for hiding this comment

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

I am not certain about the data structures supported by Soroban. Shall we add a quick research and add a summary here?

doc/ADR/ADR_001.md Outdated Show resolved Hide resolved
doc/ADR/ADR_001.md Outdated Show resolved Hide resolved
doc/ADR/ADR_001.md Outdated Show resolved Hide resolved
doc/ADR/ADR_001.md Outdated Show resolved Hide resolved
doc/ADR/ADR_001.md Outdated Show resolved Hide resolved
doc/ADR/ADR_001.md Outdated Show resolved Hide resolved
2. Creating `.json`-format TLA+ input (Apalache specific)

## Solution
Regarding Smart contracts, I propose using JSON directly (1.), as it seems unlikely that we'd want to implement significantly broader capabilities for smart contracts in Solarkraft.
Copy link
Contributor

Choose a reason for hiding this comment

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

I am still not sure about JSON. Remember, we had to make a few decisions in the ITF format. Actually, why don't we just use the same fragment as in ITF?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I mean, we can use the same fragment, the point I was trying to make is that instead of designing an IR for State, we write State directly as JSON. The format of that JSON is an orthogonal issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we can write it in json and map it to rust with serde

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree with Igor, it's not like State maps 1:1 onto JSON types.
Would be good to record this somewhere.

## Solution
Regarding Smart contracts, I propose using JSON directly (1.), as it seems unlikely that we'd want to implement significantly broader capabilities for smart contracts in Solarkraft.

Regarding the Monitor Executor, I propose implementing direct name matching initially (1.1.), as it should be easy enough to implement (1.2.) in the future, should we have a need for it.
Copy link
Contributor

Choose a reason for hiding this comment

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

+1 for one-to-one name matching.

Copy link
Collaborator

@thpani thpani left a comment

Choose a reason for hiding this comment

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

Thanks for the write-up, clear presentation so far!

Some things that I'm missing in the current exposition:

  1. You introduce the Smart Contract Interface in the beginning, but it's not clear to me how interactions are passed between the Extractor and Executor.

  2. Are there any pitfalls with EXTENDing the monitor spec?
    How would it look in practice?

I think it would help to take a toy example (e.g. one of the example contracts) and take it through the proposed steps here manually.

doc/ADR/ADR_001.md Outdated Show resolved Hide resolved
doc/ADR/ADR_001.md Outdated Show resolved Hide resolved
doc/ADR/ADR_001.md Outdated Show resolved Hide resolved
doc/ADR/ADR_001.md Show resolved Hide resolved
doc/ADR/ADR_001.md Outdated Show resolved Hide resolved
doc/ADR/ADR_001.md Outdated Show resolved Hide resolved
Comment on lines 113 to 118
1. Resolving names:
1. Require monitor names to match the names of the variables in smart contracts (and thus State) exactly
2. Implement a _name binding_ standard, for example a simple CSV file, which tells the executor which State fields correspond to which TLA+ state variables
2. Building TLA+:
1. Creating `.tla`-format files (such as those output as intermediate values by Apalache)
2. Creating `.json`-format TLA+ input (Apalache specific)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Renders as code block, please dedent.

doc/ADR/ADR_001.md Show resolved Hide resolved
2. Creating `.json`-format TLA+ input (Apalache specific)

## Solution
Regarding Smart contracts, I propose using JSON directly (1.), as it seems unlikely that we'd want to implement significantly broader capabilities for smart contracts in Solarkraft.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree with Igor, it's not like State maps 1:1 onto JSON types.
Would be good to record this somewhere.

[types]: https://developers.stellar.org/docs/learn/smart-contract-internals/types/custom-types
[RPC]: https://developers.stellar.org/network/soroban-rpc/methods
[RPCguide]: https://developers.stellar.org/docs/smart-contracts/guides/rpc
[gLE]: https://developers.stellar.org/docs/smart-contracts/guides/rpc/retrieve-contract-code-python
Copy link
Collaborator

Choose a reason for hiding this comment

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

not used anywhere?

@konnov konnov added this to the M1: Transaction extractor milestone Apr 8, 2024
@thpani
Copy link
Collaborator

thpani commented Jun 19, 2024

Superseded by ADR-002 and the storage docs: #53, #57

@thpani thpani closed this Jun 19, 2024
@thpani thpani mentioned this pull request Jun 19, 2024
Closed
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

Successfully merging this pull request may close these issues.

3 participants