Documentation ¶
Index ¶
- Constants
- func CheckStorageHealth(address common.Address, storage *runtime.Storage, ...) error
- func CreatePayloadFile(logger zerolog.Logger, payloadFile string, payloads []*ledger.Payload, ...) (int, error)
- func IsPayloadAtreeInlined(payload *ledger.Payload) (isAtreeSlab bool, isInlined bool, err error)
- func IsPayloadFilePartialState(payloadFile string) (bool, error)
- func IsRegisterAtreeInlined(key string, value []byte) (isAtreeSlab bool, isInlined bool, err error)
- func IsServiceLevelAddress(address common.Address) bool
- func LoadAtreeSlabsInStorage(storage *runtime.Storage, registers registers.Registers, nWorkers int) error
- func NewByAccountRegistersFromPayloadAccountGrouping(payloadAccountGrouping *PayloadAccountGrouping, nWorker int) (*registers.ByAccount, error)
- func ParseStateCommitment(stateCommitmentHex string) flow.StateCommitment
- func PayloadsAndAccountsFromEmulatorSnapshot(db *sql.DB) ([]*ledger.Payload, map[flow.RegisterID]PayloadMetaInfo, []common.Address, ...)
- func PayloadsFromEmulatorSnapshot(snapshotPath string) ([]*ledger.Payload, error)
- func ReadPayloadFile(logger zerolog.Logger, payloadFile string) (bool, []*ledger.Payload, error)
- func ReadTrie(dir string, targetHash flow.StateCommitment) ([]*ledger.Payload, error)
- func SortPayloadsByAddress(payloads []*ledger.Payload, nWorkers int) []*ledger.Payload
- type AccountsAtreeLedger
- func (a *AccountsAtreeLedger) AllocateSlabIndex(owner []byte) (atree.SlabIndex, error)
- func (a *AccountsAtreeLedger) GetValue(owner, key []byte) ([]byte, error)
- func (a *AccountsAtreeLedger) SetValue(owner, key, value []byte) error
- func (a *AccountsAtreeLedger) ValueExists(owner, key []byte) (exists bool, err error)
- type GerOrLoadProgramListenerFunc
- type GetContractCodeFunc
- type GetContractNamesFunc
- type GetOrLoadProgramFunc
- type MigrationRuntimeInterface
- func (m *MigrationRuntimeInterface) GetAccountContractCode(location common.AddressLocation) (code []byte, err error)
- func (m *MigrationRuntimeInterface) GetCode(location runtime.Location) ([]byte, error)
- func (m *MigrationRuntimeInterface) GetOrLoadProgram(location runtime.Location, load func() (*interpreter.Program, error)) (program *interpreter.Program, err error)
- func (m *MigrationRuntimeInterface) RecoverProgram(program *ast.Program, location common.Location) ([]byte, error)
- func (m *MigrationRuntimeInterface) ResolveLocation(identifiers []runtime.Identifier, location runtime.Location) ([]runtime.ResolvedLocation, error)
- type NopMeter
- func (n NopMeter) ComputationAvailable(_ common.ComputationKind, _ uint) bool
- func (n NopMeter) ComputationIntensities() meter.MeteredComputationIntensities
- func (n NopMeter) ComputationUsed() (uint64, error)
- func (n NopMeter) InteractionUsed() (uint64, error)
- func (n NopMeter) MemoryUsed() (uint64, error)
- func (n NopMeter) MeterComputation(_ common.ComputationKind, _ uint) error
- func (n NopMeter) MeterEmittedEvent(_ uint64) error
- func (n NopMeter) MeterMemory(_ common.MemoryUsage) error
- func (n NopMeter) TotalEmittedEventBytes() uint64
- type PayloadAccountGroup
- type PayloadAccountGrouping
- type PayloadMetaInfo
- type PayloadsLedger
- func (p *PayloadsLedger) AllocateSlabIndex(owner []byte) (atree.SlabIndex, error)
- func (p *PayloadsLedger) GetValue(owner, key []byte) (value []byte, err error)
- func (p *PayloadsLedger) SetValue(owner, key, value []byte) (err error)
- func (p *PayloadsLedger) ValueExists(owner, key []byte) (exists bool, err error)
- type TopN
- type Trace
Constants ¶
const (
PayloadFileVersionV1 uint16 = 0x01
)
Variables ¶
This section is empty.
Functions ¶
func CheckStorageHealth ¶ added in v0.37.5
func CreatePayloadFile ¶ added in v0.33.30
func IsPayloadAtreeInlined ¶ added in v0.33.30
func IsPayloadFilePartialState ¶ added in v0.33.30
func IsRegisterAtreeInlined ¶ added in v0.33.30
func IsServiceLevelAddress ¶
IsServiceLevelAddress returns true if the given address is the service level address. Which means it's not an actual account but instead holds service lever registers.
func LoadAtreeSlabsInStorage ¶ added in v0.37.5
func NewByAccountRegistersFromPayloadAccountGrouping ¶ added in v0.37.5
func NewByAccountRegistersFromPayloadAccountGrouping( payloadAccountGrouping *PayloadAccountGrouping, nWorker int, ) ( *registers.ByAccount, error, )
func ParseStateCommitment ¶ added in v0.33.30
func ParseStateCommitment(stateCommitmentHex string) flow.StateCommitment
func PayloadsAndAccountsFromEmulatorSnapshot ¶ added in v0.33.30
func PayloadsAndAccountsFromEmulatorSnapshot(db *sql.DB) ( []*ledger.Payload, map[flow.RegisterID]PayloadMetaInfo, []common.Address, error, )
func PayloadsFromEmulatorSnapshot ¶ added in v0.33.30
func ReadPayloadFile ¶ added in v0.33.30
Types ¶
type AccountsAtreeLedger ¶
type AccountsAtreeLedger struct {
Accounts environment.Accounts
}
func NewAccountsAtreeLedger ¶
func NewAccountsAtreeLedger(accounts environment.Accounts) *AccountsAtreeLedger
func (*AccountsAtreeLedger) AllocateSlabIndex ¶ added in v0.37.1
func (a *AccountsAtreeLedger) AllocateSlabIndex(owner []byte) (atree.SlabIndex, error)
AllocateSlabIndex allocates new storage index under the owner accounts to store a new register
func (*AccountsAtreeLedger) GetValue ¶
func (a *AccountsAtreeLedger) GetValue(owner, key []byte) ([]byte, error)
func (*AccountsAtreeLedger) SetValue ¶
func (a *AccountsAtreeLedger) SetValue(owner, key, value []byte) error
func (*AccountsAtreeLedger) ValueExists ¶
func (a *AccountsAtreeLedger) ValueExists(owner, key []byte) (exists bool, err error)
type GerOrLoadProgramListenerFunc ¶ added in v0.33.30
type GerOrLoadProgramListenerFunc func( location runtime.Location, program *interpreter.Program, err error, )
type GetContractCodeFunc ¶ added in v0.33.30
type GetContractCodeFunc func(location common.AddressLocation) ([]byte, error)
type GetContractNamesFunc ¶ added in v0.33.30
type GetOrLoadProgramFunc ¶ added in v0.33.30
type GetOrLoadProgramFunc func( location runtime.Location, load func() (*interpreter.Program, error), ) ( *interpreter.Program, error, )
func NewProgramsGetOrLoadProgramFunc ¶ added in v0.33.30
func NewProgramsGetOrLoadProgramFunc( nestedTransactionPreparer state.NestedTransactionPreparer, accounts environment.Accounts, ) (GetOrLoadProgramFunc, error)
type MigrationRuntimeInterface ¶
type MigrationRuntimeInterface struct { runtime.EmptyRuntimeInterface GetContractCodeFunc GetContractCodeFunc GetContractNamesFunc GetContractNamesFunc GetOrLoadProgramFunc GetOrLoadProgramFunc GetOrLoadProgramListenerFunc GerOrLoadProgramListenerFunc // contains filtered or unexported fields }
MigrationRuntimeInterface is a runtime interface that can be used in migrations. It only allows parsing and checking of contracts.
func NewMigrationRuntimeInterface ¶ added in v0.33.30
func NewMigrationRuntimeInterface( chainID flow.ChainID, getCodeFunc GetContractCodeFunc, getContractNamesFunc GetContractNamesFunc, getOrLoadProgramFunc GetOrLoadProgramFunc, getOrLoadProgramListenerFunc GerOrLoadProgramListenerFunc, ) *MigrationRuntimeInterface
func (*MigrationRuntimeInterface) GetAccountContractCode ¶
func (m *MigrationRuntimeInterface) GetAccountContractCode( location common.AddressLocation, ) (code []byte, err error)
func (*MigrationRuntimeInterface) GetCode ¶
func (m *MigrationRuntimeInterface) GetCode(location runtime.Location) ([]byte, error)
func (*MigrationRuntimeInterface) GetOrLoadProgram ¶
func (m *MigrationRuntimeInterface) GetOrLoadProgram( location runtime.Location, load func() (*interpreter.Program, error), ) ( program *interpreter.Program, err error, )
func (*MigrationRuntimeInterface) RecoverProgram ¶ added in v0.37.1
func (*MigrationRuntimeInterface) ResolveLocation ¶
func (m *MigrationRuntimeInterface) ResolveLocation( identifiers []runtime.Identifier, location runtime.Location, ) ([]runtime.ResolvedLocation, error)
type NopMeter ¶
type NopMeter struct{}
NopMeter is a meter that does nothing. It can be used in migrations.
func (NopMeter) ComputationAvailable ¶
func (n NopMeter) ComputationAvailable(_ common.ComputationKind, _ uint) bool
func (NopMeter) ComputationIntensities ¶
func (n NopMeter) ComputationIntensities() meter.MeteredComputationIntensities
func (NopMeter) ComputationUsed ¶
func (NopMeter) InteractionUsed ¶
func (NopMeter) MemoryUsed ¶
func (NopMeter) MeterComputation ¶
func (n NopMeter) MeterComputation(_ common.ComputationKind, _ uint) error
func (NopMeter) MeterEmittedEvent ¶
func (NopMeter) MeterMemory ¶
func (n NopMeter) MeterMemory(_ common.MemoryUsage) error
func (NopMeter) TotalEmittedEventBytes ¶
type PayloadAccountGroup ¶
PayloadAccountGroup is a grouping of payloads by account
type PayloadAccountGrouping ¶
type PayloadAccountGrouping struct {
// contains filtered or unexported fields
}
PayloadAccountGrouping is a grouping of payloads by account.
func GroupPayloadsByAccount ¶
func GroupPayloadsByAccount( log zerolog.Logger, payloads []*ledger.Payload, nWorkers int, ) *PayloadAccountGrouping
GroupPayloadsByAccount takes a list of payloads and groups them by account. it uses nWorkers to sort the payloads by address and find the start and end indexes of each account.
func (*PayloadAccountGrouping) AllPayloadsCount ¶
func (g *PayloadAccountGrouping) AllPayloadsCount() int
AllPayloadsCount the number of payloads
func (*PayloadAccountGrouping) Len ¶
func (g *PayloadAccountGrouping) Len() int
Len returns the number of accounts
func (*PayloadAccountGrouping) Next ¶
func (g *PayloadAccountGrouping) Next() (*PayloadAccountGroup, error)
Next returns the next account group. If there is no more account group, it returns nil. The zero address is used for global Payloads and is not an actual account.
type PayloadMetaInfo ¶ added in v0.33.30
type PayloadMetaInfo struct {
Height, Version uint64
}
type PayloadsLedger ¶ added in v0.33.30
type PayloadsLedger struct { Payloads map[flow.RegisterID]*ledger.Payload AllocateSlabIndexFunc func(owner []byte) (atree.SlabIndex, error) }
PayloadsLedger is a simple read/write in-memory atree.Ledger implementation
func NewPayloadsLedger ¶ added in v0.33.30
func NewPayloadsLedger(payloads map[flow.RegisterID]*ledger.Payload) *PayloadsLedger
func (*PayloadsLedger) AllocateSlabIndex ¶ added in v0.37.1
func (p *PayloadsLedger) AllocateSlabIndex(owner []byte) (atree.SlabIndex, error)
func (*PayloadsLedger) GetValue ¶ added in v0.33.30
func (p *PayloadsLedger) GetValue(owner, key []byte) (value []byte, err error)
func (*PayloadsLedger) SetValue ¶ added in v0.33.30
func (p *PayloadsLedger) SetValue(owner, key, value []byte) (err error)
func (*PayloadsLedger) ValueExists ¶ added in v0.33.30
func (p *PayloadsLedger) ValueExists(owner, key []byte) (exists bool, err error)
type TopN ¶ added in v0.33.30
TopN keeps track of the top N elements. Use Add to add elements to the list.