-
Notifications
You must be signed in to change notification settings - Fork 32
feat async v3 #892
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
base: master
Are you sure you want to change the base?
feat async v3 #892
Conversation
V1.7 to asnyc v3 14 feb
merge V1.7 to async v3
…todos refactor output in case of error for async callback and empty function name check
return nil, vmhost.ErrNilEnableEpochsHandler | ||
} | ||
err := core.CheckHandlerCompatibility(hostParameters.EnableEpochsHandler, allFlags) | ||
err := core.CheckHandlerCompatibility(hostParameters.EnableEpochsHandler, []core.EnableEpochFlag{}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you need allFlags
returnCode := context.resolveReturnCodeFromError(err) | ||
returnMessage := context.resolveReturnMessageFromError(err) | ||
|
||
if context.host.EnableEpochsHandler().IsFlagEnabled(vmhost.AsyncV3Flag) && callType == vm.AsynchronousCallBack { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is ok, also you should check whether the async call was of type v3.
} | ||
|
||
func (host *vmHost) checkValidFunctionName(name string) error { | ||
if name == "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we have a function validator when we deploy the contracts. Use that.
// CreateAsyncV3Call VMHooks implementation. | ||
// @autogenerate(VMHooks) | ||
func (context *VMHooksImpl) CreateAsyncV3Call( | ||
destOffset executor.MemPtr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everything should be managed. not PTR. Or have the same call with managed buggers as well.
gas int64, | ||
extraGasForCallback int64, | ||
) int32 { | ||
calledSCAddress, err := context.MemLoad(destOffset, vmhost.AddressLen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gas should be used before making any kind of load.
CallbackClosure []byte | ||
|
||
IsBuiltinFunctionCall bool | ||
IsAsyncV3 bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not backward compatible.
refactors, callback order, gas lock, results accumulation