{"modulePath":"github.com/onflow/flow-go","version":"v0.51.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package computer\n\n## Constants\n\n```go\nconst (\n\tSystemChunkEventCollectionMaxSize = 256_000_000 // ~256MB\n)\n```\n\n## Functions\n\n```go\nfunc GenerateExecutionReceipt(\n\tsigner module.Local,\n\treceiptHasher hash.Hasher,\n\tresult *flow.ExecutionResult,\n\tspockSignatures []crypto.Signature,\n) (\n\t*flow.ExecutionReceipt,\n\terror,\n)\n```\n\n```go\nfunc ScheduledTransactionContext(vmCtx fvm.Context, metrics module.ExecutionMetrics) fvm.Context\n```\nScheduledTransactionContext is the context for the scheduled transactions.\n\n```go\nfunc SystemChunkContext(vmCtx fvm.Context, metrics module.ExecutionMetrics) fvm.Context\n```\nSystemChunkContext is the context for the system chunk transaction.\n\n## Types\n\n```go\ntype BlockComputer interface {\n\tExecuteBlock(\n\t\tctx context.Context,\n\t\tparentBlockExecutionResultID flow.Identifier,\n\t\tblock *entity.ExecutableBlock,\n\t\tsnapshot snapshot.StorageSnapshot,\n\t\tderivedBlockData *derived.DerivedBlockData,\n\t) (\n\t\t*execution.ComputationResult,\n\t\terror,\n\t)\n}\n```\nA BlockComputer executes the transactions in a block.\n\n```go\nfunc NewBlockComputer(\n\tvm fvm.VM,\n\tvmCtx fvm.Context,\n\tmetrics module.ExecutionMetrics,\n\ttracer module.Tracer,\n\tlogger zerolog.Logger,\n\tcommitter ViewCommitter,\n\tsigner module.Local,\n\texecutionDataProvider provider.Provider,\n\tstate protocol.SnapshotExecutionSubsetProvider,\n\tmaxConcurrency int,\n) (BlockComputer, error)\n```\nNewBlockComputer creates a new block executor.\n\n```go\ntype ComputerTransactionType uint\n```\n\n```go\nconst (\n\tComputerTransactionTypeUser ComputerTransactionType = iota\n\tComputerTransactionTypeSystem\n\tComputerTransactionTypeScheduled\n)\n```\n\n```go\ntype TransactionRequest struct {\n\t*fvm.TransactionProcedure\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype TransactionWriteBehindLogger interface {\n\tAddTransactionResult(\n\t\ttxn TransactionRequest,\n\t\tsnapshot *snapshot.ExecutionSnapshot,\n\t\toutput fvm.ProcedureOutput,\n\t\ttimeSpent time.Duration,\n\t\tnumTxnConflictRetries int,\n\t)\n}\n```\n\n```go\ntype ViewCommitter interface {\n\t// CommitView commits an execution snapshot and collects proofs\n\tCommitView(\n\t\t*snapshot.ExecutionSnapshot,\n\t\texecution.ExtendableStorageSnapshot,\n\t) (\n\t\tflow.StateCommitment,\n\t\t[]byte,\n\t\t*ledger.TrieUpdate,\n\t\texecution.ExtendableStorageSnapshot,\n\t\terror,\n\t)\n}\n```\nViewCommitter commits execution snapshot to the ledger and collects the proofs\n\n","path":"github.com/onflow/flow-go/engine/execution/computation/computer","name":"computer","synopsis":"","isRedistributable":true}
