Help us shape the future of Go! Take the 2026 Go Developer Survey

execution_tx

package
v0.57.30 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const TxTypeID = "forge/execution/tx"

TxTypeID is the type ID of Tx.

Variables

View Source
var (
	TxType_name = map[int32]string{
		0: "TxType_INVALID",
		1: "TxType_START",
		2: "TxType_SET_OUTPUTS",
		3: "TxType_COMPLETE",
		4: "TxType_APPEND_LOG",
		5: "TxType_CANCEL",
		6: "TxType_RECLAIM",
		7: "TxType_SET_WAITING_PLUGIN",
		8: "TxType_RENEW_CLAIM",
	}
	TxType_value = map[string]int32{
		"TxType_INVALID":            0,
		"TxType_START":              1,
		"TxType_SET_OUTPUTS":        2,
		"TxType_COMPLETE":           3,
		"TxType_APPEND_LOG":         4,
		"TxType_CANCEL":             5,
		"TxType_RECLAIM":            6,
		"TxType_SET_WAITING_PLUGIN": 7,
		"TxType_RENEW_CLAIM":        8,
	}
)

Enum value maps for TxType.

View Source
var TxTypes = []typeid.Type{
	{ID: TxTypeID, New: func() any { return new(Tx) }},
}

TxTypes lists the typed messages of tx.proto.

Functions

func IsClaimFenced

func IsClaimFenced(err error) bool

IsClaimFenced reports whether err rejects a write because another claim owns the execution.

Types

type ClaimHeldError added in v0.57.0

type ClaimHeldError struct {
	ClaimID string
	Epoch   uint64
}

ClaimHeldError reports that another controller owns the live execution claim.

func (*ClaimHeldError) Error added in v0.57.0

func (e *ClaimHeldError) Error() string

Error names the claim holding the execution and its epoch.

type ClaimLiveError

type ClaimLiveError struct {
	// ClaimID identifies the live claimant.
	ClaimID string
	// Epoch is the live claim's fencing token.
	Epoch uint64
	// LeaseExpiresAt is the earliest time a peer may reclaim this claim.
	LeaseExpiresAt time.Time
}

ClaimLiveError reports a reclaim of a claim whose lease has not expired.

func (*ClaimLiveError) Error

func (e *ClaimLiveError) Error() string

Error names the live claim and when its lease expires.

type StaleClaimEpochError added in v0.57.0

type StaleClaimEpochError struct {
	ClaimEpoch   uint64
	CurrentEpoch uint64
}

StaleClaimEpochError reports a write carrying a non-authoritative claim epoch.

func (*StaleClaimEpochError) Error added in v0.57.0

func (e *StaleClaimEpochError) Error() string

Error returns the stale claim epoch conflict.

type Transaction

type Transaction interface {
	// MarshalVT marshals to binary.
	MarshalVT() ([]byte, error)
	// UnmarshalVT unmarshals from binary.
	UnmarshalVT(data []byte) error

	// GetTxType returns the type of transaction this is.
	GetTxType() TxType
	// Validate performs a cursory check of the transaction.
	// Note: this should not fetch network data.
	Validate() error
	// ExecuteTx executes the transaction against the execution instance.
	// exCursor should be located at the execution state root.
	// The result is written into exCursor.
	ExecuteTx(
		ctx context.Context,
		sender peer.ID,
		exCursor *block.Cursor,
		root *forge_execution.Execution,
	) error
}

Transaction is an instance of a transaction object.

func NewTxCancelTxn added in v0.57.0

func NewTxCancelTxn() Transaction

NewTxCancelTxn constructs a cancellation transaction payload.

func NewTxCompleteTxn

func NewTxCompleteTxn() Transaction

NewTxCompleteTxn constructs the COMPLETE transaction.

func NewTxReclaimTxn added in v0.57.0

func NewTxReclaimTxn() Transaction

NewTxReclaimTxn constructs a new RECLAIM transaction.

func NewTxSetOutputsTxn

func NewTxSetOutputsTxn() Transaction

NewTxSetOutputsTxn constructs a new SET_OUTPUTS transaction.

func NewTxStartTxn

func NewTxStartTxn() Transaction

NewTxStartTxn constructs a new START transaction.

type Tx

type Tx struct {

	// TxType is the kind of transaction this is.
	TxType TxType `protobuf:"varint,1,opt,name=tx_type,json=txType,proto3" json:"txType,omitempty"`
	// TxStart contains the start transaction tx.
	// TxType_START
	TxStart *TxStart `protobuf:"bytes,2,opt,name=tx_start,json=txStart,proto3" json:"txStart,omitempty"`
	// TxSetOutputs contains the set outputs tx.
	// TxType_SET_OUTPUTS
	TxSetOutputs *TxSetOutputs `protobuf:"bytes,3,opt,name=tx_set_outputs,json=txSetOutputs,proto3" json:"txSetOutputs,omitempty"`
	// TxComplete contains the complete tx.
	// TxType_COMPLETE
	TxComplete *TxComplete `protobuf:"bytes,4,opt,name=tx_complete,json=txComplete,proto3" json:"txComplete,omitempty"`
	// TxAppendLog contains the append log tx.
	// TxType_APPEND_LOG
	TxAppendLog *TxAppendLog `protobuf:"bytes,5,opt,name=tx_append_log,json=txAppendLog,proto3" json:"txAppendLog,omitempty"`
	// TxCancel contains the cancel tx.
	// TxType_CANCEL
	TxCancel *TxCancel `protobuf:"bytes,6,opt,name=tx_cancel,json=txCancel,proto3" json:"txCancel,omitempty"`
	// TxReclaim transfers a running execution after owner liveness is resolved.
	// TxType_RECLAIM
	TxReclaim *TxReclaim `protobuf:"bytes,7,opt,name=tx_reclaim,json=txReclaim,proto3" json:"txReclaim,omitempty"`
	// TxSetWaitingPlugin updates the plugin load wait reported by the Execution.
	TxSetWaitingPlugin *TxSetWaitingPlugin `protobuf:"bytes,8,opt,name=tx_set_waiting_plugin,json=txSetWaitingPlugin,proto3" json:"txSetWaitingPlugin,omitempty"`
	// TxRenewClaim extends the lease of the current claim.
	// TxType_RENEW_CLAIM
	TxRenewClaim *TxRenewClaim `protobuf:"bytes,9,opt,name=tx_renew_claim,json=txRenewClaim,proto3" json:"txRenewClaim,omitempty"`
	// contains filtered or unexported fields
}

Tx is the on-the-wire representation of a transaction.

func ByteSliceToTx

func ByteSliceToTx(blk block.Block) (*Tx, error)

ByteSliceToTx converts a byte slice block a Tx. If blk is nil, returns nil, nil If the blk is already parsed to a Tx, returns the Tx.

func NewTxAppendLog

func NewTxAppendLog(
	entries []*forge_execution.LogEntry,
	claims ...*forge_execution.Claim,
) (*Tx, error)

NewTxAppendLog constructs an APPEND_LOG transaction. Clones the entries when building the Tx object.

func NewTxCancel added in v0.57.0

func NewTxCancel() *Tx

NewTxCancel constructs a cancellation transaction.

func NewTxComplete

func NewTxComplete(result *forge_value.Result, claims ...*forge_execution.Claim) *Tx

NewTxComplete constructs the COMPLETE transaction.

func NewTxReclaim added in v0.57.0

func NewTxReclaim(
	executionObjectKey string,
	peerID peer.ID,
	claimID string,
	expectedClaimEpoch uint64,
	observedAt, leaseExpiresAt time.Time,
	placement *forge_worker.Placement,
) *Tx

NewTxReclaim constructs a RECLAIM transaction.

observedAt is when the sender saw the claim lease expire. The new claim stays live until leaseExpiresAt unless its holder renews it.

func NewTxRenewClaim

func NewTxRenewClaim(claim *forge_execution.Claim, leaseExpiresAt time.Time) *Tx

NewTxRenewClaim constructs a claim-fenced lease renewal.

func NewTxSetOutputs

func NewTxSetOutputs(
	outputs forge_value.ValueSlice,
	clearOld bool,
	claims ...*forge_execution.Claim,
) (*Tx, error)

NewTxSetOutputs constructs a new SET_OUTPUTS transaction. clones the ValueSet when building the Tx object.

func NewTxSetWaitingPlugin

func NewTxSetWaitingPlugin(pluginID string, claim *forge_execution.Claim) *Tx

NewTxSetWaitingPlugin constructs a claim-fenced plugin wait update.

func NewTxStart

func NewTxStart(peerID peer.ID, leaseExpiresAt time.Time, claimIDs ...string) *Tx

NewTxStart constructs a new START transaction.

A new claim stays live until leaseExpiresAt unless its holder renews it.

func (*Tx) ApplyWorldObjectOp

func (t *Tx) ApplyWorldObjectOp(
	ctx context.Context,
	le *logrus.Entry,
	objectHandle world.ObjectState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldObjectOp applies the operation to a world object handle.

func (*Tx) ApplyWorldOp

func (t *Tx) ApplyWorldOp(
	ctx context.Context,
	le *logrus.Entry,
	worldHandle world.WorldState,
	sender peer.ID,
) (sysErr bool, err error)

ApplyWorldOp reclaims an Execution and its placement in one World operation. Other transitions remain object operations.

func (*Tx) CloneMessageVT

func (m *Tx) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*Tx) CloneVT

func (m *Tx) CloneVT() *Tx

func (*Tx) EqualMessageVT

func (this *Tx) EqualMessageVT(thatMsg any) bool

func (*Tx) EqualVT

func (this *Tx) EqualVT(that *Tx) bool

func (*Tx) GetTxAppendLog

func (x *Tx) GetTxAppendLog() *TxAppendLog

func (*Tx) GetTxCancel added in v0.57.0

func (x *Tx) GetTxCancel() *TxCancel

func (*Tx) GetTxComplete

func (x *Tx) GetTxComplete() *TxComplete

func (*Tx) GetTxReclaim added in v0.57.0

func (x *Tx) GetTxReclaim() *TxReclaim

func (*Tx) GetTxRenewClaim

func (x *Tx) GetTxRenewClaim() *TxRenewClaim

func (*Tx) GetTxSetOutputs

func (x *Tx) GetTxSetOutputs() *TxSetOutputs

func (*Tx) GetTxSetWaitingPlugin

func (x *Tx) GetTxSetWaitingPlugin() *TxSetWaitingPlugin

func (*Tx) GetTxStart

func (x *Tx) GetTxStart() *TxStart

func (*Tx) GetTxType

func (x *Tx) GetTxType() TxType

func (*Tx) LocateTx

func (t *Tx) LocateTx() (Transaction, error)

LocateTx returns the sub-block for the transaction.

func (*Tx) MarshalJSON

func (x *Tx) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tx to JSON.

func (*Tx) MarshalProtoJSON

func (x *Tx) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the Tx message to JSON.

func (*Tx) MarshalProtoText

func (x *Tx) MarshalProtoText() string

func (*Tx) MarshalToSizedBufferVT

func (m *Tx) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*Tx) MarshalToVT

func (m *Tx) MarshalToVT(dAtA []byte) (int, error)

func (*Tx) MarshalVT

func (m *Tx) MarshalVT() (dAtA []byte, err error)

func (*Tx) ProtoMessage

func (*Tx) ProtoMessage()

func (*Tx) Reset

func (x *Tx) Reset()

func (*Tx) SizeVT

func (m *Tx) SizeVT() (n int)

func (*Tx) String

func (x *Tx) String() string

func (*Tx) TypeID

func (*Tx) TypeID() string

TypeID returns the type ID of Tx.

func (*Tx) UnmarshalJSON

func (x *Tx) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the Tx from JSON.

func (*Tx) UnmarshalProtoJSON

func (x *Tx) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the Tx message from JSON.

func (*Tx) UnmarshalVT

func (m *Tx) UnmarshalVT(dAtA []byte) error

func (*Tx) Validate

func (t *Tx) Validate() error

Validate checks the tx.

type TxAppendLog

type TxAppendLog struct {

	// Entries is the set of log entries to append.
	Entries []*execution.LogEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"`
	// ClaimEpoch is the fencing token authorizing this write.
	ClaimEpoch uint64 `protobuf:"varint,2,opt,name=claim_epoch,json=claimEpoch,proto3" json:"claimEpoch,omitempty"`
	// ClaimId identifies the controller instance carrying the epoch.
	ClaimId string `protobuf:"bytes,3,opt,name=claim_id,json=claimId,proto3" json:"claimId,omitempty"`
	// contains filtered or unexported fields
}

TxAppendLog appends log entries to the execution. Execution must be RUNNING or CANCELING. Sender must be the peer_id specified on the Execution. TxType: TxType_APPEND_LOG

func (*TxAppendLog) CloneMessageVT

func (m *TxAppendLog) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxAppendLog) CloneVT

func (m *TxAppendLog) CloneVT() *TxAppendLog

func (*TxAppendLog) EqualMessageVT

func (this *TxAppendLog) EqualMessageVT(thatMsg any) bool

func (*TxAppendLog) EqualVT

func (this *TxAppendLog) EqualVT(that *TxAppendLog) bool

func (*TxAppendLog) ExecuteTx

func (t *TxAppendLog) ExecuteTx(
	ctx context.Context,
	sender peer.ID,
	exCursor *block.Cursor,
	root *forge_execution.Execution,
) error

ExecuteTx executes the transaction against the execution instance.

func (*TxAppendLog) GetClaimEpoch added in v0.57.0

func (x *TxAppendLog) GetClaimEpoch() uint64

func (*TxAppendLog) GetClaimId added in v0.57.0

func (x *TxAppendLog) GetClaimId() string

func (*TxAppendLog) GetEntries

func (x *TxAppendLog) GetEntries() []*execution.LogEntry

func (*TxAppendLog) GetTxType

func (t *TxAppendLog) GetTxType() TxType

GetTxType returns the type of transaction this is.

func (*TxAppendLog) MarshalJSON

func (x *TxAppendLog) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxAppendLog to JSON.

func (*TxAppendLog) MarshalProtoJSON

func (x *TxAppendLog) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxAppendLog message to JSON.

func (*TxAppendLog) MarshalProtoText

func (x *TxAppendLog) MarshalProtoText() string

func (*TxAppendLog) MarshalToSizedBufferVT

func (m *TxAppendLog) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxAppendLog) MarshalToVT

func (m *TxAppendLog) MarshalToVT(dAtA []byte) (int, error)

func (*TxAppendLog) MarshalVT

func (m *TxAppendLog) MarshalVT() (dAtA []byte, err error)

func (*TxAppendLog) ProtoMessage

func (*TxAppendLog) ProtoMessage()

func (*TxAppendLog) Reset

func (x *TxAppendLog) Reset()

func (*TxAppendLog) SizeVT

func (m *TxAppendLog) SizeVT() (n int)

func (*TxAppendLog) String

func (x *TxAppendLog) String() string

func (*TxAppendLog) UnmarshalJSON

func (x *TxAppendLog) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxAppendLog from JSON.

func (*TxAppendLog) UnmarshalProtoJSON

func (x *TxAppendLog) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxAppendLog message from JSON.

func (*TxAppendLog) UnmarshalVT

func (m *TxAppendLog) UnmarshalVT(dAtA []byte) error

func (*TxAppendLog) Validate

func (t *TxAppendLog) Validate() error

Validate performs a cursory check of the transaction.

type TxCancel added in v0.57.0

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

TxCancel requests cancellation of a running execution. TxType: TxType_CANCEL

func (*TxCancel) CloneMessageVT added in v0.57.0

func (m *TxCancel) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxCancel) CloneVT added in v0.57.0

func (m *TxCancel) CloneVT() *TxCancel

func (*TxCancel) EqualMessageVT added in v0.57.0

func (this *TxCancel) EqualMessageVT(thatMsg any) bool

func (*TxCancel) EqualVT added in v0.57.0

func (this *TxCancel) EqualVT(that *TxCancel) bool

func (*TxCancel) ExecuteTx added in v0.57.0

func (t *TxCancel) ExecuteTx(
	ctx context.Context,
	sender peer.ID,
	exCursor *block.Cursor,
	root *forge_execution.Execution,
) error

ExecuteTx records a durable cancellation request.

func (*TxCancel) GetTxType added in v0.57.0

func (t *TxCancel) GetTxType() TxType

GetTxType returns the type of transaction this is.

func (*TxCancel) MarshalJSON added in v0.57.0

func (x *TxCancel) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxCancel to JSON.

func (*TxCancel) MarshalProtoJSON added in v0.57.0

func (x *TxCancel) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxCancel message to JSON.

func (*TxCancel) MarshalProtoText added in v0.57.0

func (x *TxCancel) MarshalProtoText() string

func (*TxCancel) MarshalToSizedBufferVT added in v0.57.0

func (m *TxCancel) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxCancel) MarshalToVT added in v0.57.0

func (m *TxCancel) MarshalToVT(dAtA []byte) (int, error)

func (*TxCancel) MarshalVT added in v0.57.0

func (m *TxCancel) MarshalVT() (dAtA []byte, err error)

func (*TxCancel) ProtoMessage added in v0.57.0

func (*TxCancel) ProtoMessage()

func (*TxCancel) Reset added in v0.57.0

func (x *TxCancel) Reset()

func (*TxCancel) SizeVT added in v0.57.0

func (m *TxCancel) SizeVT() (n int)

func (*TxCancel) String added in v0.57.0

func (x *TxCancel) String() string

func (*TxCancel) UnmarshalJSON added in v0.57.0

func (x *TxCancel) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxCancel from JSON.

func (*TxCancel) UnmarshalProtoJSON added in v0.57.0

func (x *TxCancel) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxCancel message from JSON.

func (*TxCancel) UnmarshalVT added in v0.57.0

func (m *TxCancel) UnmarshalVT(dAtA []byte) error

func (*TxCancel) Validate added in v0.57.0

func (t *TxCancel) Validate() error

Validate performs a cursory check of the transaction.

type TxComplete

type TxComplete struct {

	// Result is information about the outcome of a completed execution.
	Result *value.Result `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
	// ClaimEpoch is the fencing token authorizing this completion.
	ClaimEpoch uint64 `protobuf:"varint,2,opt,name=claim_epoch,json=claimEpoch,proto3" json:"claimEpoch,omitempty"`
	// ClaimId identifies the controller instance carrying the epoch.
	ClaimId string `protobuf:"bytes,3,opt,name=claim_id,json=claimId,proto3" json:"claimId,omitempty"`
	// contains filtered or unexported fields
}

TxComplete completes the execution by setting the result. Execution must be RUNNING, CANCELING with a canceled result, or COMPLETE with the same claim. Sender must be the peer_id specified on the Execution. TxType: TxType_COMPLETE

func (*TxComplete) CloneMessageVT

func (m *TxComplete) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxComplete) CloneVT

func (m *TxComplete) CloneVT() *TxComplete

func (*TxComplete) EqualMessageVT

func (this *TxComplete) EqualMessageVT(thatMsg any) bool

func (*TxComplete) EqualVT

func (this *TxComplete) EqualVT(that *TxComplete) bool

func (*TxComplete) ExecuteTx

func (t *TxComplete) ExecuteTx(
	ctx context.Context,
	sender peer.ID,
	exCursor *block.Cursor,
	root *forge_execution.Execution,
) error

ExecuteTx executes the transaction against the execution instance.

func (*TxComplete) GetClaimEpoch added in v0.57.0

func (x *TxComplete) GetClaimEpoch() uint64

func (*TxComplete) GetClaimId added in v0.57.0

func (x *TxComplete) GetClaimId() string

func (*TxComplete) GetResult

func (x *TxComplete) GetResult() *value.Result

func (*TxComplete) GetTxType

func (t *TxComplete) GetTxType() TxType

GetTxType returns the type of transaction this is.

func (*TxComplete) MarshalJSON

func (x *TxComplete) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxComplete to JSON.

func (*TxComplete) MarshalProtoJSON

func (x *TxComplete) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxComplete message to JSON.

func (*TxComplete) MarshalProtoText

func (x *TxComplete) MarshalProtoText() string

func (*TxComplete) MarshalToSizedBufferVT

func (m *TxComplete) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxComplete) MarshalToVT

func (m *TxComplete) MarshalToVT(dAtA []byte) (int, error)

func (*TxComplete) MarshalVT

func (m *TxComplete) MarshalVT() (dAtA []byte, err error)

func (*TxComplete) ProtoMessage

func (*TxComplete) ProtoMessage()

func (*TxComplete) Reset

func (x *TxComplete) Reset()

func (*TxComplete) SizeVT

func (m *TxComplete) SizeVT() (n int)

func (*TxComplete) String

func (x *TxComplete) String() string

func (*TxComplete) UnmarshalJSON

func (x *TxComplete) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxComplete from JSON.

func (*TxComplete) UnmarshalProtoJSON

func (x *TxComplete) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxComplete message from JSON.

func (*TxComplete) UnmarshalVT

func (m *TxComplete) UnmarshalVT(dAtA []byte) error

func (*TxComplete) Validate

func (t *TxComplete) Validate() error

Validate performs a cursory check of the transaction. Note: this should not fetch network data.

type TxReclaim added in v0.57.0

type TxReclaim struct {

	// PeerId is the peer identifier to set as the executor.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// ClaimId is the opaque identifier of the new controller instance.
	ClaimId string `protobuf:"bytes,2,opt,name=claim_id,json=claimId,proto3" json:"claimId,omitempty"`
	// ExpectedClaimEpoch prevents racing transfers from both succeeding.
	ExpectedClaimEpoch uint64 `protobuf:"varint,3,opt,name=expected_claim_epoch,json=expectedClaimEpoch,proto3" json:"expectedClaimEpoch,omitempty"`
	// ObservedAt is the time the sender observed the claim lease expired. The
	// transaction applies only when the current lease expires at or before it.
	ObservedAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=observed_at,json=observedAt,proto3" json:"observedAt,omitempty"`
	// LeaseExpiresAt is the initial lease expiry of the new claim.
	// Must be after observed_at.
	LeaseExpiresAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=lease_expires_at,json=leaseExpiresAt,proto3" json:"leaseExpiresAt,omitempty"`
	// ExecutionObjectKey identifies the Execution to reclaim in a World operation.
	ExecutionObjectKey string `protobuf:"bytes,6,opt,name=execution_object_key,json=executionObjectKey,proto3" json:"executionObjectKey,omitempty"`
	// Placement selects the reclaiming Worker's custody. Required when replacing
	// an existing placement; its peer must match PeerId and be linked to the Worker.
	Placement *worker.Placement `protobuf:"bytes,7,opt,name=placement,proto3" json:"placement,omitempty"`
	// contains filtered or unexported fields
}

TxReclaim transfers a RUNNING or CANCELING execution to a new controller instance once the current claim lease has expired. TxType: TxType_RECLAIM

func (*TxReclaim) CloneMessageVT added in v0.57.0

func (m *TxReclaim) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxReclaim) CloneVT added in v0.57.0

func (m *TxReclaim) CloneVT() *TxReclaim

func (*TxReclaim) EqualMessageVT added in v0.57.0

func (this *TxReclaim) EqualMessageVT(thatMsg any) bool

func (*TxReclaim) EqualVT added in v0.57.0

func (this *TxReclaim) EqualVT(that *TxReclaim) bool

func (*TxReclaim) ExecuteTx added in v0.57.0

func (t *TxReclaim) ExecuteTx(
	ctx context.Context,
	sender peer.ID,
	exCursor *block.Cursor,
	root *forge_execution.Execution,
) error

ExecuteTx executes the transaction against the execution instance.

func (*TxReclaim) GetClaimId added in v0.57.0

func (x *TxReclaim) GetClaimId() string

func (*TxReclaim) GetExecutionObjectKey

func (x *TxReclaim) GetExecutionObjectKey() string

func (*TxReclaim) GetExpectedClaimEpoch added in v0.57.0

func (x *TxReclaim) GetExpectedClaimEpoch() uint64

func (*TxReclaim) GetLeaseExpiresAt

func (x *TxReclaim) GetLeaseExpiresAt() *timestamppb.Timestamp

func (*TxReclaim) GetObservedAt

func (x *TxReclaim) GetObservedAt() *timestamppb.Timestamp

func (*TxReclaim) GetPeerId added in v0.57.0

func (x *TxReclaim) GetPeerId() string

func (*TxReclaim) GetPlacement

func (x *TxReclaim) GetPlacement() *worker.Placement

func (*TxReclaim) GetTxType added in v0.57.0

func (t *TxReclaim) GetTxType() TxType

GetTxType returns the type of transaction this is.

func (*TxReclaim) MarshalJSON added in v0.57.0

func (x *TxReclaim) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxReclaim to JSON.

func (*TxReclaim) MarshalProtoJSON added in v0.57.0

func (x *TxReclaim) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxReclaim message to JSON.

func (*TxReclaim) MarshalProtoText added in v0.57.0

func (x *TxReclaim) MarshalProtoText() string

func (*TxReclaim) MarshalToSizedBufferVT added in v0.57.0

func (m *TxReclaim) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxReclaim) MarshalToVT added in v0.57.0

func (m *TxReclaim) MarshalToVT(dAtA []byte) (int, error)

func (*TxReclaim) MarshalVT added in v0.57.0

func (m *TxReclaim) MarshalVT() (dAtA []byte, err error)

func (*TxReclaim) ParsePeerID added in v0.57.0

func (t *TxReclaim) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID field.

func (*TxReclaim) ProtoMessage added in v0.57.0

func (*TxReclaim) ProtoMessage()

func (*TxReclaim) Reset added in v0.57.0

func (x *TxReclaim) Reset()

func (*TxReclaim) SizeVT added in v0.57.0

func (m *TxReclaim) SizeVT() (n int)

func (*TxReclaim) String added in v0.57.0

func (x *TxReclaim) String() string

func (*TxReclaim) UnmarshalJSON added in v0.57.0

func (x *TxReclaim) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxReclaim from JSON.

func (*TxReclaim) UnmarshalProtoJSON added in v0.57.0

func (x *TxReclaim) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxReclaim message from JSON.

func (*TxReclaim) UnmarshalVT added in v0.57.0

func (m *TxReclaim) UnmarshalVT(dAtA []byte) error

func (*TxReclaim) Validate added in v0.57.0

func (t *TxReclaim) Validate() error

Validate performs a cursory check of the transaction.

type TxRenewClaim

type TxRenewClaim struct {

	// ClaimEpoch fences this renewal to the current claim.
	ClaimEpoch uint64 `protobuf:"varint,1,opt,name=claim_epoch,json=claimEpoch,proto3" json:"claimEpoch,omitempty"`
	// ClaimId identifies the controller carrying the claim.
	ClaimId string `protobuf:"bytes,2,opt,name=claim_id,json=claimId,proto3" json:"claimId,omitempty"`
	// LeaseExpiresAt is the new lease expiry. A renewal that would not extend
	// the current lease changes nothing.
	LeaseExpiresAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=lease_expires_at,json=leaseExpiresAt,proto3" json:"leaseExpiresAt,omitempty"`
	// contains filtered or unexported fields
}

TxRenewClaim extends the claim lease while its holder is alive. Execution must be RUNNING or CANCELING. TxType: TxType_RENEW_CLAIM

func (*TxRenewClaim) CloneMessageVT

func (m *TxRenewClaim) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxRenewClaim) CloneVT

func (m *TxRenewClaim) CloneVT() *TxRenewClaim

func (*TxRenewClaim) EqualMessageVT

func (this *TxRenewClaim) EqualMessageVT(thatMsg any) bool

func (*TxRenewClaim) EqualVT

func (this *TxRenewClaim) EqualVT(that *TxRenewClaim) bool

func (*TxRenewClaim) ExecuteTx

func (t *TxRenewClaim) ExecuteTx(ctx context.Context, sender peer.ID, exCursor *block.Cursor, root *forge_execution.Execution) error

ExecuteTx extends the lease while the claimed execution is active.

func (*TxRenewClaim) GetClaimEpoch

func (x *TxRenewClaim) GetClaimEpoch() uint64

func (*TxRenewClaim) GetClaimId

func (x *TxRenewClaim) GetClaimId() string

func (*TxRenewClaim) GetLeaseExpiresAt

func (x *TxRenewClaim) GetLeaseExpiresAt() *timestamppb.Timestamp

func (*TxRenewClaim) GetTxType

func (t *TxRenewClaim) GetTxType() TxType

GetTxType returns the lease renewal transaction type.

func (*TxRenewClaim) MarshalJSON

func (x *TxRenewClaim) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxRenewClaim to JSON.

func (*TxRenewClaim) MarshalProtoJSON

func (x *TxRenewClaim) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxRenewClaim message to JSON.

func (*TxRenewClaim) MarshalProtoText

func (x *TxRenewClaim) MarshalProtoText() string

func (*TxRenewClaim) MarshalToSizedBufferVT

func (m *TxRenewClaim) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxRenewClaim) MarshalToVT

func (m *TxRenewClaim) MarshalToVT(dAtA []byte) (int, error)

func (*TxRenewClaim) MarshalVT

func (m *TxRenewClaim) MarshalVT() (dAtA []byte, err error)

func (*TxRenewClaim) ProtoMessage

func (*TxRenewClaim) ProtoMessage()

func (*TxRenewClaim) Reset

func (x *TxRenewClaim) Reset()

func (*TxRenewClaim) SizeVT

func (m *TxRenewClaim) SizeVT() (n int)

func (*TxRenewClaim) String

func (x *TxRenewClaim) String() string

func (*TxRenewClaim) UnmarshalJSON

func (x *TxRenewClaim) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxRenewClaim from JSON.

func (*TxRenewClaim) UnmarshalProtoJSON

func (x *TxRenewClaim) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxRenewClaim message from JSON.

func (*TxRenewClaim) UnmarshalVT

func (m *TxRenewClaim) UnmarshalVT(dAtA []byte) error

func (*TxRenewClaim) Validate

func (t *TxRenewClaim) Validate() error

Validate requires a claim identity and a lease.

type TxSetOutputs

type TxSetOutputs struct {

	// Outputs is the set of values to set.
	Outputs []*value.Value `protobuf:"bytes,1,rep,name=outputs,proto3" json:"outputs,omitempty"`
	// ClearOld indicates to clear all old output values before setting.
	ClearOld bool `protobuf:"varint,2,opt,name=clear_old,json=clearOld,proto3" json:"clearOld,omitempty"`
	// ClaimEpoch is the fencing token authorizing this write.
	ClaimEpoch uint64 `protobuf:"varint,3,opt,name=claim_epoch,json=claimEpoch,proto3" json:"claimEpoch,omitempty"`
	// ClaimId identifies the controller instance carrying the epoch.
	ClaimId string `protobuf:"bytes,4,opt,name=claim_id,json=claimId,proto3" json:"claimId,omitempty"`
	// contains filtered or unexported fields
}

TxSetOutputs updates the value of one or more execution outputs. Execution must be RUNNING or CANCELING. Sender must be the peer_id specified on the Execution. TxType: TxType_SET_OUTPUTS

func (*TxSetOutputs) CloneMessageVT

func (m *TxSetOutputs) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxSetOutputs) CloneVT

func (m *TxSetOutputs) CloneVT() *TxSetOutputs

func (*TxSetOutputs) EqualMessageVT

func (this *TxSetOutputs) EqualMessageVT(thatMsg any) bool

func (*TxSetOutputs) EqualVT

func (this *TxSetOutputs) EqualVT(that *TxSetOutputs) bool

func (*TxSetOutputs) ExecuteTx

func (t *TxSetOutputs) ExecuteTx(
	ctx context.Context,
	sender peer.ID,
	exCursor *block.Cursor,
	root *forge_execution.Execution,
) error

ExecuteTx executes the transaction against the execution instance.

func (*TxSetOutputs) GetClaimEpoch added in v0.57.0

func (x *TxSetOutputs) GetClaimEpoch() uint64

func (*TxSetOutputs) GetClaimId added in v0.57.0

func (x *TxSetOutputs) GetClaimId() string

func (*TxSetOutputs) GetClearOld

func (x *TxSetOutputs) GetClearOld() bool

func (*TxSetOutputs) GetOutputs

func (x *TxSetOutputs) GetOutputs() []*value.Value

func (*TxSetOutputs) GetTxType

func (t *TxSetOutputs) GetTxType() TxType

GetTxType returns the type of transaction this is.

func (*TxSetOutputs) MarshalJSON

func (x *TxSetOutputs) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxSetOutputs to JSON.

func (*TxSetOutputs) MarshalProtoJSON

func (x *TxSetOutputs) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxSetOutputs message to JSON.

func (*TxSetOutputs) MarshalProtoText

func (x *TxSetOutputs) MarshalProtoText() string

func (*TxSetOutputs) MarshalToSizedBufferVT

func (m *TxSetOutputs) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxSetOutputs) MarshalToVT

func (m *TxSetOutputs) MarshalToVT(dAtA []byte) (int, error)

func (*TxSetOutputs) MarshalVT

func (m *TxSetOutputs) MarshalVT() (dAtA []byte, err error)

func (*TxSetOutputs) ProtoMessage

func (*TxSetOutputs) ProtoMessage()

func (*TxSetOutputs) Reset

func (x *TxSetOutputs) Reset()

func (*TxSetOutputs) SizeVT

func (m *TxSetOutputs) SizeVT() (n int)

func (*TxSetOutputs) String

func (x *TxSetOutputs) String() string

func (*TxSetOutputs) UnmarshalJSON

func (x *TxSetOutputs) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxSetOutputs from JSON.

func (*TxSetOutputs) UnmarshalProtoJSON

func (x *TxSetOutputs) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxSetOutputs message from JSON.

func (*TxSetOutputs) UnmarshalVT

func (m *TxSetOutputs) UnmarshalVT(dAtA []byte) error

func (*TxSetOutputs) Validate

func (t *TxSetOutputs) Validate() error

Validate performs a cursory check of the transaction. Note: this should not fetch network data.

type TxSetWaitingPlugin

type TxSetWaitingPlugin struct {

	// PluginId is the plugin being awaited, or empty after its client is available.
	PluginId string `protobuf:"bytes,1,opt,name=plugin_id,json=pluginId,proto3" json:"pluginId,omitempty"`
	// ClaimEpoch fences this update to the current claim.
	ClaimEpoch uint64 `protobuf:"varint,2,opt,name=claim_epoch,json=claimEpoch,proto3" json:"claimEpoch,omitempty"`
	// ClaimId identifies the controller carrying the claim.
	ClaimId string `protobuf:"bytes,3,opt,name=claim_id,json=claimId,proto3" json:"claimId,omitempty"`
	// contains filtered or unexported fields
}

TxSetWaitingPlugin records or clears the plugin load wait under the current claim.

func (*TxSetWaitingPlugin) CloneMessageVT

func (m *TxSetWaitingPlugin) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxSetWaitingPlugin) CloneVT

func (m *TxSetWaitingPlugin) CloneVT() *TxSetWaitingPlugin

func (*TxSetWaitingPlugin) EqualMessageVT

func (this *TxSetWaitingPlugin) EqualMessageVT(thatMsg any) bool

func (*TxSetWaitingPlugin) EqualVT

func (this *TxSetWaitingPlugin) EqualVT(that *TxSetWaitingPlugin) bool

func (*TxSetWaitingPlugin) ExecuteTx

func (t *TxSetWaitingPlugin) ExecuteTx(ctx context.Context, sender peer.ID, exCursor *block.Cursor, root *forge_execution.Execution) error

ExecuteTx writes the waiting plugin ID while the claimed execution is active.

func (*TxSetWaitingPlugin) GetClaimEpoch

func (x *TxSetWaitingPlugin) GetClaimEpoch() uint64

func (*TxSetWaitingPlugin) GetClaimId

func (x *TxSetWaitingPlugin) GetClaimId() string

func (*TxSetWaitingPlugin) GetPluginId

func (x *TxSetWaitingPlugin) GetPluginId() string

func (*TxSetWaitingPlugin) GetTxType

func (t *TxSetWaitingPlugin) GetTxType() TxType

GetTxType returns the plugin wait transaction type.

func (*TxSetWaitingPlugin) MarshalJSON

func (x *TxSetWaitingPlugin) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxSetWaitingPlugin to JSON.

func (*TxSetWaitingPlugin) MarshalProtoJSON

func (x *TxSetWaitingPlugin) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxSetWaitingPlugin message to JSON.

func (*TxSetWaitingPlugin) MarshalProtoText

func (x *TxSetWaitingPlugin) MarshalProtoText() string

func (*TxSetWaitingPlugin) MarshalToSizedBufferVT

func (m *TxSetWaitingPlugin) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxSetWaitingPlugin) MarshalToVT

func (m *TxSetWaitingPlugin) MarshalToVT(dAtA []byte) (int, error)

func (*TxSetWaitingPlugin) MarshalVT

func (m *TxSetWaitingPlugin) MarshalVT() (dAtA []byte, err error)

func (*TxSetWaitingPlugin) ProtoMessage

func (*TxSetWaitingPlugin) ProtoMessage()

func (*TxSetWaitingPlugin) Reset

func (x *TxSetWaitingPlugin) Reset()

func (*TxSetWaitingPlugin) SizeVT

func (m *TxSetWaitingPlugin) SizeVT() (n int)

func (*TxSetWaitingPlugin) String

func (x *TxSetWaitingPlugin) String() string

func (*TxSetWaitingPlugin) UnmarshalJSON

func (x *TxSetWaitingPlugin) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxSetWaitingPlugin from JSON.

func (*TxSetWaitingPlugin) UnmarshalProtoJSON

func (x *TxSetWaitingPlugin) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxSetWaitingPlugin message from JSON.

func (*TxSetWaitingPlugin) UnmarshalVT

func (m *TxSetWaitingPlugin) UnmarshalVT(dAtA []byte) error

func (*TxSetWaitingPlugin) Validate

func (t *TxSetWaitingPlugin) Validate() error

Validate requires a current execution claim.

type TxStart

type TxStart struct {

	// PeerId is the peer identifier to set as the executor.
	// Must be the same as the sender of the transaction.
	// Must match peer_id on the Execution if it's not empty.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// ClaimId is the opaque identifier of the claiming controller instance.
	ClaimId string `protobuf:"bytes,2,opt,name=claim_id,json=claimId,proto3" json:"claimId,omitempty"`
	// LeaseExpiresAt is the initial lease expiry of a new claim.
	LeaseExpiresAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=lease_expires_at,json=leaseExpiresAt,proto3" json:"leaseExpiresAt,omitempty"`
	// contains filtered or unexported fields
}

TxStart starts the execution with a peer id. Execution must be PENDING, or active with the same claim. TxType: TxType_START

func (*TxStart) CloneMessageVT

func (m *TxStart) CloneMessageVT() protobuf_go_lite.CloneMessage

func (*TxStart) CloneVT

func (m *TxStart) CloneVT() *TxStart

func (*TxStart) EqualMessageVT

func (this *TxStart) EqualMessageVT(thatMsg any) bool

func (*TxStart) EqualVT

func (this *TxStart) EqualVT(that *TxStart) bool

func (*TxStart) ExecuteTx

func (t *TxStart) ExecuteTx(
	ctx context.Context,
	sender peer.ID,
	exCursor *block.Cursor,
	root *forge_execution.Execution,
) error

ExecuteTx executes the transaction against the execution instance.

func (*TxStart) GetClaimId added in v0.57.0

func (x *TxStart) GetClaimId() string

func (*TxStart) GetLeaseExpiresAt

func (x *TxStart) GetLeaseExpiresAt() *timestamppb.Timestamp

func (*TxStart) GetPeerId

func (x *TxStart) GetPeerId() string

func (*TxStart) GetTxType

func (t *TxStart) GetTxType() TxType

GetTxType returns the type of transaction this is.

func (*TxStart) MarshalJSON

func (x *TxStart) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxStart to JSON.

func (*TxStart) MarshalProtoJSON

func (x *TxStart) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxStart message to JSON.

func (*TxStart) MarshalProtoText

func (x *TxStart) MarshalProtoText() string

func (*TxStart) MarshalToSizedBufferVT

func (m *TxStart) MarshalToSizedBufferVT(dAtA []byte) (int, error)

func (*TxStart) MarshalToVT

func (m *TxStart) MarshalToVT(dAtA []byte) (int, error)

func (*TxStart) MarshalVT

func (m *TxStart) MarshalVT() (dAtA []byte, err error)

func (*TxStart) ParsePeerID

func (t *TxStart) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID field.

func (*TxStart) ProtoMessage

func (*TxStart) ProtoMessage()

func (*TxStart) Reset

func (x *TxStart) Reset()

func (*TxStart) SizeVT

func (m *TxStart) SizeVT() (n int)

func (*TxStart) String

func (x *TxStart) String() string

func (*TxStart) UnmarshalJSON

func (x *TxStart) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxStart from JSON.

func (*TxStart) UnmarshalProtoJSON

func (x *TxStart) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxStart message from JSON.

func (*TxStart) UnmarshalVT

func (m *TxStart) UnmarshalVT(dAtA []byte) error

func (*TxStart) Validate

func (t *TxStart) Validate() error

Validate performs a cursory check of the transaction. Note: this should not fetch network data.

type TxType

type TxType int32

TxType indicates the kind of transaction.

const (
	TxType_TxType_INVALID TxType = 0
	// TxType_START starts execution of the transaction.
	TxType_TxType_START TxType = 1
	// TxType_SET_OUTPUTS changes the value of an output.
	TxType_TxType_SET_OUTPUTS TxType = 2
	// TxType_COMPLETE sets the result of the execution.
	TxType_TxType_COMPLETE TxType = 3
	// TxType_APPEND_LOG appends log entries to the execution.
	TxType_TxType_APPEND_LOG TxType = 4
	// TxType_CANCEL requests cancellation and custody drain.
	TxType_TxType_CANCEL TxType = 5
	// TxType_RECLAIM transfers a running execution to a new claim owner.
	TxType_TxType_RECLAIM TxType = 6
	// TxType_SET_WAITING_PLUGIN changes the plugin load wait.
	TxType_TxType_SET_WAITING_PLUGIN TxType = 7
	// TxType_RENEW_CLAIM extends the lease of the current claim.
	TxType_TxType_RENEW_CLAIM TxType = 8
)

func (TxType) Enum

func (x TxType) Enum() *TxType

func (TxType) MarshalJSON

func (x TxType) MarshalJSON() ([]byte, error)

MarshalJSON marshals the TxType to JSON.

func (TxType) MarshalProtoJSON

func (x TxType) MarshalProtoJSON(s *json.MarshalState)

MarshalProtoJSON marshals the TxType to JSON.

func (TxType) MarshalProtoText

func (x TxType) MarshalProtoText() string

func (TxType) MarshalText

func (x TxType) MarshalText() ([]byte, error)

MarshalText marshals the TxType to text.

func (TxType) String

func (x TxType) String() string

func (*TxType) UnmarshalJSON

func (x *TxType) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the TxType from JSON.

func (*TxType) UnmarshalProtoJSON

func (x *TxType) UnmarshalProtoJSON(s *json.UnmarshalState)

UnmarshalProtoJSON unmarshals the TxType from JSON.

func (*TxType) UnmarshalText

func (x *TxType) UnmarshalText(b []byte) error

UnmarshalText unmarshals the TxType from text.

func (TxType) Validate

func (t TxType) Validate() error

Validate checks the execution tx type is in range.

Jump to

Keyboard shortcuts

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