model

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2025 License: Apache-2.0 Imports: 6 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DATA_AVAILABILITY_SELECTOR_SIZE = 4

Variables

View Source
var (
	// ABI encoded "InputBox(address)"
	DataAvailability_InputBox = DataAvailabilitySelector{0xb1, 0x2c, 0x9e, 0xde}
	// string: avda
	// DataAvailability_Avail = DataAvailabilitySelector{0x61, 0x76, 0x64, 0x61}
	DataAvailability_Avail = DataAvailabilitySelector{0x85, 0x79, 0xfd, 0x0c} // temp borrow from espresso
)

Known data availability selectors

Functions

func Pointer

func Pointer[T any](v T) *T

Types

type AdvanceResult

type AdvanceResult struct {
	InputIndex  uint64
	Status      InputCompletionStatus
	Outputs     [][]byte
	Reports     [][]byte
	OutputsHash common.Hash
	MachineHash *common.Hash
}

type Application

type Application struct {
	ID                   int64                    `db:"id" json:"-"`
	Name                 string                   `db:"name" json:"name"`
	IApplicationAddress  common.Address           `db:"iapplication_address" json:"iapplication_address"`
	IConsensusAddress    common.Address           `db:"iconsensus_address" json:"iconsensus_address"`
	IInputBoxAddress     common.Address           `db:"iinputbox_address" json:"iinputbox_address"`
	TemplateHash         common.Hash              `db:"template_hash" json:"template_hash"`
	TemplateURI          string                   `db:"template_uri" json:"-"`
	EpochLength          uint64                   `db:"epoch_length" json:"epoch_length"`
	DataAvailability     DataAvailabilitySelector `db:"data_availability" json:"data_availability"`
	State                ApplicationState         `db:"state" json:"state"`
	Reason               *string                  `db:"reason" json:"reason"`
	IInputBoxBlock       uint64                   `db:"iinputbox_block" json:"iinputbox_block"`
	LastInputCheckBlock  uint64                   `db:"last_input_check_block" json:"last_input_check_block"`
	LastOutputCheckBlock uint64                   `db:"last_output_check_block" json:"last_output_check_block"`
	ProcessedInputs      uint64                   `db:"processed_inputs" json:"processed_inputs"`
	CreatedAt            time.Time                `db:"created_at" json:"created_at"`
	UpdatedAt            time.Time                `db:"updated_at" json:"updated_at"`
	ExecutionParameters  ExecutionParameters      `db:"execution_parameters" json:"execution_parameters"`
}

func (*Application) MarshalJSON

func (a *Application) MarshalJSON() ([]byte, error)

type ApplicationState

type ApplicationState string
const (
	ApplicationState_Enabled    ApplicationState = "ENABLED"
	ApplicationState_Disabled   ApplicationState = "DISABLED"
	ApplicationState_Inoperable ApplicationState = "INOPERABLE"
)

func (*ApplicationState) Scan

func (e *ApplicationState) Scan(value any) error

func (ApplicationState) String

func (e ApplicationState) String() string

type ClaimRow

type ClaimRow struct {
	Epoch
	IApplicationAddress common.Address
	IConsensusAddress   common.Address
}

FIXME: remove this type. Migrate claim to use Application + Epoch

type DataAvailabilitySelector

type DataAvailabilitySelector [DATA_AVAILABILITY_SELECTOR_SIZE]byte

func (*DataAvailabilitySelector) MarshalJSON

func (d *DataAvailabilitySelector) MarshalJSON() ([]byte, error)

func (*DataAvailabilitySelector) Scan

func (d *DataAvailabilitySelector) Scan(value any) error

type DefaultBlock

type DefaultBlock string
const (
	DefaultBlock_Finalized DefaultBlock = "FINALIZED"
	DefaultBlock_Latest    DefaultBlock = "LATEST"
	DefaultBlock_Pending   DefaultBlock = "PENDING"
	DefaultBlock_Safe      DefaultBlock = "SAFE"
)

func (*DefaultBlock) Scan

func (e *DefaultBlock) Scan(value any) error

func (DefaultBlock) String

func (e DefaultBlock) String() string

type Epoch

type Epoch struct {
	ApplicationID        int64        `sql:"primary_key" db:"application_id" json:"-"`
	Index                uint64       `sql:"primary_key" db:"index" json:"index"`
	FirstBlock           uint64       `db:"first_block" json:"first_block"`
	LastBlock            uint64       `db:"last_block" json:"last_block"`
	ClaimHash            *common.Hash `db:"claim_hash" json:"claim_hash"`
	ClaimTransactionHash *common.Hash `db:"claim_transaction_hash" json:"claim_transaction_hash"`
	Status               EpochStatus  `db:"status" json:"status"`
	VirtualIndex         uint64       `db:"virtual_index" json:"virtual_index"`
	CreatedAt            time.Time    `db:"created_at" json:"created_at"`
	UpdatedAt            time.Time    `db:"updated_at" json:"updated_at"`
}

func (*Epoch) MarshalJSON

func (e *Epoch) MarshalJSON() ([]byte, error)

type EpochStatus

type EpochStatus string
const (
	EpochStatus_Open            EpochStatus = "OPEN"
	EpochStatus_Closed          EpochStatus = "CLOSED"
	EpochStatus_InputsProcessed EpochStatus = "INPUTS_PROCESSED"
	EpochStatus_ClaimComputed   EpochStatus = "CLAIM_COMPUTED"
	EpochStatus_ClaimSubmitted  EpochStatus = "CLAIM_SUBMITTED"
	EpochStatus_ClaimAccepted   EpochStatus = "CLAIM_ACCEPTED"
	EpochStatus_ClaimRejected   EpochStatus = "CLAIM_REJECTED"
)

func (*EpochStatus) Scan

func (e *EpochStatus) Scan(value any) error

func (EpochStatus) String

func (e EpochStatus) String() string

type ExecutionParameters

type ExecutionParameters struct {
	ApplicationID         int64          `sql:"primary_key" json:"-"`
	SnapshotPolicy        SnapshotPolicy `json:"snapshot_policy"`
	SnapshotRetention     uint64         `json:"snapshot_retention"`
	AdvanceIncCycles      uint64         `json:"advance_inc_cycles"`
	AdvanceMaxCycles      uint64         `json:"advance_max_cycles"`
	InspectIncCycles      uint64         `json:"inspect_inc_cycles"`
	InspectMaxCycles      uint64         `json:"inspect_max_cycles"`
	AdvanceIncDeadline    time.Duration  `json:"advance_inc_deadline"`
	AdvanceMaxDeadline    time.Duration  `json:"advance_max_deadline"`
	InspectIncDeadline    time.Duration  `json:"inspect_inc_deadline"`
	InspectMaxDeadline    time.Duration  `json:"inspect_max_deadline"`
	LoadDeadline          time.Duration  `json:"load_deadline"`
	StoreDeadline         time.Duration  `json:"store_deadline"`
	FastDeadline          time.Duration  `json:"fast_deadline"`
	MaxConcurrentInspects uint32         `json:"max_concurrent_inspects"`
	CreatedAt             time.Time      `json:"created_at"`
	UpdatedAt             time.Time      `json:"updated_at"`
}

type Input

type Input struct {
	EpochApplicationID   int64                 `sql:"primary_key" db:"epoch_application_id" json:"-"`
	EpochIndex           uint64                `db:"epoch_index" json:"epoch_index"`
	Index                uint64                `sql:"primary_key" db:"index" json:"index"`
	BlockNumber          uint64                `db:"block_number" json:"block_number"`
	RawData              []byte                `db:"raw_data" json:"raw_data"`
	Status               InputCompletionStatus `db:"status" json:"status"`
	MachineHash          *common.Hash          `db:"machine_hash" json:"machine_hash"`
	OutputsHash          *common.Hash          `db:"outputs_hash" json:"outputs_hash"`
	TransactionReference *common.Hash          `db:"transaction_reference" json:"transaction_reference"`
	SnapshotURI          *string               `db:"snapshot_uri" json:"-"`
	CreatedAt            time.Time             `db:"created_at" json:"created_at"`
	UpdatedAt            time.Time             `db:"updated_at" json:"updated_at"`
}

func (*Input) MarshalJSON

func (i *Input) MarshalJSON() ([]byte, error)

type InputCompletionStatus

type InputCompletionStatus string
const (
	InputCompletionStatus_None                       InputCompletionStatus = "NONE"
	InputCompletionStatus_Accepted                   InputCompletionStatus = "ACCEPTED"
	InputCompletionStatus_Rejected                   InputCompletionStatus = "REJECTED"
	InputCompletionStatus_Exception                  InputCompletionStatus = "EXCEPTION"
	InputCompletionStatus_MachineHalted              InputCompletionStatus = "MACHINE_HALTED"
	InputCompletionStatus_OutputsLimitExceeded       InputCompletionStatus = "OUTPUTS_LIMIT_EXCEEDED"
	InputCompletionStatus_CycleLimitExceeded         InputCompletionStatus = "CYCLE_LIMIT_EXCEEDED"
	InputCompletionStatus_TimeLimitExceeded          InputCompletionStatus = "TIME_LIMIT_EXCEEDED"
	InputCompletionStatus_PayloadLengthLimitExceeded InputCompletionStatus = "PAYLOAD_LENGTH_LIMIT_EXCEEDED"
)

func (*InputCompletionStatus) Scan

func (e *InputCompletionStatus) Scan(value any) error

func (InputCompletionStatus) String

func (e InputCompletionStatus) String() string

type InputExtra

type InputExtra struct {
	Input
	BlockTimestamp  time.Time
	AppContract     common.Address
	MsgSender       common.Address
	ChainId         uint64
	PrevRandao      common.Hash
	Transaction     string
	TransactionData []byte
}

Extra

type InspectResult

type InspectResult struct {
	ProcessedInputs uint64
	Accepted        bool
	Reports         [][]byte
	Error           error
}

type MonitoredEvent

type MonitoredEvent string
const (
	MonitoredEvent_InputAdded     MonitoredEvent = "InputAdded"
	MonitoredEvent_OutputExecuted MonitoredEvent = "OutputExecuted"
	MonitoredEvent_ClaimSubmitted MonitoredEvent = "ClaimSubmitted"
	MonitoredEvent_ClaimAccepted  MonitoredEvent = "ClaimAccepted"
)

func (MonitoredEvent) String

func (e MonitoredEvent) String() string

type NodeConfig

type NodeConfig[T any] struct {
	Key       string
	Value     T
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Output

type Output struct {
	InputEpochApplicationID  int64         `sql:"primary_key" json:"-"`
	InputIndex               uint64        `json:"input_index"`
	Index                    uint64        `sql:"primary_key" json:"index"`
	RawData                  []byte        `json:"raw_data"`
	Hash                     *common.Hash  `json:"hash"`
	OutputHashesSiblings     []common.Hash `json:"output_hashes_siblings"`
	ExecutionTransactionHash *common.Hash  `json:"execution_transaction_hash"`
	CreatedAt                time.Time     `json:"created_at"`
	UpdatedAt                time.Time     `json:"updated_at"`
}

func (*Output) MarshalJSON

func (i *Output) MarshalJSON() ([]byte, error)

type Report

type Report struct {
	InputEpochApplicationID int64     `sql:"primary_key" json:"-"`
	InputIndex              uint64    `json:"input_index"`
	Index                   uint64    `sql:"primary_key" json:"index"`
	RawData                 []byte    `json:"raw_data"`
	CreatedAt               time.Time `json:"created_at"`
	UpdatedAt               time.Time `json:"updated_at"`
}

func (*Report) MarshalJSON

func (r *Report) MarshalJSON() ([]byte, error)

type SnapshotPolicy

type SnapshotPolicy string
const (
	SnapshotPolicy_None      SnapshotPolicy = "NONE"
	SnapshotPolicy_EachInput SnapshotPolicy = "EACH_INPUT"
	SnapshotPolicy_EachEpoch SnapshotPolicy = "EACH_EPOCH"
)

func (*SnapshotPolicy) Scan

func (e *SnapshotPolicy) Scan(value any) error

func (SnapshotPolicy) String

func (e SnapshotPolicy) String() string

Jump to

Keyboard shortcuts

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