{"modulePath":"github.com/onflow/flow-go","version":"v0.51.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cache\n\n## Types\n\n```go\ntype ExecutionDataCache struct {\n\t// contains filtered or unexported fields\n}\n```\nExecutionDataCache is a read-through cache for ExecutionData.\n\n```go\nfunc NewExecutionDataCache(\n\tbackend execution_data.ExecutionDataGetter,\n\theaders storage.Headers,\n\tseals storage.Seals,\n\tresults storage.ExecutionResults,\n\tcache mempool.ExecutionData,\n) *ExecutionDataCache\n```\nNewExecutionDataCache returns a new ExecutionDataCache.\n\n```go\nfunc (c *ExecutionDataCache) ByBlockID(ctx context.Context, blockID flow.Identifier) (*execution_data.BlockExecutionDataEntity, error)\n```\nByBlockID returns the execution data for the given block ID.\n\nExpected error returns during normal operation:\n\n  - [storage.ErrNotFound](/github.com/onflow/flow-go/storage#ErrNotFound): if a seal or execution result is not available for the block\n  - [execution\\_data.BlobNotFoundError](/github.com/onflow/flow-go/module/executiondatasync/execution_data#BlobNotFoundError): if some CID in the blob tree could not be found from the blobstore\n  - [execution\\_data.MalformedDataError](/github.com/onflow/flow-go/module/executiondatasync/execution_data#MalformedDataError): if some level of the blob tree cannot be properly deserialized\n  - [execution\\_data.BlobSizeLimitExceededError](/github.com/onflow/flow-go/module/executiondatasync/execution_data#BlobSizeLimitExceededError): if some blob in the blob tree exceeds the maximum allowed size\n\n```go\nfunc (c *ExecutionDataCache) ByHeight(ctx context.Context, height uint64) (*execution_data.BlockExecutionDataEntity, error)\n```\nByHeight returns the execution data for the given block height.\n\nExpected error returns during normal operation:\n\n  - [storage.ErrNotFound](/github.com/onflow/flow-go/storage#ErrNotFound): if the block, seal, or execution result is not available for the height.\n  - [execution\\_data.BlobNotFoundError](/github.com/onflow/flow-go/module/executiondatasync/execution_data#BlobNotFoundError): if some CID in the blob tree could not be found from the blobstore\n  - [execution\\_data.MalformedDataError](/github.com/onflow/flow-go/module/executiondatasync/execution_data#MalformedDataError): if some level of the blob tree cannot be properly deserialized\n  - [execution\\_data.BlobSizeLimitExceededError](/github.com/onflow/flow-go/module/executiondatasync/execution_data#BlobSizeLimitExceededError): if some blob in the blob tree exceeds the maximum allowed size\n\n```go\nfunc (c *ExecutionDataCache) ByID(ctx context.Context, executionDataID flow.Identifier) (*execution_data.BlockExecutionDataEntity, error)\n```\nByID returns the execution data for the given ExecutionDataID.\n\nExpected error returns during normal operation:\n\n  - [execution\\_data.BlobNotFoundError](/github.com/onflow/flow-go/module/executiondatasync/execution_data#BlobNotFoundError): if some CID in the blob tree could not be found from the blobstore\n  - [execution\\_data.MalformedDataError](/github.com/onflow/flow-go/module/executiondatasync/execution_data#MalformedDataError): if some level of the blob tree cannot be properly deserialized\n  - [execution\\_data.BlobSizeLimitExceededError](/github.com/onflow/flow-go/module/executiondatasync/execution_data#BlobSizeLimitExceededError): if some blob in the blob tree exceeds the maximum allowed size\n\n```go\nfunc (c *ExecutionDataCache) LookupID(blockID flow.Identifier) (flow.Identifier, error)\n```\nLookupID returns the ExecutionDataID for the given block ID.\n\nExpected error returns during normal operation:\n\n  - [storage.ErrNotFound](/github.com/onflow/flow-go/storage#ErrNotFound): if a seal or execution result is not available for the block\n\n","path":"github.com/onflow/flow-go/module/executiondatasync/execution_data/cache","name":"cache","synopsis":"","isRedistributable":true}
