Skip to content

Conversation

laurci
Copy link
Contributor

@laurci laurci commented Oct 30, 2024

refactors, callback order, gas lock, results accumulation

@laurci laurci changed the base branch from rc/barnard to master July 28, 2025 08:37
return nil, vmhost.ErrNilEnableEpochsHandler
}
err := core.CheckHandlerCompatibility(hostParameters.EnableEpochsHandler, allFlags)
err := core.CheckHandlerCompatibility(hostParameters.EnableEpochsHandler, []core.EnableEpochFlag{})
Copy link
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

returnCode := context.resolveReturnCodeFromError(err)
returnMessage := context.resolveReturnMessageFromError(err)

if context.host.EnableEpochsHandler().IsFlagEnabled(vmhost.AsyncV3Flag) && callType == vm.AsynchronousCallBack {
Copy link
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
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.

// CreateAsyncV3Call VMHooks implementation.
// @autogenerate(VMHooks)
func (context *VMHooksImpl) CreateAsyncV3Call(
destOffset executor.MemPtr,
Copy link
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.

gas int64,
extraGasForCallback int64,
) int32 {
calledSCAddress, err := context.MemLoad(destOffset, vmhost.AddressLen)
Copy link
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.

CallbackClosure []byte

IsBuiltinFunctionCall bool
IsAsyncV3 bool
Copy link
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