Skip to content

feat async v3#892

Draft
laurci wants to merge 27 commits into
masterfrom
async-v3
Draft

feat async v3#892
laurci wants to merge 27 commits into
masterfrom
async-v3

Conversation

@laurci

@laurci laurci commented Oct 30, 2024

Copy link
Copy Markdown

refactors, callback order, gas lock, results accumulation

@laurci laurci changed the base branch from rc/barnard to master July 28, 2025 08:37
Comment thread vmhost/hostCore/host.go
return nil, vmhost.ErrNilEnableEpochsHandler
}
err := core.CheckHandlerCompatibility(hostParameters.EnableEpochsHandler, allFlags)
err := core.CheckHandlerCompatibility(hostParameters.EnableEpochsHandler, []core.EnableEpochFlag{})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

here you need allFlags

Comment thread vmhost/contexts/output.go
returnCode := context.resolveReturnCodeFromError(err)
returnMessage := context.resolveReturnMessageFromError(err)

if context.host.EnableEpochsHandler().IsFlagEnabled(vmhost.AsyncV3Flag) && callType == vm.AsynchronousCallBack {

Copy link
Copy Markdown
Contributor

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 == "" {

Copy link
Copy Markdown
Contributor

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.

Comment thread vmhost/vmhooks/baseOps.go
// CreateAsyncV3Call VMHooks implementation.
// @autogenerate(VMHooks)
func (context *VMHooksImpl) CreateAsyncV3Call(
destOffset executor.MemPtr,

Copy link
Copy Markdown
Contributor

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.

Comment thread vmhost/vmhooks/baseOps.go
gas int64,
extraGasForCallback int64,
) int32 {
calledSCAddress, err := context.MemLoad(destOffset, vmhost.AddressLen)

Copy link
Copy Markdown
Contributor

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.

Comment thread vmhost/asyncCall.go
CallbackClosure []byte

IsBuiltinFunctionCall bool
IsAsyncV3 bool

Copy link
Copy Markdown
Contributor

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.

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.

2 participants