executor

package
v0.43.1-rc.1.access-me... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2025 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComparingScriptExecutor

type ComparingScriptExecutor struct {
	// contains filtered or unexported fields
}

func NewComparingScriptExecutor

func NewComparingScriptExecutor(
	log zerolog.Logger,
	metrics module.BackendScriptsMetrics,
	scriptCache *LoggedScriptCache,
	localExecutor ScriptExecutor,
	execNodeExecutor ScriptExecutor,
) *ComparingScriptExecutor

func (*ComparingScriptExecutor) Execute

func (c *ComparingScriptExecutor) Execute(ctx context.Context, request *Request) ([]byte, time.Duration, error)

type ENScriptExecutor

type ENScriptExecutor struct {
	// contains filtered or unexported fields
}

func (*ENScriptExecutor) Execute

func (e *ENScriptExecutor) Execute(ctx context.Context, request *Request) ([]byte, time.Duration, error)

type FailoverScriptExecutor

type FailoverScriptExecutor struct {
	// contains filtered or unexported fields
}

func NewFailoverScriptExecutor

func NewFailoverScriptExecutor(localExecutor ScriptExecutor, execNodeExecutor ScriptExecutor) *FailoverScriptExecutor

func (*FailoverScriptExecutor) Execute

func (f *FailoverScriptExecutor) Execute(ctx context.Context, request *Request) ([]byte, time.Duration, error)

type LocalScriptExecutor

type LocalScriptExecutor struct {
	// contains filtered or unexported fields
}

func NewLocalScriptExecutor

func NewLocalScriptExecutor(
	log zerolog.Logger,
	metrics module.BackendScriptsMetrics,
	executor execution.ScriptExecutor,
	scriptCache *LoggedScriptCache,
) *LocalScriptExecutor

func (*LocalScriptExecutor) Execute

func (l *LocalScriptExecutor) Execute(ctx context.Context, r *Request) ([]byte, time.Duration, error)

type LoggedScriptCache

type LoggedScriptCache struct {
	// contains filtered or unexported fields
}

func NewLoggedScriptCache

func NewLoggedScriptCache(log zerolog.Logger, loggedScripts *lru.Cache[[md5.Size]byte, time.Time]) *LoggedScriptCache

func (*LoggedScriptCache) LogExecutedScript

func (s *LoggedScriptCache) LogExecutedScript(
	blockID flow.Identifier,
	scriptHash [md5.Size]byte,
	executionTime time.Time,
	address string,
	script []byte,
	dur time.Duration,
)

func (*LoggedScriptCache) LogFailedScript

func (s *LoggedScriptCache) LogFailedScript(
	blockID flow.Identifier,
	scriptHash [md5.Size]byte,
	executionTime time.Time,
	address string,
	script []byte,
)

type Request

type Request struct {
	// contains filtered or unexported fields
}

Request encapsulates the data needed to execute a script to make it easier to pass around between the various methods involved in script execution

func NewScriptExecutionRequest

func NewScriptExecutionRequest(
	blockID flow.Identifier,
	height uint64,
	script []byte,
	arguments [][]byte,
) *Request

type ScriptExecutor

type ScriptExecutor interface {
	Execute(ctx context.Context, scriptRequest *Request) ([]byte, time.Duration, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL