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

Design medium-level abstractions for smart contracts - Fleetwood™ #18

Closed
Robbepop opened this issue Feb 6, 2019 · 4 comments
Closed
Labels
B-design Designing a new component, interface or functionality.

Comments

@Robbepop
Copy link
Collaborator

Robbepop commented Feb 6, 2019

Regarding https://github.com/paritytech/fleetwood.

Description

Current pDSL has a low level abstraction called the pdsl_core that offers core abstractions to work only on a very thin layer on top of the foundations that have been built for SRML smart contracts.

Then there are plans for a very high level eDSL that is going to be based on the Rust programming language and offers all niceties that users might expect from a language that is specific to the domain of smart contracts. (DSL)

Fleetwood

Fleetwood on the other hand offers what I would call a medium abstraction.
It is no real domain specific language nor forces it users to work on the bare metal foundations.

In essence Fleetwood provides data structures to virtually represent the structure of smart contracts.
This can be seen as an abstract representation that could be further utilized by users or systems.

About

This issue tracks progress and ideas around having a medium abstraction layer similar to https://github.com/paritytech/fleetwood for pDSL. It also tracks ideas about how we could eventually build an upcoming eDSL that is planned on top of it instead of the bare metal low-level abstractions.

Future Goal

So with this medium level abstraction built into the pDSL framework we would have the following structure
of working with smart contracts:

  • Low-Level
    • pDSL's core (aka pdsl_core)
      • Provides bare metal access to the foundational abstractions.
      • Users can do unsafe things that will probably result in malicious contracts.
  • Medium-Level
    • fleetsteel (aka Fleetwood style abstractions)
      • Provides a standard model to operate with smart contracts.
      • Just enough abstraction over the bare metal to protect users from most stupid mistakes.
      • Users disliking the eDSL could invent their own version of it based on this medium level abstraction.
  • High-Level
    • pDSL's eDSL
      • Provides the highest level abstractions and a Rust based DSL
      • Users have the least freedom but should profit from the most secure environment to write Wasm smart contracts
@Robbepop Robbepop changed the title Figure out a decent abstract representation for smart contracts [Fleetwood™] Design medium-level abstractions for smart contracts [Fleetwood™] Feb 6, 2019
@Robbepop Robbepop added B-design Designing a new component, interface or functionality. A-eDSL Concerning the Rust eDSL as a total. labels Feb 6, 2019
@Robbepop Robbepop changed the title Design medium-level abstractions for smart contracts [Fleetwood™] Design medium-level abstractions for smart contracts - Fleetwood™ Feb 6, 2019
@Robbepop
Copy link
Collaborator Author

Robbepop commented Feb 12, 2019

Commit 64aa222 implements the foundations for the upcoming medium level abstractions inspired by Fleetwood.

Visit https://github.com/Robbepop/pdsl/tree/master/model/examples for some not yet completely working examples. Note that this is very experimental and very unstable.

Visit https://github.com/Robbepop/pdsl/tree/master/model/ for a general overview of the new crate.

@Robbepop Robbepop added A-pdsl_model and removed A-eDSL Concerning the Rust eDSL as a total. labels Feb 15, 2019
@Robbepop
Copy link
Collaborator Author

Commit 1d9bb5f and the few previous implement some of the final things that have been missing. This represents a very raw and still majorly untested implementation of the Fleetwood abstractions.

Also they are not recommended to be used since they lack proper compile-time functionality for critical parts and still do not produce automatic message selectors; instead the user has to define them themselves which is far from an optimal user experience.

@Robbepop
Copy link
Collaborator Author

Robbepop commented Feb 18, 2019

Some future enhancements:

  • Only flush the state if the called message was possibly mutating it. So calling a message that was not registered as mut shall not require to flush the state after its call. Note that this is already done halfway through the pdsl_core since it will itself only flush state that could have been possibly mutated. However, in the pdsl_model we can still optimize this to avoid the call to flush in statically.

@Robbepop
Copy link
Collaborator Author

Since all of this has been implement long ago and is considered to be stable (enough) I am going to close this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-design Designing a new component, interface or functionality.
Projects
None yet
Development

No branches or pull requests

1 participant