You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given this currently valid Gno program (but invalid Go program)
package main
funcmain(){
constc1=1<8main()
1
}
The mechanism to get things running is to invoke transpiler.Machine.Run which is alright for starters. However, that means that the program passed in cannot be terminated unless by killing the entire process.
Suggestion
For a smart contracting platform and place where running programs can cause losses of money and sensitive information, I highly advise introducing a new method (*Machine).RunContext(context.Context) which runs until the input context is terminated with if err := ctx.Error(); err != nil or <-ctx.Done()
That gives much finer grained control to running programs and paves way for dApps like cloud compute renting because instead of forking process using os/exec.Command*, one can allow programs to be ran in-process with a gas meter that's timed or depending on machine ticks. Even better it allows for much better testing because I've been doing analyses for programs that are valid in Gno yet invalid in Go and the lack of this fine grained control makes it hard to easily continue.
Description
While investigating #3426, I had some insights:
Given this currently valid Gno program (but invalid Go program)
The mechanism to get things running is to invoke transpiler.Machine.Run which is alright for starters. However, that means that the program passed in cannot be terminated unless by killing the entire process.
Suggestion
For a smart contracting platform and place where running programs can cause losses of money and sensitive information, I highly advise introducing a new method
(*Machine).RunContext(context.Context)
which runs until the input context is terminated withif err := ctx.Error(); err != nil
or<-ctx.Done()
That gives much finer grained control to running programs and paves way for dApps like cloud compute renting because instead of forking process using os/exec.Command*, one can allow programs to be ran in-process with a gas meter that's timed or depending on machine ticks. Even better it allows for much better testing because I've been doing analyses for programs that are valid in Gno yet invalid in Go and the lack of this fine grained control makes it hard to easily continue.
Kindly cc-ing @thehowl @petar-dambovaliev @jaekwon @moul
The text was updated successfully, but these errors were encountered: