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

sobject

package
v0.57.26 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// MaxErrorDetailsSize is the maximum size in bytes for error details
	MaxErrorDetailsSize = 4096

	// MaxBlockRefSize is the maximum size in bytes for block references
	MaxBlockRefSize = 256

	// MaxInnerDataSize is the maximum size in bytes for inner data
	MaxInnerDataSize = 1024 * 1024 // 1 MB

	// MaxSignatureSize is the maximum size in bytes for signatures
	MaxSignatureSize = 512

	// MaxParticipants is the maximum number of participants in a shared object
	MaxParticipants = 100

	// MaxOperations is the maximum number of operations above the checkpoint
	MaxOperations = 65536

	// MaxStateDataSize is the maximum size in bytes for state data
	MaxStateDataSize = 10 * 1024 * 1024 // 10 MB
)
View Source
const (
	// MaxBodyTypeLength is the maximum length of a body_type string.
	MaxBodyTypeLength = 1024
	// MaxBodyMetaLength is the maximum length of body_meta bytes.
	MaxBodyMetaLength = 4096
)
View Source
const AcknowledgmentLag = 64

AcknowledgmentLag is the number of placed edits a roster member may leave unacknowledged before it writes an acknowledgment.

View Source
const MaxConfigSuffixBytes = 8 * 1024 * 1024

MaxConfigSuffixBytes bounds serialized configuration history held during catch-up.

View Source
const MaxConfigSuffixEntries = 4096

MaxConfigSuffixEntries bounds one peer catch-up transaction.

View Source
const MaxControlMessages = MaxParticipants * (maxControlRounds*3*maxControlEvidence + maxControlAgreements) * 2

MaxControlMessages bounds the control messages a state holds.

View Source
const MaxSOOperationParents = 256

MaxSOOperationParents bounds the causal parents named by one operation.

View Source
const MaxVotingWeight = 1 << 16

MaxVotingWeight bounds one device's voting weight, so weight sums over MaxParticipants devices cannot overflow.

View Source
const MinCheckpointOperations = 32

MinCheckpointOperations is the number of stable operations an owner waits for before it signs a checkpoint below them.

View Source
const OwnerTypeAccount = "account"

OwnerTypeAccount is the owner type for account-owned shared objects.

View Source
const OwnerTypeOrganization = "organization"

OwnerTypeOrganization is the owner type for org-owned shared objects.

View Source
const ReasonEquivocated = "its author signed another operation at the same sequence"

ReasonEquivocated is the outcome of an operation whose author signed another operation at the same sequence.

View Source
const ReasonRemoved = "its author was removed from the shared object"

ReasonRemoved is the outcome of an operation whose author was removed from the shared object before the operation reached the removing owner.

View Source
const SOOperationProtocolVersion = 1

SOOperationProtocolVersion is the operation format this build writes and accepts.

View Source
const SOReplayVersion = 1

SOReplayVersion is the replay rule version this build computes Worlds with.

Variables

View Source
var (
	// ErrEmptySharedObjectID is returned if the shared object id was empty.
	ErrEmptySharedObjectID = errors.New("shared object id cannot be empty")

	// ErrInvalidSharedObjectID is returned if the shared object id was invalid.
	ErrInvalidSharedObjectID = errors.New("invalid shared object id")

	// ErrSharedObjectExists is returned if the shared object already exists.
	ErrSharedObjectExists = errors.New("shared object with that id already exists")

	// ErrSharedObjectNotFound is returned if the sobject was not found.
	ErrSharedObjectNotFound = errors.New("shared object not found")

	// ErrInvalidSOParticipantRole is returned if the shared object participant role is invalid.
	ErrInvalidSOParticipantRole = errors.New("invalid shared object participant role")

	// ErrEmptyParticipants is returned if no participants are specified in the SharedObjectConfig.
	ErrEmptyParticipants = errors.New("empty shared object participants list")

	// ErrNoOwner is returned if a nonempty SharedObjectConfig has no OWNER.
	ErrNoOwner = errors.New("shared object participants have no owner")

	// ErrEmptyBodyType is returned if the sobject body type was empty.
	ErrEmptyBodyType = errors.New("empty shared object body type")

	// ErrUnsupportedBodyType identifies a body the mounted resource cannot serve.
	ErrUnsupportedBodyType = errors.New("unsupported shared object type")

	// ErrEmptyInnerData is returned if the inner data was empty.
	ErrEmptyInnerData = errors.New("empty inner data")

	// ErrConfigChainHeadMismatch is returned if a config change does not
	// extend the held config chain head. The writer read a stale head and may
	// rebuild the change against the current one.
	ErrConfigChainHeadMismatch = errors.New("config change previous_hash does not match current config_chain_hash")

	// ErrInvalidNonce is returned if the op nonce was unexpected.
	ErrInvalidNonce = errors.New("invalid shared object op nonce")

	// ErrCannotDecode is returned if our local peer cannot decode the inner data (no valid grant).
	ErrCannotDecode = errors.New("access denied: no valid grant for our peer")

	// ErrKeyEpochUnavailable is returned if the local peer holds no grant for
	// the key epoch an operation or checkpoint names. Replay stops instead of
	// deciding an outcome, so members never diverge on what they could read.
	ErrKeyEpochUnavailable = errors.New("no grant for the key epoch")

	// ErrNotParticipant is returned if the peer is not a participant in the shared object.
	ErrNotParticipant = errors.New("access denied: peer is not a participant")

	// ErrEmptyTransformConfig is returned if the transform config was empty.
	ErrEmptyTransformConfig = errors.New("transform config is required")

	// ErrMaxSizeExceeded is returned if a size limit is exceeded.
	ErrMaxSizeExceeded = errors.New("maximum size exceeded")

	// ErrMaxCountExceeded is returned if a count limit is exceeded.
	ErrMaxCountExceeded = errors.New("maximum count exceeded")

	// ErrInvalidLocalOpID is returned if the local op id is invalid.
	ErrInvalidLocalOpID = ulid.ErrInvalidULID

	// ErrRejectedOp is returned if the op was rejected.
	ErrRejectedOp = errors.New("rejected op")

	// ErrInvalidMeta is returned if the metadata is invalid.
	ErrInvalidMeta = errors.New("sobject: meta: invalid shared object metadata")

	// ErrSharedObjectRecoveryCredentialRequired is returned if recovery needs entity credentials.
	ErrSharedObjectRecoveryCredentialRequired = errors.New("shared object recovery requires entity credentials")

	// ErrSharedObjectRecoveryEntityMismatch is returned if recovery material does not match the current entity.
	ErrSharedObjectRecoveryEntityMismatch = errors.New("shared object recovery entity mismatch")
)
View Source
var (
	SharedObjectHealthStatus_name = map[int32]string{
		0: "SHARED_OBJECT_HEALTH_STATUS_UNKNOWN",
		1: "SHARED_OBJECT_HEALTH_STATUS_LOADING",
		2: "SHARED_OBJECT_HEALTH_STATUS_READY",
		3: "SHARED_OBJECT_HEALTH_STATUS_DEGRADED",
		4: "SHARED_OBJECT_HEALTH_STATUS_CLOSED",
	}
	SharedObjectHealthStatus_value = map[string]int32{
		"SHARED_OBJECT_HEALTH_STATUS_UNKNOWN":  0,
		"SHARED_OBJECT_HEALTH_STATUS_LOADING":  1,
		"SHARED_OBJECT_HEALTH_STATUS_READY":    2,
		"SHARED_OBJECT_HEALTH_STATUS_DEGRADED": 3,
		"SHARED_OBJECT_HEALTH_STATUS_CLOSED":   4,
	}
)

Enum value maps for SharedObjectHealthStatus.

View Source
var (
	SharedObjectHealthLayer_name = map[int32]string{
		0: "SHARED_OBJECT_HEALTH_LAYER_UNKNOWN",
		1: "SHARED_OBJECT_HEALTH_LAYER_SHARED_OBJECT",
		2: "SHARED_OBJECT_HEALTH_LAYER_BODY",
	}
	SharedObjectHealthLayer_value = map[string]int32{
		"SHARED_OBJECT_HEALTH_LAYER_UNKNOWN":       0,
		"SHARED_OBJECT_HEALTH_LAYER_SHARED_OBJECT": 1,
		"SHARED_OBJECT_HEALTH_LAYER_BODY":          2,
	}
)

Enum value maps for SharedObjectHealthLayer.

View Source
var (
	SharedObjectHealthCommonReason_name = map[int32]string{
		0: "SHARED_OBJECT_HEALTH_COMMON_REASON_UNKNOWN",
		1: "SHARED_OBJECT_HEALTH_COMMON_REASON_NOT_FOUND",
		2: "SHARED_OBJECT_HEALTH_COMMON_REASON_ACCESS_REVOKED",
		3: "SHARED_OBJECT_HEALTH_COMMON_REASON_INITIAL_STATE_REJECTED",
		4: "SHARED_OBJECT_HEALTH_COMMON_REASON_BLOCK_NOT_FOUND",
		5: "SHARED_OBJECT_HEALTH_COMMON_REASON_TRANSFORM_CONFIG_DECODE_FAILED",
		6: "SHARED_OBJECT_HEALTH_COMMON_REASON_BODY_CONFIG_DECODE_FAILED",
	}
	SharedObjectHealthCommonReason_value = map[string]int32{
		"SHARED_OBJECT_HEALTH_COMMON_REASON_UNKNOWN":                        0,
		"SHARED_OBJECT_HEALTH_COMMON_REASON_NOT_FOUND":                      1,
		"SHARED_OBJECT_HEALTH_COMMON_REASON_ACCESS_REVOKED":                 2,
		"SHARED_OBJECT_HEALTH_COMMON_REASON_INITIAL_STATE_REJECTED":         3,
		"SHARED_OBJECT_HEALTH_COMMON_REASON_BLOCK_NOT_FOUND":                4,
		"SHARED_OBJECT_HEALTH_COMMON_REASON_TRANSFORM_CONFIG_DECODE_FAILED": 5,
		"SHARED_OBJECT_HEALTH_COMMON_REASON_BODY_CONFIG_DECODE_FAILED":      6,
	}
)

Enum value maps for SharedObjectHealthCommonReason.

View Source
var (
	SharedObjectHealthRemediationHint_name = map[int32]string{
		0: "SHARED_OBJECT_HEALTH_REMEDIATION_HINT_UNKNOWN",
		1: "SHARED_OBJECT_HEALTH_REMEDIATION_HINT_NONE",
		2: "SHARED_OBJECT_HEALTH_REMEDIATION_HINT_RETRY",
		3: "SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REQUEST_ACCESS",
		4: "SHARED_OBJECT_HEALTH_REMEDIATION_HINT_CONTACT_OWNER",
		5: "SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REPAIR_SOURCE_DATA",
	}
	SharedObjectHealthRemediationHint_value = map[string]int32{
		"SHARED_OBJECT_HEALTH_REMEDIATION_HINT_UNKNOWN":            0,
		"SHARED_OBJECT_HEALTH_REMEDIATION_HINT_NONE":               1,
		"SHARED_OBJECT_HEALTH_REMEDIATION_HINT_RETRY":              2,
		"SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REQUEST_ACCESS":     3,
		"SHARED_OBJECT_HEALTH_REMEDIATION_HINT_CONTACT_OWNER":      4,
		"SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REPAIR_SOURCE_DATA": 5,
	}
)

Enum value maps for SharedObjectHealthRemediationHint.

View Source
var (
	SOParticipantRole_name = map[int32]string{
		0: "SOParticipantRole_UNKNOWN",
		1: "SOParticipantRole_READER",
		2: "SOParticipantRole_WRITER",
		3: "SOParticipantRole_OWNER",
	}
	SOParticipantRole_value = map[string]int32{
		"SOParticipantRole_UNKNOWN": 0,
		"SOParticipantRole_READER":  1,
		"SOParticipantRole_WRITER":  2,
		"SOParticipantRole_OWNER":   3,
	}
)

Enum value maps for SOParticipantRole.

View Source
var (
	SOControl_name = map[int32]string{
		0: "SO_CONTROL_OWNER",
		1: "SO_CONTROL_GROUP",
	}
	SOControl_value = map[string]int32{
		"SO_CONTROL_OWNER": 0,
		"SO_CONTROL_GROUP": 1,
	}
)

Enum value maps for SOControl.

View Source
var (
	SOConfigChangeType_name = map[int32]string{
		0:  "SO_CONFIG_CHANGE_TYPE_UNKNOWN",
		1:  "SO_CONFIG_CHANGE_TYPE_GENESIS",
		2:  "SO_CONFIG_CHANGE_TYPE_ADD_PARTICIPANT",
		3:  "SO_CONFIG_CHANGE_TYPE_REMOVE_PARTICIPANT",
		4:  "SO_CONFIG_CHANGE_TYPE_ADD_INVITE",
		5:  "SO_CONFIG_CHANGE_TYPE_REVOKE_INVITE",
		6:  "SO_CONFIG_CHANGE_TYPE_INCREMENT_INVITE_USES",
		7:  "SO_CONFIG_CHANGE_TYPE_SELF_ENROLL_PEER",
		8:  "SO_CONFIG_CHANGE_TYPE_TRANSFER_OWNERSHIP",
		9:  "SO_CONFIG_CHANGE_TYPE_SET_ROSTER",
		10: "SO_CONFIG_CHANGE_TYPE_SET_SEQUENCER",
		11: "SO_CONFIG_CHANGE_TYPE_SET_CONTROL",
	}
	SOConfigChangeType_value = map[string]int32{
		"SO_CONFIG_CHANGE_TYPE_UNKNOWN":               0,
		"SO_CONFIG_CHANGE_TYPE_GENESIS":               1,
		"SO_CONFIG_CHANGE_TYPE_ADD_PARTICIPANT":       2,
		"SO_CONFIG_CHANGE_TYPE_REMOVE_PARTICIPANT":    3,
		"SO_CONFIG_CHANGE_TYPE_ADD_INVITE":            4,
		"SO_CONFIG_CHANGE_TYPE_REVOKE_INVITE":         5,
		"SO_CONFIG_CHANGE_TYPE_INCREMENT_INVITE_USES": 6,
		"SO_CONFIG_CHANGE_TYPE_SELF_ENROLL_PEER":      7,
		"SO_CONFIG_CHANGE_TYPE_TRANSFER_OWNERSHIP":    8,
		"SO_CONFIG_CHANGE_TYPE_SET_ROSTER":            9,
		"SO_CONFIG_CHANGE_TYPE_SET_SEQUENCER":         10,
		"SO_CONFIG_CHANGE_TYPE_SET_CONTROL":           11,
	}
)

Enum value maps for SOConfigChangeType.

View Source
var (
	SORevocationReason_name = map[int32]string{
		0: "SO_REVOCATION_REASON_UNKNOWN",
		1: "SO_REVOCATION_REASON_SESSION_REVOKED",
		2: "SO_REVOCATION_REASON_ORG_REMOVED",
		3: "SO_REVOCATION_REASON_OWNER_REMOVED",
		4: "SO_REVOCATION_REASON_INVITE_REVOKED",
	}
	SORevocationReason_value = map[string]int32{
		"SO_REVOCATION_REASON_UNKNOWN":         0,
		"SO_REVOCATION_REASON_SESSION_REVOKED": 1,
		"SO_REVOCATION_REASON_ORG_REMOVED":     2,
		"SO_REVOCATION_REASON_OWNER_REMOVED":   3,
		"SO_REVOCATION_REASON_INVITE_REVOKED":  4,
	}
)

Enum value maps for SORevocationReason.

View Source
var (
	SODecisionKind_name = map[int32]string{
		0: "SO_DECISION_KIND_UNKNOWN",
		1: "SO_DECISION_KIND_CONFIG",
		2: "SO_DECISION_KIND_CHECKPOINT",
	}
	SODecisionKind_value = map[string]int32{
		"SO_DECISION_KIND_UNKNOWN":    0,
		"SO_DECISION_KIND_CONFIG":     1,
		"SO_DECISION_KIND_CHECKPOINT": 2,
	}
)

Enum value maps for SODecisionKind.

View Source
var (
	SOControlMessageType_name = map[int32]string{
		0: "SO_CONTROL_MESSAGE_TYPE_UNKNOWN",
		1: "SO_CONTROL_MESSAGE_TYPE_AGREE",
		2: "SO_CONTROL_MESSAGE_TYPE_PROPOSAL",
		3: "SO_CONTROL_MESSAGE_TYPE_PREVOTE",
		4: "SO_CONTROL_MESSAGE_TYPE_PRECOMMIT",
	}
	SOControlMessageType_value = map[string]int32{
		"SO_CONTROL_MESSAGE_TYPE_UNKNOWN":   0,
		"SO_CONTROL_MESSAGE_TYPE_AGREE":     1,
		"SO_CONTROL_MESSAGE_TYPE_PROPOSAL":  2,
		"SO_CONTROL_MESSAGE_TYPE_PREVOTE":   3,
		"SO_CONTROL_MESSAGE_TYPE_PRECOMMIT": 4,
	}
)

Enum value maps for SOControlMessageType.

View Source
var ErrAwaitingGroup = errors.New("the change waits for the group to agree")

ErrAwaitingGroup reports that a voter agreed to a change of a config under group control, which applies once the group decides it.

View Source
var ErrConfigHistoryUnavailable = errors.New("shared object configuration history requires recovery")

ErrConfigHistoryUnavailable requires a trusted recovery source instead of peer catch-up.

View Source
var ErrParticipantRevoked = errors.New("shared object participant access revoked")

ErrParticipantRevoked reports a committed removal of local readable participation.

View Source
var SOCheckpointSignatureContext = baseCryptoContext + "checkpoint_signature"

SOCheckpointSignatureContext is the signature context of every checkpoint. The signed body binds the object, so the context needs no per-checkpoint data.

View Source
var SOControlMessageSignatureContext = baseCryptoContext + "control_message_signature"

SOControlMessageSignatureContext is the signature context of every control message. The signed body binds the object and the instance, so the context needs no per-message data.

View Source
var SOOperationSignatureContext = baseCryptoContext + "participant_operation_signature"

SOOperationSignatureContext is the signature context of every operation. The signed body binds the object, so the context needs no per-operation data.

View Source
var SOSequenceSignatureContext = baseCryptoContext + "sequence_signature"

SOSequenceSignatureContext is the signature context of every sequence position. The signed body binds the object, so the context needs no per-position data.

Functions

func Acknowledge

func Acknowledge(ctx context.Context, so SharedObject, write func(context.Context) error) error

Acknowledge calls write each time the local peer should acknowledge, as NeedsAcknowledgment describes, so the checkpointer can checkpoint and trim the history every roster member has built on. write queues an empty operation after every operation the local peer has already started. It watches the state and returns when ctx ends or write fails.

func ApproveSOConfigChange

func ApproveSOConfigChange(ctx context.Context, host *SOHost, hash []byte, signer crypto.PrivKey) error

ApproveSOConfigChange has signer, a voter, agree to the change with hash that another voter agreed to under the held config.

func AuthoritativeSyncDenied

func AuthoritativeSyncDenied(config *SharedObjectConfig, health *SharedObjectHealth) bool

AuthoritativeSyncDenied reports whether a retained owner has denied this object identity. Denial from a non-owner cannot revoke another participant.

func BuildGenesisSOState

func BuildGenesisSOState(
	le *logrus.Entry,
	sfs *block_transform.StepFactorySet,
	sharedObjectID string,
	privKey crypto.PrivKey,
	stateData []byte,
) (*SOState, *SOConfigChange, error)

BuildGenesisSOState returns the state of a new shared object owned solely by privKey, with the signed genesis config change its config history starts from. The checkpoint holds stateData encrypted with a fresh key of epoch 0, granted to the owner.

func BuildSOGrantEncContext

func BuildSOGrantEncContext(sharedObjectID string, fromPeerID string, recipientPeerID string) string

BuildSOGrantEncContext builds the context for encrypting a SOGrant's inner data.

func BuildSOGrantSignatureContext

func BuildSOGrantSignatureContext(sharedObjectID string, signerPeerID, recipientPeerID string) string

BuildSOGrantSignatureContext builds the context string for a signature on a SOGrant.

func BuildSOInviteMessage

func BuildSOInviteMessage(
	sharedObjectID string,
	ownerPrivKey crypto.PrivKey,
	providerID string,
	terms *SOInvite,
) (*SOInviteMessage, *SOInvite, error)

BuildSOInviteMessage builds and signs the SOInviteMessage for out-of-band distribution along with the on-chain SOInvite metadata.

terms supplies the role, targets, use limit, expiry and admission conditions. Generates a random 32-byte token and SHA256 hashes it for on-chain storage. The returned SOInvite is stored separately via a signed config chain entry.

func CanReadState

func CanReadState(role SOParticipantRole) bool

CanReadState checks if the given role has read access to the state.

func CanWriteOps

func CanWriteOps(role SOParticipantRole) bool

CanWriteOps checks if the given role has access to write ops.

func ChangeSOConfig

func ChangeSOConfig(
	ctx context.Context,
	host *SOHost,
	state *SOState,
	next *SharedObjectConfig,
	changeType SOConfigChangeType,
	signer crypto.PrivKey,
	revInfo *SORevocationInfo,
	fn func(state *SOState) error,
) error

ChangeSOConfig makes one change of state's config to next. Under owner control signer, an owner, signs the change and it applies with fn, as in ApplyConfigChange. Under group control signer, a voter, agrees to it and ChangeSOConfig returns ErrAwaitingGroup; the group applies it once more than two thirds of the voting weight agree, which with two or three voters is all of them, and hands the key to the members it admits instead of calling fn.

func CompleteSOOwnershipTransfer

func CompleteSOOwnershipTransfer(ctx context.Context, host *SOHost, owner crypto.PrivKey, promote ...string) (bool, error)

CompleteSOOwnershipTransfer commits the departure carried by an ownership transfer at the configuration head, signed by a remaining owner. The same change raises each peer in promote to OWNER, so the successor's account can sign as host as soon as the departure settles. It reports false without changes when the head carries no departure or owner is departing, so a host may call it after each configuration change it accepts.

func ControlValueHash

func ControlValueHash(kind SODecisionKind, value []byte) ([]byte, error)

ControlValueHash returns the identity of a value of kind: the hash of a control record, which must be encoded with signatures and commit cleared, or of a checkpoint body.

func EntityUsername

func EntityUsername(cfg *SharedObjectConfig, entityID string) string

EntityUsername returns the username recorded for an entity's participants, or empty when none records one.

func EqualSOConfigs

func EqualSOConfigs(a, b *SharedObjectConfig) bool

EqualSOConfigs compares every configuration field, ignoring participant order. Membership is keyed by peer ID; its projection order carries no authority. Inputs are neither mutated nor validated. Signed encodings and chain hashes retain their original order and must be verified separately.

func HasQuorum

func HasQuorum(weight, total uint64) bool

HasQuorum reports whether weight is more than two thirds of total. Two such quorums share more than one third of the weight, so they share an honest voter while dishonest voters hold less than one third.

func HashSOCheckpointInner

func HashSOCheckpointInner(inner []byte) []byte

HashSOCheckpointInner returns the identity of a checkpoint from its signed body.

func HashSOConfigChange

func HashSOConfigChange(entry *SOConfigChange) ([]byte, error)

HashSOConfigChange returns the identity of a control record: the SHA-256 of its encoding with signatures and commit cleared, which is also the signed body and the value a group decides.

func HashSOControlMessageInner

func HashSOControlMessageInner(inner []byte) []byte

HashSOControlMessageInner returns the identity of a control message from its signed body.

func HashSOOperationInner

func HashSOOperationInner(inner []byte) []byte

HashSOOperationInner returns the identity of an operation from its signed body.

func HashSOSequenceInner

func HashSOSequenceInner(inner []byte) []byte

HashSOSequenceInner returns the identity of a sequence position from its signed body.

func IsOwner

func IsOwner(role SOParticipantRole) bool

IsOwner checks if the given role is the OWNER role.

func NeedsKeyRotation

func NeedsKeyRotation(history []*SOConfigChange, epochs []*SOKeyEpoch) bool

NeedsKeyRotation reports whether a config record after the one the latest of epochs was created under removed a reader, who still holds that epoch's key. history is the config chain in sequence order.

func NewLocalStateStoreRefcount

func NewLocalStateStoreRefcount(
	storeID string,
	access AccessLocalStateStoreFunc,
) *refcount.RefCount[kvtx.Store]

NewLocalStateStoreRefcount retains the selected local store while references remain. The access callback supplies the store and its release function.

func NewSOOperationLocalID

func NewSOOperationLocalID() string

NewSOOperationLocalID constructs a new randomized local ID for a op.

func NewSOStateBlock

func NewSOStateBlock() block.Block

NewSOStateBlock constructs a new SOState block.

func NewSharedObjectHealthError added in v0.51.8

func NewSharedObjectHealthError(health *SharedObjectHealth, cause error) error

NewSharedObjectHealthError wraps an explicit SharedObjectHealth snapshot in an error.

func NewSharedObjectRefBlock

func NewSharedObjectRefBlock() block.Block

NewSharedObjectRefBlock constructs a new SharedObjectRef block.

func OrderedOperation

func OrderedOperation(ctx context.Context) bool

OrderedOperation reports whether ctx carries WithOrderedOperation.

func ParseSOOperationLocalID

func ParseSOOperationLocalID(id string) (ulid.ULID, error)

ParseSOOperationLocalID parses and validates the local id is the correct format.

func PromoteSOOwner

func PromoteSOOwner(ctx context.Context, host *SOHost, owner crypto.PrivKey, peerID string) error

PromoteSOOwner raises a participant to OWNER without a departure. A host whose session identity received a transfer promotes its storage identity.

func QueueOrdersBlockWrites

func QueueOrdersBlockWrites(so SharedObject) bool

QueueOrdersBlockWrites reports whether so's queue write is ordered after its earlier block writes.

func ReadSODepartingPeers

func ReadSODepartingPeers(ctx context.Context, host *SOHost, head []byte) ([]string, error)

ReadSODepartingPeers returns SODepartingPeers for the retained change that produced head, or nil when head is empty or its change is not retained.

func ReadSOOwnershipSuccessor

func ReadSOOwnershipSuccessor(ctx context.Context, host *SOHost) (string, error)

ReadSOOwnershipSuccessor returns the owner that the latest retained departure transfer handed the object to, or empty when retained history has none. That is the first owner in the transfer's configuration that was not departing, which is the promoted successor unless another owner already remained.

func RedactStepConfig

func RedactStepConfig(step *block_transform.StepConfig) *block_transform.StepConfig

RedactStepConfig returns a copy of the StepConfig with sensitive fields (encryption keys) zeroed. The algorithm and other non-sensitive fields are preserved. Returns the original step unchanged for non-blockenc steps.

func RedactStepConfigs

func RedactStepConfigs(steps []*block_transform.StepConfig) []*block_transform.StepConfig

RedactStepConfigs returns redacted copies of all step configs.

func RemoveSOParticipant

func RemoveSOParticipant(
	ctx context.Context,
	host *SOHost,
	targetPeerID string,
	signerPriv crypto.PrivKey,
	revInfo *SORevocationInfo,
) (bool, error)

RemoveSOParticipant removes one participant config and grant.

func RemoveSOParticipants

func RemoveSOParticipants(
	ctx context.Context,
	host *SOHost,
	targetPeerIDs []string,
	signerPriv crypto.PrivKey,
	revInfo *SORevocationInfo,
) ([]string, error)

RemoveSOParticipants removes participant configs and grants in one signed configuration change. It returns the peer IDs that were present and removed. Under group control signerPriv, a voter, agrees to the removal and it returns those peers with ErrAwaitingGroup; the voters take the key from them once the group decides.

func RestoreRoster

func RestoreRoster(ctx context.Context, so SharedObject, host RosterHost) error

RestoreRoster returns each dropped device to the trimming roster once it has built on the local peer's latest operation, while the local peer is the checkpointer. A dropped writer acknowledges like a roster member, so a device that returns and only reads still answers the checkpointer. It watches the state and returns when ctx ends or a change fails.

func SODepartingPeers

func SODepartingPeers(entry *SOConfigChange) ([]string, error)

SODepartingPeers returns the peers whose verified leave consent the change carries when it is an ownership transfer, or nil for any other change. Each has departed in its own view before the successor commits its removal.

func Sequence

func Sequence(ctx context.Context, so SharedObject, place func(context.Context) error) error

Sequence calls place each time the state changes while the local peer is the appointed sequencer, so operations from this device and from its peers get positions as they arrive. The positions reach the other devices with the state they sync. It watches the state and returns when ctx ends or place fails.

func SetSOControl

func SetSOControl(ctx context.Context, host *SOHost, control SOControl, signer crypto.PrivKey) error

SetSOControl changes who controls host's shared object, signed or agreed to by signer. Group control gives one vote to the first writing device of each entity, and seals the held checkpoint so the group's decisions follow it. Owner control takes every vote away. A group's return to owner control needs the group to decide it, so it returns ErrAwaitingGroup. It does nothing when control already matches.

func SetSORoster

func SetSORoster(ctx context.Context, host *SOHost, dropped []string, signer crypto.PrivKey) (bool, error)

SetSORoster signs, as the owner of signer, one configuration change that drops exactly the writers in dropped from the trimming roster. Peers that cannot write are ignored. It reports false without a change when the roster already drops them. Under group control signer, a voter, agrees to the change and it returns ErrAwaitingGroup.

func SetSOSequencer

func SetSOSequencer(ctx context.Context, host *SOHost, peerID string, signer crypto.PrivKey) (bool, error)

SetSOSequencer signs, as the owner of signer, one configuration change that appoints peerID as the sequencer, or selects Merge when peerID is empty. The new sequencer starts after the last position the local peer resolves, so the order it already holds stays. Moving to this device and replacing a lost device are both this change: positions the old sequencer signed after the start are ignored and their operations placed again. It reports false without a change when peerID already sequences. Under group control signer, a voter, agrees to the change and it returns ErrAwaitingGroup.

func ValidateInviteUsable

func ValidateInviteUsable(inv *SOInvite) error

ValidateInviteUsable checks whether an invite is currently usable. Returns nil if the invite can accept another use.

func ValidateSOParticipantRole

func ValidateSOParticipantRole(role SOParticipantRole, allowUnknown bool) error

ValidateSOParticipantRole ensures the enum value is within the expected set. If allowUnknown is true, it will allow SOParticipantRole_UNKNOWN as a valid role.

func VerifyCommit

func VerifyCommit(
	sharedObjectID string,
	cfg *SharedObjectConfig,
	height uint64,
	valueHash []byte,
	commit []*SOControlMessage,
) error

VerifyCommit checks that commit decides valueHash for the instance at height under cfg: precommits of one round for valueHash under cfg's head, each from a distinct voter of cfg, together holding more than two thirds of its voting weight.

func VerifyConfigChain

func VerifyConfigChain(sharedObjectID string, entries []*SOConfigChange) error

VerifyConfigChain verifies a config change chain from genesis to current. Each entry must have: 1. The shared object ID 2. Monotonically increasing config_seqno (starting from 0) 3. previous_hash matching the hash of the prior entry (genesis has zero previous_hash) 4. Authorization by the prior config; genesis by an owner of its own config, which must start under owner control

func VerifyConfigChainSuffix

func VerifyConfigChainSuffix(sharedObjectID string, current, candidate *SharedObjectConfig, entries []*SOConfigChange) error

VerifyConfigChainSuffix authenticates a candidate configuration from a held, nonempty checkpoint. Every transition must be authorized by its predecessor. Genesis and self-enrollment are unavailable on this peer verification path. Empty suffixes require every candidate field to equal the checkpoint, independent of participant order. This verifies configuration authority only, not root or content acceptance.

func WithOrderedOperation

func WithOrderedOperation(ctx context.Context) context.Context

WithOrderedOperation marks operations queued with ctx as allowed to be accepted with an ordered commit: applied when QueueOperation returns, and durable at the provider's next durability point. Providers that do not support this ignore the mark.

func WrapSharedObjectHealthError

func WrapSharedObjectHealthError(
	layer SharedObjectHealthLayer,
	err error,
) error

WrapSharedObjectHealthError wraps err with an attached SharedObjectHealth snapshot.

Types

type AccessLocalStateStoreFunc

type AccessLocalStateStoreFunc func(ctx context.Context, storeID string, released func()) (kvtx.Store, func(), error)

AccessLocalStateStoreFunc implements AccessLocalStateStore.

type CheckpointJudge

type CheckpointJudge interface {
	// ProposeCheckpoint returns the body of the checkpoint the local voter
	// proposes after the held one, or nil while too few operations are
	// stable or the replay has not reached them.
	ProposeCheckpoint(ctx context.Context, state *SOState) (*SOCheckpointInner, error)
	// JudgeCheckpoint reports whether inner is the checkpoint after the held
	// one that the local replay reached: the same covered operations, sequence
	// position and World. ok is false while the replay cannot tell.
	JudgeCheckpoint(ctx context.Context, state *SOState, inner *SOCheckpointInner) (valid, ok bool, err error)
}

CheckpointJudge proposes and judges the checkpoints a group decides. The World engine implements it from its replay.

type Control

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

Control takes part, as one voter, in the decisions a group makes about a shared object: each decides its next control record or its next checkpoint. The voter's messages live in the shared object state, so a restart resumes from them with its lock. Only the round it waits in and its timeouts are in memory.

func NewControl

func NewControl(le *logrus.Entry, host *SOHost, privKey crypto.PrivKey, judge CheckpointJudge) (*Control, error)

NewControl builds the driver of privKey's votes on host's shared object. judge may be nil.

func (*Control) Execute

func (c *Control) Execute(ctx context.Context) error

Execute steps the decisions each time the state changes or a timeout expires, until ctx ends.

func (*Control) SetTimeout

func (c *Control) SetTimeout(timeout func(round uint32) time.Duration)

SetTimeout replaces the wait of each step. Call it before Execute.

func (*Control) Wake

func (c *Control) Wake()

Wake has the driver step again, as when what the judge answers changed.

type ControlAgreement

type ControlAgreement struct {
	// Hash is the identity of the change as agreed, without its seal.
	Hash []byte
	// Change is the agreed record, with no sealed checkpoint.
	Change *SOConfigChange
	// Voters are the voters that agree to it, sorted.
	Voters []string
	// Weight is their voting weight.
	Weight uint64
	// contains filtered or unexported fields
}

ControlAgreement is a change of the held config that voters agree to.

type ControlHost

type ControlHost interface {
	// SetControl changes who controls the shared object as SetSOControl does,
	// returning ErrAwaitingGroup when the group decides the change.
	SetControl(ctx context.Context, control SOControl) error
	// ApproveConfigChange agrees to the change with hash that another voter
	// agreed to under the held config.
	ApproveConfigChange(ctx context.Context, hash []byte) error
}

ControlHost is an optional interface on SharedObject implementations whose local peer can change who controls the shared object and agree to changes other voters asked the group for.

type ControlMessage

type ControlMessage struct {
	// Msg is the signed message.
	Msg *SOControlMessage
	// Inner is its verified body.
	Inner *SOControlMessageInner
}

ControlMessage is a verified control message with its body.

type FoldOutcome

type FoldOutcome struct {
	// Hash identifies the operation.
	Hash []byte
	// Inner is the verified operation body with its data still encoded.
	Inner *SOOperationInner
	// Reason is empty when the operation applied. Otherwise it says in plain
	// words why the operation was not applied.
	Reason string
}

FoldOutcome is the replay outcome of one operation.

type FoldResult

type FoldResult struct {
	// StateData is the decoded state after the last placed operation.
	StateData []byte
	// Outcomes are the placed operations in replay order.
	Outcomes []FoldOutcome
}

FoldResult is the state of a non-World shared object after replaying its operation set from the checkpoint.

func Fold

Fold replays the operation set of snap from its checkpoint through process, one operation at a time in the set's order. Every member holding the same operations computes the same result. A missing epoch key or config stops the fold with an error, so members never diverge on what they could read.

func WaitOperation

func WaitOperation(ctx context.Context, so SharedObject, localID string, process ProcessOpsFunc) (*FoldResult, error)

WaitOperation waits until replay places the local peer's operation with localID and returns the folded state. It returns ErrRejectedOp wrapped with the reason when replay rejected the operation.

func WriteOperation

func WriteOperation(ctx context.Context, so SharedObject, opData []byte, process ProcessOpsFunc) (*FoldResult, error)

WriteOperation queues opData as the local peer and waits for its replay outcome. It returns the folded state that holds the operation.

func (*FoldResult) Outcome

func (r *FoldResult) Outcome(peerID, localID string) *FoldOutcome

Outcome returns the outcome of peerID's operation with localID, or nil while replay has not placed it.

type InviteHost

type InviteHost interface {
	StateHost
	InviteMutator

	// GetProviderID returns the provider identifier for the invite message.
	GetProviderID() string
}

InviteHost is an optional interface on SharedObject implementations that support invite creation and management. Both local and spacewave providers implement this.

type InviteMutator

type InviteMutator interface {
	// CreateSOInviteOp creates a new invite and returns the signed invite message.
	CreateSOInviteOp(
		ctx context.Context,
		ownerPrivKey crypto.PrivKey,
		providerID string,
		terms *SOInvite,
	) (*SOInviteMessage, error)
	// RevokeInvite revokes an invite by ID.
	RevokeInvite(ctx context.Context, signerPrivKey crypto.PrivKey, inviteID string) error
	// IncrementInviteUses increments the use counter for an invite by ID.
	IncrementInviteUses(ctx context.Context, signerPrivKey crypto.PrivKey, inviteID string) error
}

InviteMutator mutates shared-object invite state.

type InviteRedemption

type InviteRedemption int

InviteRedemption is how a host treats the redemption of a usable invite.

const (
	// InviteRedemptionRefuse admits nobody and queues nothing.
	InviteRedemptionRefuse InviteRedemption = iota
	// InviteRedemptionAdmit adds the redeemer as a participant.
	InviteRedemptionAdmit
	// InviteRedemptionQueue holds the redemption as a join request.
	InviteRedemptionQueue
)

func RedeemInvite

func RedeemInvite(inv *SOInvite, peerID string, held map[string]*SharedObjectConfig) InviteRedemption

RedeemInvite decides the redemption of a usable invite by peerID.

An invite without conditions admits everyone. A participant_of invite admits a peer that participates in one of the named Spaces in held, the host's own configuration of each Space it holds. An approval_required invite queues every redemption it does not admit; otherwise the redemption is refused.

type JoinRequestHost

type JoinRequestHost interface {
	// GetJoinRequestsCtr returns the pending join requests, at most one per peer.
	GetJoinRequestsCtr() ccontainer.Watchable[*SOJoinRequestList]
	// RemoveJoinRequest removes the pending request of peerID.
	RemoveJoinRequest(ctx context.Context, peerID string) error
}

JoinRequestHost is an optional interface on SharedObject implementations that hold the join requests queued by invites requiring approval.

type MainDevice

type MainDevice interface {
	// SequenceOperations places every operation the sequence has not placed
	// while the local peer is the sequencer.
	SequenceOperations(ctx context.Context) error
}

MainDevice is an optional interface on SharedObject implementations whose local peer signs positions when the config appoints it, as the main device of a Space that syncs between devices.

type MountSharedObject

type MountSharedObject interface {
	// Directive indicates MountSharedObject is a directive.
	directive.Directive

	// MountSharedObjectRef returns the shared object ref to mount.
	MountSharedObjectRef() *SharedObjectRef
}

MountSharedObject is a directive to mount a shared object with a provider account.

func NewMountSharedObject

func NewMountSharedObject(ref *SharedObjectRef) MountSharedObject

NewMountSharedObject constructs a new MountSharedObject directive.

type MountSharedObjectBody

type MountSharedObjectBody interface {
	// Directive indicates MountSharedObjectBody is a directive.
	directive.Directive

	// MountSharedObjectBodyRef returns the shared object ref to mount.
	MountSharedObjectBodyRef() *SharedObjectRef
	// MountSharedObjectBodyType returns the shared object body type.
	MountSharedObjectBodyType() string
	// MountSharedObjectBodySource returns an already-mounted source object, if one exists.
	MountSharedObjectBodySource() SharedObject
}

MountSharedObjectBody is a directive to mount the body of a shared object. This typically signals to start a controller which validates + processes the sobject ops.

func NewMountSharedObjectBody

func NewMountSharedObjectBody(ref *SharedObjectRef, bodyType string) MountSharedObjectBody

NewMountSharedObjectBody constructs a new MountSharedObjectBody directive.

func NewMountSharedObjectBodyWithSource added in v0.51.8

func NewMountSharedObjectBodyWithSource(ref *SharedObjectRef, bodyType string, source SharedObject) MountSharedObjectBody

NewMountSharedObjectBodyWithSource constructs a MountSharedObjectBody directive with an already-mounted source object available to body-specific resolvers.

type MountSharedObjectBodyValue

type MountSharedObjectBodyValue[T comparable] interface {
	// GetSharedObjectRef returns the shared object handle.
	GetSharedObjectRef() *SharedObjectRef
	// GetSharedObjectBodyType returns the shared object handle.
	GetSharedObjectBodyType() string
	// GetSharedObject returns the shared object handle.
	GetSharedObject() SharedObject
	// GetSharedObjectBody returns the shared object body handle.
	GetSharedObjectBody() T
}

MountSharedObjectBodyValue is the result type for MountSharedObjectBody.

This is the interface exposed by the shared object body handler on the "client side."

func ExMountSharedObjectBody

func ExMountSharedObjectBody[T comparable](
	ctx context.Context,
	b bus.Bus,
	ref *SharedObjectRef,
	bodyType string,
	returnIfIdle bool,
	valDisposeCb func(),
) (MountSharedObjectBodyValue[T], directive.Reference, error)

ExMountSharedObjectBody executes a directive to mount the body of a shared object.

If returnIfIdle is set, returns when the directive becomes idle.

func ExMountSharedObjectBodyWithSource added in v0.51.8

func ExMountSharedObjectBodyWithSource[T comparable](
	ctx context.Context,
	b bus.Bus,
	ref *SharedObjectRef,
	bodyType string,
	source SharedObject,
	returnIfIdle bool,
	valDisposeCb func(),
) (MountSharedObjectBodyValue[T], directive.Reference, error)

ExMountSharedObjectBodyWithSource executes a mount directive with an already-mounted source object available to body-specific resolvers.

func NewMountSharedObjectBodyValue

func NewMountSharedObjectBodyValue[T comparable](
	ref *SharedObjectRef,
	bodyType string,
	obj SharedObject,
	body T,
) MountSharedObjectBodyValue[T]

NewMountSharedObjectBodyValue constructs a new MountSharedObjectBodyValue.

type MountSharedObjectValue

type MountSharedObjectValue = SharedObject

MountSharedObjectValue is the result type for MountSharedObject.

type OrderedQueue

type OrderedQueue interface {
	// QueueOrdersBlockWrites reports whether queueing orders block writes.
	QueueOrdersBlockWrites() bool
}

OrderedQueue is implemented by a SharedObject whose operation queue write shares one ordered store with its block store: the queue write never becomes durable before an earlier block write. A writer may then queue an operation after writing its blocks without a block store Sync in between.

type ProcessOpsFunc

type ProcessOpsFunc = func(
	ctx context.Context,
	snap SharedObjectStateSnapshot,
	currentStateData []byte,
	ops []*SOOperationInner,
) (rawNextStateData *[]byte, opResults []*SOOperationResult, err error)

ProcessOpsFunc applies decoded operations to the state of a non-World shared object. Replay calls it with one operation at a time. If rawNextStateData is nil, the state is unchanged.

type ProviderSequencer

type ProviderSequencer interface {
	// GetProviderSequencer returns the peer ID the provider signs the order
	// with, which SetSequencer appoints.
	GetProviderSequencer(ctx context.Context) (string, error)
}

ProviderSequencer is an optional interface on SharedObject implementations whose provider can sequence the shared object itself.

type PublicationRetention

type PublicationRetention interface {
	AccessPublicationRetention(context.Context) (kvtx.Store, func(), error)
}

PublicationRetention is implemented by providers that publish local state asynchronously. Its store retains graph-completion proofs for the mounted block store; World consumers fence all dependencies before accepting a write.

type ReplayReporter

type ReplayReporter interface {
	// SetRejectedEdits replaces the rejected edits in the health.
	SetRejectedEdits(edits []*SORejectedEdit)
	// SetCheckpointMismatch replaces the checkpoint mismatch in the health.
	SetCheckpointMismatch(mismatch *SOCheckpointMismatch)
	// SetUnorderedCount replaces the count of operations the sequencer has not
	// placed in the health.
	SetUnorderedCount(n uint32)
}

ReplayReporter is implemented by a SharedObject that shows the results of its device's replay in its health: rejected edits, a wrong checkpoint and the operations not yet in order. The World engine reports them after each replay it installs.

type RosterHost

type RosterHost interface {
	// SetRosterDropped drops exactly the writers in dropped from the trimming
	// roster. It reports false when the roster already drops them.
	SetRosterDropped(ctx context.Context, dropped []string) (bool, error)
}

RosterHost is an optional interface on SharedObject implementations whose local peer can sign changes to the trimming roster as an owner.

type SOCheckpoint

type SOCheckpoint struct {

	// Inner is the encoded SOCheckpointInner.
	Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"`
	// Signatures sign inner under owner control. One must be from an owner
	// under the held config.
	Signatures []*peer.Signature `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures,omitempty"`
	// Commit holds the precommits that decided the checkpoint under group
	// control, by voters of the config named by inner.config_hash.
	Commit []*SOControlMessage `protobuf:"bytes,3,rep,name=commit,proto3" json:"commit,omitempty"`
	// contains filtered or unexported fields
}

SOCheckpoint is a signed checkpoint: the World at a point of the operation order, from which members replay the operations after it.

func BuildGenesisSOCheckpoint

func BuildGenesisSOCheckpoint(
	privKey crypto.PrivKey,
	sharedObjectID string,
	configHash []byte,
	stateDataEnc []byte,
) (*SOCheckpoint, error)

BuildGenesisSOCheckpoint signs the height 0 checkpoint of a new shared object. stateDataEnc is the initial state encrypted with the key of epoch 0.

func BuildSOCheckpoint

func BuildSOCheckpoint(privKey crypto.PrivKey, inner *SOCheckpointInner) (*SOCheckpoint, error)

BuildSOCheckpoint signs inner as a checkpoint by the owner of privKey. inner.StateData must already be encrypted with the key of inner.KeyEpoch.

func (*SOCheckpoint) CloneMessageVT

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

func (*SOCheckpoint) CloneVT

func (m *SOCheckpoint) CloneVT() *SOCheckpoint

func (*SOCheckpoint) CoSign

func (c *SOCheckpoint) CoSign(privKey crypto.PrivKey) error

CoSign adds a signature by the owner of privKey. The checkpoint's identity covers only its body, so the hash is unchanged.

func (*SOCheckpoint) EqualMessageVT

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

func (*SOCheckpoint) EqualVT

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

func (*SOCheckpoint) GetCommit

func (x *SOCheckpoint) GetCommit() []*SOControlMessage

func (*SOCheckpoint) GetInner

func (x *SOCheckpoint) GetInner() []byte

func (*SOCheckpoint) GetSignatures

func (x *SOCheckpoint) GetSignatures() []*peer.Signature

func (*SOCheckpoint) Hash

func (c *SOCheckpoint) Hash() []byte

Hash returns the identity of the checkpoint.

func (*SOCheckpoint) MarshalJSON

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

MarshalJSON marshals the SOCheckpoint to JSON.

func (*SOCheckpoint) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOCheckpoint message to JSON.

func (*SOCheckpoint) MarshalProtoText

func (x *SOCheckpoint) MarshalProtoText() string

func (*SOCheckpoint) MarshalToSizedBufferVT

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

func (*SOCheckpoint) MarshalToVT

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

func (*SOCheckpoint) MarshalVT

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

func (*SOCheckpoint) ProtoMessage

func (*SOCheckpoint) ProtoMessage()

func (*SOCheckpoint) Reset

func (x *SOCheckpoint) Reset()

func (*SOCheckpoint) SizeVT

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

func (*SOCheckpoint) String

func (x *SOCheckpoint) String() string

func (*SOCheckpoint) UnmarshalInner

func (c *SOCheckpoint) UnmarshalInner() (*SOCheckpointInner, error)

UnmarshalInner decodes and checks the checkpoint body.

func (*SOCheckpoint) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOCheckpoint from JSON.

func (*SOCheckpoint) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOCheckpoint message from JSON.

func (*SOCheckpoint) UnmarshalVT

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

func (*SOCheckpoint) ValidateAuthority

func (c *SOCheckpoint) ValidateAuthority(sharedObjectID string, cfg *SharedObjectConfig) (*SOCheckpointInner, error)

ValidateAuthority authenticates the checkpoint and checks that cfg authorizes it. cfg vouches for its sealed checkpoint by hash. Otherwise, under group control, a commit of cfg's voters decided it under cfg, and under owner control an owner of cfg signed it.

func (*SOCheckpoint) Verify

func (c *SOCheckpoint) Verify(sharedObjectID string) (*SOCheckpointInner, []string, error)

Verify authenticates every signature on the checkpoint as written for sharedObjectID and returns the body and the signers. It does not check that a signer holds authority or verify the commit; ValidateAuthority does.

type SOCheckpointHead

type SOCheckpointHead struct {

	// Height is the checkpoint height.
	Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
	// Hash is the checkpoint identity.
	Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

SOCheckpointHead names one checkpoint.

func (*SOCheckpointHead) CloneMessageVT

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

func (*SOCheckpointHead) CloneVT

func (m *SOCheckpointHead) CloneVT() *SOCheckpointHead

func (*SOCheckpointHead) EqualMessageVT

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

func (*SOCheckpointHead) EqualVT

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

func (*SOCheckpointHead) GetHash

func (x *SOCheckpointHead) GetHash() []byte

func (*SOCheckpointHead) GetHeight

func (x *SOCheckpointHead) GetHeight() uint64

func (*SOCheckpointHead) MarshalJSON

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

MarshalJSON marshals the SOCheckpointHead to JSON.

func (*SOCheckpointHead) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOCheckpointHead message to JSON.

func (*SOCheckpointHead) MarshalProtoText

func (x *SOCheckpointHead) MarshalProtoText() string

func (*SOCheckpointHead) MarshalToSizedBufferVT

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

func (*SOCheckpointHead) MarshalToVT

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

func (*SOCheckpointHead) MarshalVT

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

func (*SOCheckpointHead) ProtoMessage

func (*SOCheckpointHead) ProtoMessage()

func (*SOCheckpointHead) Reset

func (x *SOCheckpointHead) Reset()

func (*SOCheckpointHead) SizeVT

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

func (*SOCheckpointHead) String

func (x *SOCheckpointHead) String() string

func (*SOCheckpointHead) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOCheckpointHead from JSON.

func (*SOCheckpointHead) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOCheckpointHead message from JSON.

func (*SOCheckpointHead) UnmarshalVT

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

func (*SOCheckpointHead) Validate

func (h *SOCheckpointHead) Validate() error

Validate checks that the head names a checkpoint.

type SOCheckpointInner

type SOCheckpointInner struct {

	// SharedObjectId binds the checkpoint to one shared object.
	SharedObjectId string `protobuf:"bytes,1,opt,name=shared_object_id,json=sharedObjectId,proto3" json:"sharedObjectId,omitempty"`
	// Height is 0 for genesis, then one more than the previous checkpoint.
	Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
	// PrevCheckpointHash is the hash of the previous checkpoint's inner.
	// Empty only at genesis.
	PrevCheckpointHash []byte `protobuf:"bytes,3,opt,name=prev_checkpoint_hash,json=prevCheckpointHash,proto3" json:"prevCheckpointHash,omitempty"`
	// ConfigHash is the config chain hash the checkpoint was signed under.
	ConfigHash []byte `protobuf:"bytes,4,opt,name=config_hash,json=configHash,proto3" json:"configHash,omitempty"`
	// StateData is the World state after the prefix, encrypted with the key of
	// key_epoch.
	StateData []byte `protobuf:"bytes,6,opt,name=state_data,json=stateData,proto3" json:"stateData,omitempty"`
	// ReplayVersion is the replay rule version the World was computed with.
	ReplayVersion uint32 `protobuf:"varint,7,opt,name=replay_version,json=replayVersion,proto3" json:"replayVersion,omitempty"`
	// KeyEpoch is the key epoch whose key encrypted state_data.
	KeyEpoch uint64 `protobuf:"varint,8,opt,name=key_epoch,json=keyEpoch,proto3" json:"keyEpoch,omitempty"`
	// Authors are the last covered operation of each author, sorted by peer_id.
	// An operation at or below its author's entry is covered. Empty at genesis.
	Authors []*SOOperationPosition `protobuf:"bytes,9,rep,name=authors,proto3" json:"authors,omitempty"`
	// Sequence is the last position the checkpoint covers. Unset when it covers
	// none.
	Sequence *SOSequenceHead `protobuf:"bytes,10,opt,name=sequence,proto3" json:"sequence,omitempty"`
	// contains filtered or unexported fields
}

SOCheckpointInner is the signed body of a checkpoint.

func (*SOCheckpointInner) CloneMessageVT

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

func (*SOCheckpointInner) CloneVT

func (m *SOCheckpointInner) CloneVT() *SOCheckpointInner

func (*SOCheckpointInner) EqualMessageVT

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

func (*SOCheckpointInner) EqualVT

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

func (*SOCheckpointInner) GetAuthors

func (x *SOCheckpointInner) GetAuthors() []*SOOperationPosition

func (*SOCheckpointInner) GetConfigHash

func (x *SOCheckpointInner) GetConfigHash() []byte

func (*SOCheckpointInner) GetHeight

func (x *SOCheckpointInner) GetHeight() uint64

func (*SOCheckpointInner) GetKeyEpoch

func (x *SOCheckpointInner) GetKeyEpoch() uint64

func (*SOCheckpointInner) GetPrevCheckpointHash

func (x *SOCheckpointInner) GetPrevCheckpointHash() []byte

func (*SOCheckpointInner) GetReplayVersion

func (x *SOCheckpointInner) GetReplayVersion() uint32

func (*SOCheckpointInner) GetSequence

func (x *SOCheckpointInner) GetSequence() *SOSequenceHead

func (*SOCheckpointInner) GetSharedObjectId

func (x *SOCheckpointInner) GetSharedObjectId() string

func (*SOCheckpointInner) GetStateData

func (x *SOCheckpointInner) GetStateData() []byte

func (*SOCheckpointInner) MarshalJSON

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

MarshalJSON marshals the SOCheckpointInner to JSON.

func (*SOCheckpointInner) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOCheckpointInner message to JSON.

func (*SOCheckpointInner) MarshalProtoText

func (x *SOCheckpointInner) MarshalProtoText() string

func (*SOCheckpointInner) MarshalToSizedBufferVT

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

func (*SOCheckpointInner) MarshalToVT

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

func (*SOCheckpointInner) MarshalVT

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

func (*SOCheckpointInner) ProtoMessage

func (*SOCheckpointInner) ProtoMessage()

func (*SOCheckpointInner) Reset

func (x *SOCheckpointInner) Reset()

func (*SOCheckpointInner) SizeVT

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

func (*SOCheckpointInner) String

func (x *SOCheckpointInner) String() string

func (*SOCheckpointInner) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOCheckpointInner from JSON.

func (*SOCheckpointInner) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOCheckpointInner message from JSON.

func (*SOCheckpointInner) UnmarshalVT

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

func (*SOCheckpointInner) Validate

func (i *SOCheckpointInner) Validate() error

Validate checks the checkpoint body's structure.

type SOCheckpointMismatch

type SOCheckpointMismatch struct {

	// Height is the height of the checkpoint.
	Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
	// contains filtered or unexported fields
}

SOCheckpointMismatch is a checkpoint whose World differs from the World this device reached by replaying the operations the checkpoint covers. The device continues from the checkpoint, since its signers are authoritative.

func (*SOCheckpointMismatch) CloneMessageVT

func (*SOCheckpointMismatch) CloneVT

func (*SOCheckpointMismatch) EqualMessageVT

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

func (*SOCheckpointMismatch) EqualVT

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

func (*SOCheckpointMismatch) GetHeight

func (x *SOCheckpointMismatch) GetHeight() uint64

func (*SOCheckpointMismatch) MarshalJSON

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

MarshalJSON marshals the SOCheckpointMismatch to JSON.

func (*SOCheckpointMismatch) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOCheckpointMismatch message to JSON.

func (*SOCheckpointMismatch) MarshalProtoText

func (x *SOCheckpointMismatch) MarshalProtoText() string

func (*SOCheckpointMismatch) MarshalToSizedBufferVT

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

func (*SOCheckpointMismatch) MarshalToVT

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

func (*SOCheckpointMismatch) MarshalVT

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

func (*SOCheckpointMismatch) ProtoMessage

func (*SOCheckpointMismatch) ProtoMessage()

func (*SOCheckpointMismatch) Reset

func (x *SOCheckpointMismatch) Reset()

func (*SOCheckpointMismatch) SizeVT

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

func (*SOCheckpointMismatch) String

func (x *SOCheckpointMismatch) String() string

func (*SOCheckpointMismatch) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOCheckpointMismatch from JSON.

func (*SOCheckpointMismatch) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOCheckpointMismatch message from JSON.

func (*SOCheckpointMismatch) UnmarshalVT

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

type SOConfigChainResponse

type SOConfigChainResponse struct {

	// ConfigChanges is the full config change chain from genesis.
	ConfigChanges []*SOConfigChange `protobuf:"bytes,1,rep,name=config_changes,json=configChanges,proto3" json:"configChanges,omitempty"`
	// KeyEpochs are the key epochs with grants for each period.
	KeyEpochs []*SOKeyEpoch `protobuf:"bytes,2,rep,name=key_epochs,json=keyEpochs,proto3" json:"keyEpochs,omitempty"`
	// contains filtered or unexported fields
}

SOConfigChainResponse is returned by GET /sobject/{id}/config-chain.

func (*SOConfigChainResponse) CloneMessageVT

func (*SOConfigChainResponse) CloneVT

func (*SOConfigChainResponse) EqualMessageVT

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

func (*SOConfigChainResponse) EqualVT

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

func (*SOConfigChainResponse) GetConfigChanges

func (x *SOConfigChainResponse) GetConfigChanges() []*SOConfigChange

func (*SOConfigChainResponse) GetKeyEpochs

func (x *SOConfigChainResponse) GetKeyEpochs() []*SOKeyEpoch

func (*SOConfigChainResponse) MarshalJSON

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

MarshalJSON marshals the SOConfigChainResponse to JSON.

func (*SOConfigChainResponse) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOConfigChainResponse message to JSON.

func (*SOConfigChainResponse) MarshalProtoText

func (x *SOConfigChainResponse) MarshalProtoText() string

func (*SOConfigChainResponse) MarshalToSizedBufferVT

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

func (*SOConfigChainResponse) MarshalToVT

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

func (*SOConfigChainResponse) MarshalVT

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

func (*SOConfigChainResponse) ProtoMessage

func (*SOConfigChainResponse) ProtoMessage()

func (*SOConfigChainResponse) Reset

func (x *SOConfigChainResponse) Reset()

func (*SOConfigChainResponse) SizeVT

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

func (*SOConfigChainResponse) String

func (x *SOConfigChainResponse) String() string

func (*SOConfigChainResponse) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOConfigChainResponse from JSON.

func (*SOConfigChainResponse) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOConfigChainResponse message from JSON.

func (*SOConfigChainResponse) UnmarshalVT

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

type SOConfigChange

type SOConfigChange struct {

	// ConfigSeqno is the sequence number of this config change.
	ConfigSeqno uint64 `protobuf:"varint,1,opt,name=config_seqno,json=configSeqno,proto3" json:"configSeqno,omitempty"`
	// Config is the new config after this change.
	Config *SharedObjectConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
	// PreviousHash is the hash of the parent control record.
	// Empty only on genesis.
	PreviousHash []byte `protobuf:"bytes,6,opt,name=previous_hash,json=previousHash,proto3" json:"previousHash,omitempty"`
	// ChangeType describes the kind of mutation in this config chain entry.
	ChangeType SOConfigChangeType `protobuf:"varint,7,opt,name=change_type,json=changeType,proto3" json:"changeType,omitempty"`
	// RevocationInfo contains metadata about why a participant was removed.
	// Only populated when change_type is REMOVE_PARTICIPANT.
	RevocationInfo *SORevocationInfo `protobuf:"bytes,8,opt,name=revocation_info,json=revocationInfo,proto3" json:"revocationInfo,omitempty"`
	// LeaveRequest is the departing peers' consent that the promoted owner commits.
	// Only populated on a TRANSFER_OWNERSHIP made for an owner's departure.
	LeaveRequest *SOLeaveRequest `protobuf:"bytes,9,opt,name=leave_request,json=leaveRequest,proto3" json:"leaveRequest,omitempty"`
	// SharedObjectId binds the record to one shared object.
	SharedObjectId string `protobuf:"bytes,10,opt,name=shared_object_id,json=sharedObjectId,proto3" json:"sharedObjectId,omitempty"`
	// Signatures sign the record with signatures and commit cleared, under
	// owner control. Each signer is distinct and authorized by the parent
	// config; genesis is signed by an owner of its own config.
	Signatures []*peer.Signature `protobuf:"bytes,11,rep,name=signatures,proto3" json:"signatures,omitempty"`
	// Commit holds the precommits that decided the record under group control:
	// one round, voters of the parent config, more than two thirds of its
	// voting weight.
	Commit []*SOControlMessage `protobuf:"bytes,12,rep,name=commit,proto3" json:"commit,omitempty"`
	// contains filtered or unexported fields
}

SOConfigChange is a control record: one signed change in the config chain. Its identity is the hash of the record with signatures cleared.

func BuildSOConfigChange

func BuildSOConfigChange(
	sharedObjectID string,
	currentConfig *SharedObjectConfig,
	nextConfig *SharedObjectConfig,
	changeType SOConfigChangeType,
	signerPrivKey crypto.PrivKey,
	revInfo *SORevocationInfo,
) (*SOConfigChange, error)

BuildSOConfigChange constructs and signs a SOConfigChange entry.

currentConfig is the config before the change (used for previous_hash and seqno). nextConfig is the desired config after the change. changeType describes the kind of mutation in this entry. signerPrivKey is the private key of an OWNER in the current config, or the self-enrolling peer for SELF_ENROLL_PEER changes. revInfo is optional revocation metadata (only for REMOVE_PARTICIPANT changes).

func BuildSelfEnrollPeerConfigChange

func BuildSelfEnrollPeerConfigChange(
	sharedObjectID string,
	currentCfg *SharedObjectConfig,
	signerPriv bifrost_crypto.PrivKey,
	signerPeerID string,
	entityID string,
	role SOParticipantRole,
) (*SOConfigChange, error)

BuildSelfEnrollPeerConfigChange builds a SELF_ENROLL_PEER config change for a missing same-entity session peer. The peer repeats the username the owner recorded for its entity.

func ReadConfigLineage

func ReadConfigLineage(ctx context.Context, target []byte, read func(context.Context, []byte) (*SOConfigChange, error)) ([]*SOConfigChange, error)

ReadConfigLineage follows retained hash-addressed entries back from target, through genesis or the oldest entry read holds, and returns them oldest first. A replica sends it so the receiver can resolve the config of every operation it holds. Past the suffix bounds it keeps the newest entries.

func ReadConfigSuffix

func ReadConfigSuffix(ctx context.Context, base, target []byte, read func(context.Context, []byte) (*SOConfigChange, error)) ([]*SOConfigChange, error)

ReadConfigSuffix follows retained hash-addressed entries from target to base. The caller provides one consistent read scope. Missing history fails closed; returned entries remain untrusted until VerifyConfigChainSuffix accepts them.

func TransferSOOwnership

func TransferSOOwnership(ctx context.Context, host *SOHost, owner crypto.PrivKey, successor string, request *SOLeaveRequest) (*SOConfigChange, error)

TransferSOOwnership promotes a successor to OWNER in one change that carries the departing owner's leave consent. Only a remaining owner can re-sign the departed owner's grants and checkpoint, so the successor commits the departure with CompleteSOOwnershipTransfer. An empty successor selects the remaining participant with the highest role, then the earliest in configuration order.

func (*SOConfigChange) CloneMessageVT

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

func (*SOConfigChange) CloneVT

func (m *SOConfigChange) CloneVT() *SOConfigChange

func (*SOConfigChange) EqualMessageVT

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

func (*SOConfigChange) EqualVT

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

func (*SOConfigChange) GetChangeType

func (x *SOConfigChange) GetChangeType() SOConfigChangeType

func (*SOConfigChange) GetCommit

func (x *SOConfigChange) GetCommit() []*SOControlMessage

func (*SOConfigChange) GetConfig

func (x *SOConfigChange) GetConfig() *SharedObjectConfig

func (*SOConfigChange) GetConfigSeqno

func (x *SOConfigChange) GetConfigSeqno() uint64

func (*SOConfigChange) GetLeaveRequest

func (x *SOConfigChange) GetLeaveRequest() *SOLeaveRequest

func (*SOConfigChange) GetPreviousHash

func (x *SOConfigChange) GetPreviousHash() []byte

func (*SOConfigChange) GetRevocationInfo

func (x *SOConfigChange) GetRevocationInfo() *SORevocationInfo

func (*SOConfigChange) GetSharedObjectId

func (x *SOConfigChange) GetSharedObjectId() string

func (*SOConfigChange) GetSignatures

func (x *SOConfigChange) GetSignatures() []*peer.Signature

func (*SOConfigChange) MarshalJSON

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

MarshalJSON marshals the SOConfigChange to JSON.

func (*SOConfigChange) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOConfigChange message to JSON.

func (*SOConfigChange) MarshalProtoText

func (x *SOConfigChange) MarshalProtoText() string

func (*SOConfigChange) MarshalToSizedBufferVT

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

func (*SOConfigChange) MarshalToVT

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

func (*SOConfigChange) MarshalVT

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

func (*SOConfigChange) ProtoMessage

func (*SOConfigChange) ProtoMessage()

func (*SOConfigChange) Reset

func (x *SOConfigChange) Reset()

func (*SOConfigChange) SizeVT

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

func (*SOConfigChange) String

func (x *SOConfigChange) String() string

func (*SOConfigChange) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOConfigChange from JSON.

func (*SOConfigChange) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOConfigChange message from JSON.

func (*SOConfigChange) UnmarshalVT

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

type SOConfigChangeType

type SOConfigChangeType int32

SOConfigChangeType describes the kind of mutation in a config chain entry.

const (
	// SO_CONFIG_CHANGE_TYPE_UNKNOWN is the zero value.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_UNKNOWN SOConfigChangeType = 0
	// SO_CONFIG_CHANGE_TYPE_GENESIS is the initial config chain entry.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_GENESIS SOConfigChangeType = 1
	// SO_CONFIG_CHANGE_TYPE_ADD_PARTICIPANT adds a participant to the config.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_ADD_PARTICIPANT SOConfigChangeType = 2
	// SO_CONFIG_CHANGE_TYPE_REMOVE_PARTICIPANT removes a participant from the config.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_REMOVE_PARTICIPANT SOConfigChangeType = 3
	// SO_CONFIG_CHANGE_TYPE_ADD_INVITE creates a new invite.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_ADD_INVITE SOConfigChangeType = 4
	// SO_CONFIG_CHANGE_TYPE_REVOKE_INVITE revokes an existing invite.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_REVOKE_INVITE SOConfigChangeType = 5
	// SO_CONFIG_CHANGE_TYPE_INCREMENT_INVITE_USES records an invite usage.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_INCREMENT_INVITE_USES SOConfigChangeType = 6
	// SO_CONFIG_CHANGE_TYPE_SELF_ENROLL_PEER lets a same-entity session add itself.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_SELF_ENROLL_PEER SOConfigChangeType = 7
	// SO_CONFIG_CHANGE_TYPE_TRANSFER_OWNERSHIP promotes a participant to OWNER.
	// When an owner departs, it carries the leave consent the successor commits.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_TRANSFER_OWNERSHIP SOConfigChangeType = 8
	// SO_CONFIG_CHANGE_TYPE_SET_ROSTER changes which writers the trimming roster
	// drops.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_SET_ROSTER SOConfigChangeType = 9
	// SO_CONFIG_CHANGE_TYPE_SET_SEQUENCER chooses between Merge and One order,
	// or moves One order to another sequencer.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_SET_SEQUENCER SOConfigChangeType = 10
	// SO_CONFIG_CHANGE_TYPE_SET_CONTROL chooses owner or group control, or
	// changes voting weights.
	SOConfigChangeType_SO_CONFIG_CHANGE_TYPE_SET_CONTROL SOConfigChangeType = 11
)

func (SOConfigChangeType) Enum

func (SOConfigChangeType) MarshalJSON

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

MarshalJSON marshals the SOConfigChangeType to JSON.

func (SOConfigChangeType) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOConfigChangeType to JSON.

func (SOConfigChangeType) MarshalProtoText

func (x SOConfigChangeType) MarshalProtoText() string

func (SOConfigChangeType) MarshalText

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

MarshalText marshals the SOConfigChangeType to text.

func (SOConfigChangeType) String

func (x SOConfigChangeType) String() string

func (*SOConfigChangeType) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOConfigChangeType from JSON.

func (*SOConfigChangeType) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOConfigChangeType from JSON.

func (*SOConfigChangeType) UnmarshalText

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

UnmarshalText unmarshals the SOConfigChangeType from text.

type SOControl

type SOControl int32

SOControl says who changes a config and signs checkpoints.

const (
	// SO_CONTROL_OWNER lets any owner device sign alone.
	SOControl_SO_CONTROL_OWNER SOControl = 0
	// SO_CONTROL_GROUP needs a commit from voters holding more than two thirds
	// of the voting weight. No participant decides alone, including owners.
	SOControl_SO_CONTROL_GROUP SOControl = 1
)

func (SOControl) Enum

func (x SOControl) Enum() *SOControl

func (SOControl) MarshalJSON

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

MarshalJSON marshals the SOControl to JSON.

func (SOControl) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOControl to JSON.

func (SOControl) MarshalProtoText

func (x SOControl) MarshalProtoText() string

func (SOControl) MarshalText

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

MarshalText marshals the SOControl to text.

func (SOControl) String

func (x SOControl) String() string

func (*SOControl) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOControl from JSON.

func (*SOControl) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOControl from JSON.

func (*SOControl) UnmarshalText

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

UnmarshalText unmarshals the SOControl from text.

type SOControlMessage

type SOControlMessage struct {

	// Inner is the encoded SOControlMessageInner.
	Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"`
	// Signature is the voter's signature of inner.
	Signature *peer.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

SOControlMessage is one signed message of a group decision.

func BuildSOControlMessage

func BuildSOControlMessage(privKey crypto.PrivKey, inner *SOControlMessageInner) (*SOControlMessage, error)

BuildSOControlMessage signs inner as the voter of privKey, which it names as the message's peer.

func (*SOControlMessage) CloneMessageVT

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

func (*SOControlMessage) CloneVT

func (m *SOControlMessage) CloneVT() *SOControlMessage

func (*SOControlMessage) EqualMessageVT

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

func (*SOControlMessage) EqualVT

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

func (*SOControlMessage) GetInner

func (x *SOControlMessage) GetInner() []byte

func (*SOControlMessage) GetSignature

func (x *SOControlMessage) GetSignature() *peer.Signature

func (*SOControlMessage) Hash

func (m *SOControlMessage) Hash() []byte

Hash returns the identity of the message.

func (*SOControlMessage) MarshalJSON

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

MarshalJSON marshals the SOControlMessage to JSON.

func (*SOControlMessage) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOControlMessage message to JSON.

func (*SOControlMessage) MarshalProtoText

func (x *SOControlMessage) MarshalProtoText() string

func (*SOControlMessage) MarshalToSizedBufferVT

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

func (*SOControlMessage) MarshalToVT

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

func (*SOControlMessage) MarshalVT

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

func (*SOControlMessage) ProtoMessage

func (*SOControlMessage) ProtoMessage()

func (*SOControlMessage) Reset

func (x *SOControlMessage) Reset()

func (*SOControlMessage) SizeVT

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

func (*SOControlMessage) String

func (x *SOControlMessage) String() string

func (*SOControlMessage) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOControlMessage from JSON.

func (*SOControlMessage) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOControlMessage message from JSON.

func (*SOControlMessage) UnmarshalVT

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

func (*SOControlMessage) Verify

func (m *SOControlMessage) Verify(sharedObjectID string) (*SOControlMessageInner, error)

Verify authenticates the message as signed for sharedObjectID by the voter it names, and returns its body. It does not check that the signer votes.

type SOControlMessageInner

type SOControlMessageInner struct {

	// SharedObjectId binds the message to one shared object.
	SharedObjectId string `protobuf:"bytes,1,opt,name=shared_object_id,json=sharedObjectId,proto3" json:"sharedObjectId,omitempty"`
	// PeerId is the voter that signed the message.
	PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// Kind is the kind of value the message carries. Unknown on a vote.
	Kind SODecisionKind `protobuf:"varint,3,opt,name=kind,proto3" json:"kind,omitempty"`
	// Height is one more than the height of the checkpoint the decision
	// follows. Zero on AGREE, which stands while the config does.
	Height uint64 `protobuf:"varint,4,opt,name=height,proto3" json:"height,omitempty"`
	// ConfigHash is the config chain hash of the config whose voters decide.
	ConfigHash []byte `protobuf:"bytes,5,opt,name=config_hash,json=configHash,proto3" json:"configHash,omitempty"`
	// Round counts from 1. Zero on AGREE.
	Round uint32 `protobuf:"varint,6,opt,name=round,proto3" json:"round,omitempty"`
	// Type is the step this message takes.
	Type SOControlMessageType `protobuf:"varint,7,opt,name=type,proto3" json:"type,omitempty"`
	// ValueHash is the identity of the value. Empty on a nil vote.
	ValueHash []byte `protobuf:"bytes,8,opt,name=value_hash,json=valueHash,proto3" json:"valueHash,omitempty"`
	// ValidRound is the earlier round whose prevotes justify a re-proposed
	// value. Zero when none. Only on PROPOSAL.
	ValidRound uint32 `protobuf:"varint,9,opt,name=valid_round,json=validRound,proto3" json:"validRound,omitempty"`
	// Value is the encoded record: an SOConfigChange with signatures and
	// commit cleared, or an SOCheckpointInner. Only on AGREE and PROPOSAL.
	Value []byte `protobuf:"bytes,10,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

SOControlMessageInner is the signed body of a group decision message. A decision is one instance, named by its height and the config whose voters decide it. It decides one value: the next control record, which seals the held checkpoint, or the next checkpoint. Either closes the instance, so the two never race under one config.

func (*SOControlMessageInner) CloneMessageVT

func (*SOControlMessageInner) CloneVT

func (*SOControlMessageInner) EqualMessageVT

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

func (*SOControlMessageInner) EqualVT

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

func (*SOControlMessageInner) GetConfigHash

func (x *SOControlMessageInner) GetConfigHash() []byte

func (*SOControlMessageInner) GetHeight

func (x *SOControlMessageInner) GetHeight() uint64

func (*SOControlMessageInner) GetKind

func (*SOControlMessageInner) GetPeerId

func (x *SOControlMessageInner) GetPeerId() string

func (*SOControlMessageInner) GetRound

func (x *SOControlMessageInner) GetRound() uint32

func (*SOControlMessageInner) GetSharedObjectId

func (x *SOControlMessageInner) GetSharedObjectId() string

func (*SOControlMessageInner) GetType

func (*SOControlMessageInner) GetValidRound

func (x *SOControlMessageInner) GetValidRound() uint32

func (*SOControlMessageInner) GetValue

func (x *SOControlMessageInner) GetValue() []byte

func (*SOControlMessageInner) GetValueHash

func (x *SOControlMessageInner) GetValueHash() []byte

func (*SOControlMessageInner) MarshalJSON

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

MarshalJSON marshals the SOControlMessageInner to JSON.

func (*SOControlMessageInner) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOControlMessageInner message to JSON.

func (*SOControlMessageInner) MarshalProtoText

func (x *SOControlMessageInner) MarshalProtoText() string

func (*SOControlMessageInner) MarshalToSizedBufferVT

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

func (*SOControlMessageInner) MarshalToVT

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

func (*SOControlMessageInner) MarshalVT

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

func (*SOControlMessageInner) ProtoMessage

func (*SOControlMessageInner) ProtoMessage()

func (*SOControlMessageInner) Reset

func (x *SOControlMessageInner) Reset()

func (*SOControlMessageInner) SizeVT

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

func (*SOControlMessageInner) String

func (x *SOControlMessageInner) String() string

func (*SOControlMessageInner) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOControlMessageInner from JSON.

func (*SOControlMessageInner) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOControlMessageInner message from JSON.

func (*SOControlMessageInner) UnmarshalVT

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

func (*SOControlMessageInner) Validate

func (i *SOControlMessageInner) Validate() error

Validate checks the message body's structure: the instance it belongs to, and the fields its type carries.

type SOControlMessageType

type SOControlMessageType int32

SOControlMessageType is the step of a group decision a message takes.

const (
	// SO_CONTROL_MESSAGE_TYPE_UNKNOWN is the zero value.
	SOControlMessageType_SO_CONTROL_MESSAGE_TYPE_UNKNOWN SOControlMessageType = 0
	// SO_CONTROL_MESSAGE_TYPE_AGREE records that a voter agrees to a change.
	// It carries the value; height and round are zero. A control record is
	// agreed with its sealed_checkpoint cleared, which the proposer fills in.
	SOControlMessageType_SO_CONTROL_MESSAGE_TYPE_AGREE SOControlMessageType = 1
	// SO_CONTROL_MESSAGE_TYPE_PROPOSAL proposes the value of one round. Only
	// the round's proposer sends it.
	SOControlMessageType_SO_CONTROL_MESSAGE_TYPE_PROPOSAL SOControlMessageType = 2
	// SO_CONTROL_MESSAGE_TYPE_PREVOTE is the first vote of a round.
	SOControlMessageType_SO_CONTROL_MESSAGE_TYPE_PREVOTE SOControlMessageType = 3
	// SO_CONTROL_MESSAGE_TYPE_PRECOMMIT is the second vote of a round. A
	// non-nil precommit locks its signer on the value.
	SOControlMessageType_SO_CONTROL_MESSAGE_TYPE_PRECOMMIT SOControlMessageType = 4
)

func (SOControlMessageType) Enum

func (SOControlMessageType) MarshalJSON

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

MarshalJSON marshals the SOControlMessageType to JSON.

func (SOControlMessageType) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOControlMessageType to JSON.

func (SOControlMessageType) MarshalProtoText

func (x SOControlMessageType) MarshalProtoText() string

func (SOControlMessageType) MarshalText

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

MarshalText marshals the SOControlMessageType to text.

func (SOControlMessageType) String

func (x SOControlMessageType) String() string

func (*SOControlMessageType) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOControlMessageType from JSON.

func (*SOControlMessageType) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOControlMessageType from JSON.

func (*SOControlMessageType) UnmarshalText

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

UnmarshalText unmarshals the SOControlMessageType from text.

type SODecisionKind

type SODecisionKind int32

SODecisionKind is the kind of record a group decision value is.

const (
	// SO_DECISION_KIND_UNKNOWN is the zero value, and the kind of a vote.
	SODecisionKind_SO_DECISION_KIND_UNKNOWN SODecisionKind = 0
	// SO_DECISION_KIND_CONFIG is a control record.
	SODecisionKind_SO_DECISION_KIND_CONFIG SODecisionKind = 1
	// SO_DECISION_KIND_CHECKPOINT is a checkpoint.
	SODecisionKind_SO_DECISION_KIND_CHECKPOINT SODecisionKind = 2
)

func (SODecisionKind) Enum

func (x SODecisionKind) Enum() *SODecisionKind

func (SODecisionKind) MarshalJSON

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

MarshalJSON marshals the SODecisionKind to JSON.

func (SODecisionKind) MarshalProtoJSON

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

MarshalProtoJSON marshals the SODecisionKind to JSON.

func (SODecisionKind) MarshalProtoText

func (x SODecisionKind) MarshalProtoText() string

func (SODecisionKind) MarshalText

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

MarshalText marshals the SODecisionKind to text.

func (SODecisionKind) String

func (x SODecisionKind) String() string

func (*SODecisionKind) UnmarshalJSON

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

UnmarshalJSON unmarshals the SODecisionKind from JSON.

func (*SODecisionKind) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SODecisionKind from JSON.

func (*SODecisionKind) UnmarshalText

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

UnmarshalText unmarshals the SODecisionKind from text.

type SOEntityRecoveryEnvelope

type SOEntityRecoveryEnvelope struct {

	// EntityId is the stable entity identifier the envelope is for.
	EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entityId,omitempty"`
	// KeyEpoch is the current readable key epoch for this envelope.
	KeyEpoch uint64 `protobuf:"varint,2,opt,name=key_epoch,json=keyEpoch,proto3" json:"keyEpoch,omitempty"`
	// ConfigChainSeqno is the config-chain seqno the envelope matches.
	ConfigChainSeqno uint64 `protobuf:"varint,3,opt,name=config_chain_seqno,json=configChainSeqno,proto3" json:"configChainSeqno,omitempty"`
	// ConfigChainHash is the config-chain hash the envelope matches.
	ConfigChainHash []byte `protobuf:"bytes,4,opt,name=config_chain_hash,json=configChainHash,proto3" json:"configChainHash,omitempty"`
	// EnvelopeData is a bifrost/envelope payload encrypted to entity keypairs.
	EnvelopeData []byte `protobuf:"bytes,5,opt,name=envelope_data,json=envelopeData,proto3" json:"envelopeData,omitempty"`
	// contains filtered or unexported fields
}

SOEntityRecoveryEnvelope stores recovery material for one entity on an SO.

func BuildSOEntityRecoveryEnvelope

func BuildSOEntityRecoveryEnvelope(
	entityID string,
	keyEpoch uint64,
	cfg *SharedObjectConfig,
	material *SOEntityRecoveryMaterial,
	recipientPubs []bifrost_crypto.PubKey,
) (*SOEntityRecoveryEnvelope, error)

BuildSOEntityRecoveryEnvelope builds an entity recovery envelope for the current SO grant material.

func (*SOEntityRecoveryEnvelope) CloneMessageVT

func (*SOEntityRecoveryEnvelope) CloneVT

func (*SOEntityRecoveryEnvelope) EqualMessageVT

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

func (*SOEntityRecoveryEnvelope) EqualVT

func (*SOEntityRecoveryEnvelope) GetConfigChainHash

func (x *SOEntityRecoveryEnvelope) GetConfigChainHash() []byte

func (*SOEntityRecoveryEnvelope) GetConfigChainSeqno

func (x *SOEntityRecoveryEnvelope) GetConfigChainSeqno() uint64

func (*SOEntityRecoveryEnvelope) GetEntityId

func (x *SOEntityRecoveryEnvelope) GetEntityId() string

func (*SOEntityRecoveryEnvelope) GetEnvelopeData

func (x *SOEntityRecoveryEnvelope) GetEnvelopeData() []byte

func (*SOEntityRecoveryEnvelope) GetKeyEpoch

func (x *SOEntityRecoveryEnvelope) GetKeyEpoch() uint64

func (*SOEntityRecoveryEnvelope) MarshalJSON

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

MarshalJSON marshals the SOEntityRecoveryEnvelope to JSON.

func (*SOEntityRecoveryEnvelope) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOEntityRecoveryEnvelope message to JSON.

func (*SOEntityRecoveryEnvelope) MarshalProtoText

func (x *SOEntityRecoveryEnvelope) MarshalProtoText() string

func (*SOEntityRecoveryEnvelope) MarshalToSizedBufferVT

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

func (*SOEntityRecoveryEnvelope) MarshalToVT

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

func (*SOEntityRecoveryEnvelope) MarshalVT

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

func (*SOEntityRecoveryEnvelope) ProtoMessage

func (*SOEntityRecoveryEnvelope) ProtoMessage()

func (*SOEntityRecoveryEnvelope) Reset

func (x *SOEntityRecoveryEnvelope) Reset()

func (*SOEntityRecoveryEnvelope) SizeVT

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

func (*SOEntityRecoveryEnvelope) String

func (x *SOEntityRecoveryEnvelope) String() string

func (*SOEntityRecoveryEnvelope) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOEntityRecoveryEnvelope from JSON.

func (*SOEntityRecoveryEnvelope) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOEntityRecoveryEnvelope message from JSON.

func (*SOEntityRecoveryEnvelope) UnmarshalVT

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

type SOEntityRecoveryMaterial

type SOEntityRecoveryMaterial struct {

	// EntityId is the stable entity identifier this material is for.
	EntityId string `protobuf:"bytes,1,opt,name=entity_id,json=entityId,proto3" json:"entityId,omitempty"`
	// Role is the maximum role the entity may self-rejoin with.
	Role SOParticipantRole `protobuf:"varint,2,opt,name=role,proto3" json:"role,omitempty"`
	// GrantInner is the current grant material used to mint a peer grant.
	GrantInner *SOGrantInner `protobuf:"bytes,3,opt,name=grant_inner,json=grantInner,proto3" json:"grantInner,omitempty"`
	// contains filtered or unexported fields
}

SOEntityRecoveryMaterial is the decrypted recovery material for one entity.

func ResolveSharedObjectRecoveryMaterial

func ResolveSharedObjectRecoveryMaterial(
	ctx context.Context,
	provAcc provider.ProviderAccount,
	ref *SharedObjectRef,
) (*SOEntityRecoveryMaterial, error)

ResolveSharedObjectRecoveryMaterial resolves the recovery material for an SO using the provider feature surface.

func UnlockSOEntityRecoveryEnvelope

func UnlockSOEntityRecoveryEnvelope(entityPrivKeys []bifrost_crypto.PrivKey, env *SOEntityRecoveryEnvelope) (*SOEntityRecoveryMaterial, error)

UnlockSOEntityRecoveryEnvelope decrypts a recovery envelope into recovery material.

func (*SOEntityRecoveryMaterial) CloneMessageVT

func (*SOEntityRecoveryMaterial) CloneVT

func (*SOEntityRecoveryMaterial) EqualMessageVT

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

func (*SOEntityRecoveryMaterial) EqualVT

func (*SOEntityRecoveryMaterial) GetEntityId

func (x *SOEntityRecoveryMaterial) GetEntityId() string

func (*SOEntityRecoveryMaterial) GetGrantInner

func (x *SOEntityRecoveryMaterial) GetGrantInner() *SOGrantInner

func (*SOEntityRecoveryMaterial) GetRole

func (*SOEntityRecoveryMaterial) MarshalJSON

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

MarshalJSON marshals the SOEntityRecoveryMaterial to JSON.

func (*SOEntityRecoveryMaterial) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOEntityRecoveryMaterial message to JSON.

func (*SOEntityRecoveryMaterial) MarshalProtoText

func (x *SOEntityRecoveryMaterial) MarshalProtoText() string

func (*SOEntityRecoveryMaterial) MarshalToSizedBufferVT

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

func (*SOEntityRecoveryMaterial) MarshalToVT

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

func (*SOEntityRecoveryMaterial) MarshalVT

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

func (*SOEntityRecoveryMaterial) ProtoMessage

func (*SOEntityRecoveryMaterial) ProtoMessage()

func (*SOEntityRecoveryMaterial) Reset

func (x *SOEntityRecoveryMaterial) Reset()

func (*SOEntityRecoveryMaterial) SizeVT

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

func (*SOEntityRecoveryMaterial) String

func (x *SOEntityRecoveryMaterial) String() string

func (*SOEntityRecoveryMaterial) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOEntityRecoveryMaterial from JSON.

func (*SOEntityRecoveryMaterial) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOEntityRecoveryMaterial message from JSON.

func (*SOEntityRecoveryMaterial) UnmarshalVT

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

type SOEquivocation

type SOEquivocation struct {
	// PeerID is the author.
	PeerID string
	// Nonce is the author sequence.
	Nonce uint64
	// Hashes are the conflicting operations in byte order.
	Hashes [][]byte
}

SOEquivocation is evidence that an author signed several operations at one sequence.

type SOGrant

type SOGrant struct {

	// PeerId is the peer id of the target of the grant.
	// Must match a peer id of a participant on the shared object.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// InnerData is the inner SOGrantInner encrypted to the peer id.
	InnerData []byte `protobuf:"bytes,2,opt,name=inner_data,json=innerData,proto3" json:"innerData,omitempty"`
	// Signature is the signature of inner_data by the peer that issued the grant.
	Signature *peer.Signature `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

SOGrant is a grant of a transform configuration to a peer.

func AddSOParticipant

func AddSOParticipant(
	ctx context.Context,
	host *SOHost,
	soID string,
	localPriv crypto.PrivKey,
	localPeerIDStr string,
	targetPeerIDStr string,
	targetPub crypto.PubKey,
	role SOParticipantRole,
	entityID string,
	username string,
) (*SOGrant, error)

AddSOParticipant adds a target peer as a participant on a single shared object and grants it every key epoch the local peer holds, so it can replay operations written before a rotation.

Reads the current SOState, checks for duplicate participant, builds a signed SOConfigChange adding the participant, and applies it atomically with the grants encrypted to the target's public key.

Returns the target's grant for the current key epoch, or nil if the participant already existed (no-op). Under group control localPriv, a voter, agrees to the addition and it returns ErrAwaitingGroup; a writer of an entity without a voter joins with one vote, and the voters hand it the key once the group decides.

localPriv must be the private key of an OWNER in the current config. localPeerIDStr is the base58 peer ID corresponding to localPriv. username is the provider username of entityID, or empty when entityID is empty.

func BuildSelfEnrollPeerGrant

func BuildSelfEnrollPeerGrant(
	signerPriv bifrost_crypto.PrivKey,
	peerID bifrost_peer.ID,
	sharedObjectID string,
	material *SOEntityRecoveryMaterial,
) (*SOGrant, error)

BuildSelfEnrollPeerGrant builds a self-issued grant for the newly enrolled peer using recovered grant material.

func EncryptSOGrant

func EncryptSOGrant(privKey crypto.PrivKey, toPubKey crypto.PubKey, sharedObjectID string, nextInner *SOGrantInner) (*SOGrant, error)

EncryptSOGrant encrypts the inner data of a SOGrant. The privKey is also used to sign the inner data.

func (*SOGrant) CloneMessageVT

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

func (*SOGrant) CloneVT

func (m *SOGrant) CloneVT() *SOGrant

func (*SOGrant) DecryptInnerData

func (g *SOGrant) DecryptInnerData(privKey crypto.PrivKey, sharedObjectID string) (*SOGrantInner, error)

DecryptInnerData decrypts the inner data of a SOGrant.

func (*SOGrant) EqualMessageVT

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

func (*SOGrant) EqualVT

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

func (*SOGrant) GetInnerData

func (x *SOGrant) GetInnerData() []byte

func (*SOGrant) GetPeerId

func (x *SOGrant) GetPeerId() string

func (*SOGrant) GetSignature

func (x *SOGrant) GetSignature() *peer.Signature

func (*SOGrant) MarshalJSON

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

MarshalJSON marshals the SOGrant to JSON.

func (*SOGrant) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOGrant message to JSON.

func (*SOGrant) MarshalProtoText

func (x *SOGrant) MarshalProtoText() string

func (*SOGrant) MarshalToSizedBufferVT

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

func (*SOGrant) MarshalToVT

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

func (*SOGrant) MarshalVT

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

func (*SOGrant) ParsePeerID

func (g *SOGrant) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID.

func (*SOGrant) ProtoMessage

func (*SOGrant) ProtoMessage()

func (*SOGrant) Reset

func (x *SOGrant) Reset()

func (*SOGrant) SizeVT

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

func (*SOGrant) String

func (x *SOGrant) String() string

func (*SOGrant) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOGrant from JSON.

func (*SOGrant) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOGrant message from JSON.

func (*SOGrant) UnmarshalVT

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

func (*SOGrant) Validate

func (g *SOGrant) Validate() error

Validate performs cursory checks on the SOGrant.

func (*SOGrant) ValidateSignature

func (g *SOGrant) ValidateSignature(sharedObjectID string, cfg *SharedObjectConfig) error

ValidateSignature authenticates the grant and checks that an owner of cfg, a voter under its group control, or the grant's reading recipient signed it. Under group control any voter hands the key to a member the group admitted.

func (*SOGrant) Verify

func (g *SOGrant) Verify(sharedObjectID string) (string, error)

Verify authenticates the grant's signature and returns its signer. It does not check that the signer may issue the grant; ValidateSignature does.

type SOGrantInner

type SOGrantInner struct {

	// TransformConf is the transform config within the grant.
	// Usually contains a crypto key.
	TransformConf *transform.Config `protobuf:"bytes,1,opt,name=transform_conf,json=transformConf,proto3" json:"transformConf,omitempty"`
	// contains filtered or unexported fields
}

SOGrantInner is the inner encrypted body of the SOGrant.

func (*SOGrantInner) CloneMessageVT

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

func (*SOGrantInner) CloneVT

func (m *SOGrantInner) CloneVT() *SOGrantInner

func (*SOGrantInner) EqualMessageVT

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

func (*SOGrantInner) EqualVT

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

func (*SOGrantInner) GetTransformConf

func (x *SOGrantInner) GetTransformConf() *transform.Config

func (*SOGrantInner) MarshalJSON

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

MarshalJSON marshals the SOGrantInner to JSON.

func (*SOGrantInner) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOGrantInner message to JSON.

func (*SOGrantInner) MarshalProtoText

func (x *SOGrantInner) MarshalProtoText() string

func (*SOGrantInner) MarshalToSizedBufferVT

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

func (*SOGrantInner) MarshalToVT

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

func (*SOGrantInner) MarshalVT

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

func (*SOGrantInner) ProtoMessage

func (*SOGrantInner) ProtoMessage()

func (*SOGrantInner) Reset

func (x *SOGrantInner) Reset()

func (*SOGrantInner) SizeVT

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

func (*SOGrantInner) String

func (x *SOGrantInner) String() string

func (*SOGrantInner) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOGrantInner from JSON.

func (*SOGrantInner) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOGrantInner message from JSON.

func (*SOGrantInner) UnmarshalVT

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

func (*SOGrantInner) Validate

func (g *SOGrantInner) Validate() error

Validate performs cursory checks on the SOGrantInner.

type SOHost

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

SOHost is the implementation of the shared object host logic for a SOState container.

func NewSOHost

func NewSOHost(ctx context.Context, watchFn SOStateWatchFunc, lockFn SOStateLockFunc, sharedObjectID string, syncFuncs ...*SOHostSyncFuncs) *SOHost

NewSOHost constructs a new shared object host.

ctx can be nil.

func (*SOHost) AddLocalOperation

func (s *SOHost) AddLocalOperation(
	ctx context.Context,
	le *logrus.Entry,
	sfs *block_transform.StepFactorySet,
	privKey crypto.PrivKey,
	opData []byte,
) (string, uint64, error)

AddLocalOperation signs opData as the owner of privKey and adds it to the operation set, encoded with the key of the epoch the operation names. It returns the operation's local ID and nonce once the state holding it is written. Empty opData writes an acknowledgment.

func (*SOHost) ApplyConfigChange

func (s *SOHost) ApplyConfigChange(ctx context.Context, entry *SOConfigChange, fn func(state *SOState) error) error

ApplyConfigChange applies a signed SOConfigChange to the shared object state.

Verifies chain integrity (previous_hash matches current config_chain_hash, authorization from the current config), then replaces the config with the entry's config and updates the config_chain_hash.

If fn is non-nil it is called after the config is applied but before the state is written, allowing additional atomic mutations (e.g. grant issuance).

func (*SOHost) CanWatchSOState added in v0.51.8

func (s *SOHost) CanWatchSOState() bool

CanWatchSOState returns true if the host can watch shared object state.

func (*SOHost) ClearContext

func (s *SOHost) ClearContext()

ClearContext clears the context and shuts down all routines.

func (*SOHost) CreateInvite

func (s *SOHost) CreateInvite(
	ctx context.Context,
	signerPrivKey crypto.PrivKey,
	invite *SOInvite,
) error

CreateInvite creates a new invite on the shared object via a signed config chain entry. The invite is appended to SOState.invites. The config itself does not change; the chain entry records the authorized operation. Invite identity is checked against the checkpoint held under the provider lock.

func (*SOHost) CreateSOInviteOp

func (s *SOHost) CreateSOInviteOp(
	ctx context.Context,
	ownerPrivKey crypto.PrivKey,
	providerID string,
	terms *SOInvite,
) (*SOInviteMessage, error)

CreateSOInviteOp creates an invite on the shared object and returns the signed SOInviteMessage for out-of-band distribution.

Builds the invite from terms with BuildSOInviteMessage, then stores its metadata in SOState.invites via a signed config chain entry.

func (*SOHost) GetHostState

func (s *SOHost) GetHostState(ctx context.Context) (*SOState, error)

GetHostState returns a snapshot of the current SOState.

func (*SOHost) GetSOStateCtr

func (s *SOHost) GetSOStateCtr(ctx context.Context, released func()) (ccontainer.Watchable[*SOState], func(), error)

GetSOStateCtr watches the shared object state with the refcount container.

func (*SOHost) GetSharedObjectID

func (s *SOHost) GetSharedObjectID() string

GetSharedObjectID returns the sharedObjectID for the SOHost.

func (*SOHost) ImportPeerSnapshot

func (s *SOHost) ImportPeerSnapshot(
	ctx context.Context,
	candidate *SOState,
	changes []*SOConfigChange,
	localPeer peer.ID,
	validateAccess func(context.Context, *SOState) error,
) error

ImportPeerSnapshot verifies a candidate against held authority and commits it with its lineage. Access validation runs under the provider lock and must not reacquire host state. A committed local removal returns ErrParticipantRevoked.

func (*SOHost) IncrementInviteUses

func (s *SOHost) IncrementInviteUses(
	ctx context.Context,
	signerPrivKey crypto.PrivKey,
	inviteID string,
) error

IncrementInviteUses increments the uses counter on an invite via a signed config chain entry. Returns an error if the invite is invalid, revoked, expired, or has reached max_uses. Usability is checked under the provider lock before incrementing the counter.

func (*SOHost) InstallInviteSnapshot

func (s *SOHost) InstallInviteSnapshot(ctx context.Context, candidate *SOState, lineage []*SOConfigChange) error

InstallInviteSnapshot installs an explicit, externally authenticated invitation result with lineage, the inviter's retained changes leading to its config, oldest first. The lineage lets this replica resolve the config of every operation the candidate holds. The caller must have authenticated the invitation owner and its response before calling this operation. Ordinary peer synchronization must use ImportPeerSnapshot.

func (*SOHost) ReadConfigEntry

func (s *SOHost) ReadConfigEntry(ctx context.Context, head []byte) (*SOConfigChange, error)

ReadConfigEntry returns the retained transition that produced an exact head.

func (*SOHost) ReadConfigHistory

func (s *SOHost) ReadConfigHistory(ctx context.Context, base, target []byte) ([]*SOConfigChange, error)

ReadConfigHistory returns retained transitions between exact configuration heads.

func (*SOHost) ReadConfigLineage

func (s *SOHost) ReadConfigLineage(ctx context.Context, target []byte) ([]*SOConfigChange, error)

ReadConfigLineage returns the retained changes that lead to the config head target, oldest first. See ReadConfigLineage.

func (*SOHost) RevokeInvite

func (s *SOHost) RevokeInvite(
	ctx context.Context,
	signerPrivKey crypto.PrivKey,
	inviteID string,
) error

RevokeInvite revokes an existing invite on the shared object via a signed config chain entry. Sets revoked=true on the matching invite.

func (*SOHost) SequenceOperations

func (s *SOHost) SequenceOperations(ctx context.Context, privKey crypto.PrivKey) error

SequenceOperations places, as the sequencer of privKey, every operation the sequence has not placed, in one write. It writes nothing unless privKey is the appointed sequencer and an operation awaits a position.

func (*SOHost) SetContext

func (s *SOHost) SetContext(ctx context.Context) bool

SetContext updates the context on the refcount.

Returns if the context was updated.

func (*SOHost) UpdateSOState

func (s *SOHost) UpdateSOState(ctx context.Context, fn func(state *SOState) error) error

UpdateSOState locks the SO state, clones it, calls the provided function to mutate the clone, then writes the updated state.

func (*SOHost) WaitDurable

func (s *SOHost) WaitDurable(ctx context.Context) error

WaitDurable waits until every state write completed before the call is durable. Callers that send state off the machine capture it, call WaitDurable, then send, so no peer sees a state a power loss could undo.

type SOHostSyncFuncs

type SOHostSyncFuncs struct {
	// Lock imports accepted peer state without publishing a local root to a server.
	// When nil, the host uses its ordinary local persistence lock.
	Lock SOStateLockFunc
	// CheckpointLock atomically installs an externally authenticated invitation
	// checkpoint. The changes written with it are the verified lineage of the
	// state's config, oldest first; the first produced the new history base.
	// It is never used for peer synchronization or an unauthenticated recovery candidate.
	CheckpointLock SOStateLockFunc
	// History returns a bounded oldest-first suffix between two exact head hashes.
	// It returns ErrConfigHistoryUnavailable for missing or divergent history.
	History func(context.Context, string, []byte, []byte) ([]*SOConfigChange, error)
	// Entry returns the retained configuration change addressed by its hash, or
	// nil when it is not retained.
	Entry func(context.Context, string, []byte) (*SOConfigChange, error)
	// WaitDurable waits, without forcing a flush, until every state write
	// completed before the call is durable. When nil, state writes are durable
	// when they return.
	WaitDurable func(context.Context) error
}

SOHostSyncFuncs supplies provider persistence for authenticated peer import. Configure these callbacks when constructing the host, before publishing it.

type SOInvite

type SOInvite struct {

	// InviteId is the unique identifier for this invite.
	InviteId string `protobuf:"bytes,1,opt,name=invite_id,json=inviteId,proto3" json:"inviteId,omitempty"`
	// TokenHash is the SHA256 hash of the invite token.
	// The raw token is never stored on-chain.
	TokenHash []byte `protobuf:"bytes,2,opt,name=token_hash,json=tokenHash,proto3" json:"tokenHash,omitempty"`
	// Role is the role granted to the invitee on acceptance.
	Role SOParticipantRole `protobuf:"varint,3,opt,name=role,proto3" json:"role,omitempty"`
	// TargetPeerId is the optional peer ID of the intended invitee.
	// Empty means open invite (anyone with the token can join).
	TargetPeerId string `protobuf:"bytes,4,opt,name=target_peer_id,json=targetPeerId,proto3" json:"targetPeerId,omitempty"`
	// MaxUses is the maximum number of times the invite can be used.
	// 0 means unlimited.
	MaxUses uint32 `protobuf:"varint,5,opt,name=max_uses,json=maxUses,proto3" json:"maxUses,omitempty"`
	// Uses is the current number of times the invite has been used.
	Uses uint32 `protobuf:"varint,6,opt,name=uses,proto3" json:"uses,omitempty"`
	// ExpiresAt is the time after which the invite is invalid.
	// Unset means no expiry.
	ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=expires_at,json=expiresAt,proto3" json:"expiresAt,omitempty"`
	// Revoked indicates the invite has been revoked by the owner.
	Revoked bool `protobuf:"varint,8,opt,name=revoked,proto3" json:"revoked,omitempty"`
	// TargetAccountId is the optional provider account id required to submit a
	// targeted invitation proof for this invite. Empty means bearer invite.
	TargetAccountId string `protobuf:"bytes,9,opt,name=target_account_id,json=targetAccountId,proto3" json:"targetAccountId,omitempty"`
	// ApprovalRequired queues a redemption the invite does not otherwise admit
	// as a join request, which an owner grants or refuses.
	ApprovalRequired bool `protobuf:"varint,10,opt,name=approval_required,json=approvalRequired,proto3" json:"approvalRequired,omitempty"`
	// ParticipantOf admits a redeemer who participates in one of the named
	// Spaces, as the redeeming host holds them. Unset applies no condition.
	ParticipantOf *SOInviteParticipation `protobuf:"bytes,11,opt,name=participant_of,json=participantOf,proto3" json:"participantOf,omitempty"`
	// contains filtered or unexported fields
}

SOInvite is a pending invite on a SharedObject. Stored in plaintext on SOState, outside the encrypted checkpoint state.

func FindInvite

func FindInvite(state *SOState, inviteID string) *SOInvite

FindInvite returns the invite with the given ID from the state, or nil.

func (*SOInvite) CloneMessageVT

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

func (*SOInvite) CloneVT

func (m *SOInvite) CloneVT() *SOInvite

func (*SOInvite) EqualMessageVT

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

func (*SOInvite) EqualVT

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

func (*SOInvite) GetApprovalRequired

func (x *SOInvite) GetApprovalRequired() bool

func (*SOInvite) GetExpiresAt

func (x *SOInvite) GetExpiresAt() *timestamppb.Timestamp

func (*SOInvite) GetInviteId

func (x *SOInvite) GetInviteId() string

func (*SOInvite) GetMaxUses

func (x *SOInvite) GetMaxUses() uint32

func (*SOInvite) GetParticipantOf

func (x *SOInvite) GetParticipantOf() *SOInviteParticipation

func (*SOInvite) GetRevoked

func (x *SOInvite) GetRevoked() bool

func (*SOInvite) GetRole

func (x *SOInvite) GetRole() SOParticipantRole

func (*SOInvite) GetTargetAccountId added in v0.51.2

func (x *SOInvite) GetTargetAccountId() string

func (*SOInvite) GetTargetPeerId

func (x *SOInvite) GetTargetPeerId() string

func (*SOInvite) GetTokenHash

func (x *SOInvite) GetTokenHash() []byte

func (*SOInvite) GetUses

func (x *SOInvite) GetUses() uint32

func (*SOInvite) MarshalJSON

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

MarshalJSON marshals the SOInvite to JSON.

func (*SOInvite) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOInvite message to JSON.

func (*SOInvite) MarshalProtoText

func (x *SOInvite) MarshalProtoText() string

func (*SOInvite) MarshalToSizedBufferVT

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

func (*SOInvite) MarshalToVT

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

func (*SOInvite) MarshalVT

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

func (*SOInvite) ProtoMessage

func (*SOInvite) ProtoMessage()

func (*SOInvite) Reset

func (x *SOInvite) Reset()

func (*SOInvite) SizeVT

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

func (*SOInvite) String

func (x *SOInvite) String() string

func (*SOInvite) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOInvite from JSON.

func (*SOInvite) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOInvite message from JSON.

func (*SOInvite) UnmarshalVT

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

type SOInviteMessage

type SOInviteMessage struct {

	// InviteId is the unique identifier for this invite.
	InviteId string `protobuf:"bytes,1,opt,name=invite_id,json=inviteId,proto3" json:"inviteId,omitempty"`
	// SharedObjectId is the ID of the shared object being shared.
	SharedObjectId string `protobuf:"bytes,2,opt,name=shared_object_id,json=sharedObjectId,proto3" json:"sharedObjectId,omitempty"`
	// OwnerPeerId is the peer ID of the invite creator (b58).
	OwnerPeerId string `protobuf:"bytes,3,opt,name=owner_peer_id,json=ownerPeerId,proto3" json:"ownerPeerId,omitempty"`
	// ProviderId is the provider to use for signaling (not a raw URL).
	ProviderId string `protobuf:"bytes,4,opt,name=provider_id,json=providerId,proto3" json:"providerId,omitempty"`
	// Token is the raw invite token. The SHA256 hash is stored on-chain.
	Token []byte `protobuf:"bytes,5,opt,name=token,proto3" json:"token,omitempty"`
	// Role is the role granted to the invitee on acceptance.
	Role SOParticipantRole `protobuf:"varint,6,opt,name=role,proto3" json:"role,omitempty"`
	// TargetPeerId is the optional peer ID of the intended invitee (b58).
	// Empty means open invite.
	TargetPeerId string `protobuf:"bytes,7,opt,name=target_peer_id,json=targetPeerId,proto3" json:"targetPeerId,omitempty"`
	// ExpiresAt is the time after which the invite is invalid.
	// Unset means no expiry.
	ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=expires_at,json=expiresAt,proto3" json:"expiresAt,omitempty"`
	// MaxUses is the maximum number of times the invite can be used.
	// 0 means unlimited.
	MaxUses uint32 `protobuf:"varint,9,opt,name=max_uses,json=maxUses,proto3" json:"maxUses,omitempty"`
	// Signature is the owner's signature over this message (without this field).
	Signature *peer.Signature `protobuf:"bytes,10,opt,name=signature,proto3" json:"signature,omitempty"`
	// TransportPeerId is the optional network endpoint peer ID carried in this
	// signed message, separate from OwnerPeerId, the signing identity.
	// Empty means use OwnerPeerId for existing messages.
	TransportPeerId string `protobuf:"bytes,11,opt,name=transport_peer_id,json=transportPeerId,proto3" json:"transportPeerId,omitempty"`
	// contains filtered or unexported fields
}

SOInviteMessage is a signed invite distributed out-of-band to an invitee. The raw token is included (unlike SOInvite which stores only the hash).

func (*SOInviteMessage) CloneMessageVT

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

func (*SOInviteMessage) CloneVT

func (m *SOInviteMessage) CloneVT() *SOInviteMessage

func (*SOInviteMessage) EqualMessageVT

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

func (*SOInviteMessage) EqualVT

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

func (*SOInviteMessage) GetExpiresAt

func (x *SOInviteMessage) GetExpiresAt() *timestamppb.Timestamp

func (*SOInviteMessage) GetInviteId

func (x *SOInviteMessage) GetInviteId() string

func (*SOInviteMessage) GetMaxUses

func (x *SOInviteMessage) GetMaxUses() uint32

func (*SOInviteMessage) GetOwnerPeerId

func (x *SOInviteMessage) GetOwnerPeerId() string

func (*SOInviteMessage) GetProviderId

func (x *SOInviteMessage) GetProviderId() string

func (*SOInviteMessage) GetRole

func (x *SOInviteMessage) GetRole() SOParticipantRole

func (*SOInviteMessage) GetSharedObjectId

func (x *SOInviteMessage) GetSharedObjectId() string

func (*SOInviteMessage) GetSignature

func (x *SOInviteMessage) GetSignature() *peer.Signature

func (*SOInviteMessage) GetTargetPeerId

func (x *SOInviteMessage) GetTargetPeerId() string

func (*SOInviteMessage) GetToken

func (x *SOInviteMessage) GetToken() []byte

func (*SOInviteMessage) GetTransportPeerId added in v0.57.4

func (x *SOInviteMessage) GetTransportPeerId() string

func (*SOInviteMessage) MarshalJSON

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

MarshalJSON marshals the SOInviteMessage to JSON.

func (*SOInviteMessage) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOInviteMessage message to JSON.

func (*SOInviteMessage) MarshalProtoText

func (x *SOInviteMessage) MarshalProtoText() string

func (*SOInviteMessage) MarshalToSizedBufferVT

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

func (*SOInviteMessage) MarshalToVT

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

func (*SOInviteMessage) MarshalVT

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

func (*SOInviteMessage) ProtoMessage

func (*SOInviteMessage) ProtoMessage()

func (*SOInviteMessage) Reset

func (x *SOInviteMessage) Reset()

func (*SOInviteMessage) Sign added in v0.57.4

func (m *SOInviteMessage) Sign(ownerKey crypto.PrivKey) error

Sign signs every invitation field with the declared owner's key.

func (*SOInviteMessage) SizeVT

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

func (*SOInviteMessage) String

func (x *SOInviteMessage) String() string

func (*SOInviteMessage) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOInviteMessage from JSON.

func (*SOInviteMessage) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOInviteMessage message from JSON.

func (*SOInviteMessage) UnmarshalVT

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

func (*SOInviteMessage) VerifyTransportPeer added in v0.57.4

func (m *SOInviteMessage) VerifyTransportPeer() (peer.ID, error)

VerifyTransportPeer verifies the owner's signature before resolving the peer that receives the invitation token. Older invitations dial the owner directly.

type SOInviteParticipation

type SOInviteParticipation struct {

	// SharedObjectIds are the named Spaces.
	SharedObjectIds []string `protobuf:"bytes,1,rep,name=shared_object_ids,json=sharedObjectIds,proto3" json:"sharedObjectIds,omitempty"`
	// contains filtered or unexported fields
}

SOInviteParticipation names the Spaces whose participants an invite admits. An empty list admits nobody by participation.

func (*SOInviteParticipation) CloneMessageVT

func (*SOInviteParticipation) CloneVT

func (*SOInviteParticipation) EqualMessageVT

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

func (*SOInviteParticipation) EqualVT

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

func (*SOInviteParticipation) GetSharedObjectIds

func (x *SOInviteParticipation) GetSharedObjectIds() []string

func (*SOInviteParticipation) MarshalJSON

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

MarshalJSON marshals the SOInviteParticipation to JSON.

func (*SOInviteParticipation) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOInviteParticipation message to JSON.

func (*SOInviteParticipation) MarshalProtoText

func (x *SOInviteParticipation) MarshalProtoText() string

func (*SOInviteParticipation) MarshalToSizedBufferVT

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

func (*SOInviteParticipation) MarshalToVT

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

func (*SOInviteParticipation) MarshalVT

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

func (*SOInviteParticipation) ProtoMessage

func (*SOInviteParticipation) ProtoMessage()

func (*SOInviteParticipation) Reset

func (x *SOInviteParticipation) Reset()

func (*SOInviteParticipation) SizeVT

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

func (*SOInviteParticipation) String

func (x *SOInviteParticipation) String() string

func (*SOInviteParticipation) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOInviteParticipation from JSON.

func (*SOInviteParticipation) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOInviteParticipation message from JSON.

func (*SOInviteParticipation) UnmarshalVT

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

type SOJoinRequest

type SOJoinRequest struct {

	// JoinResponse is the requester's signed redemption.
	JoinResponse *SOJoinResponse `protobuf:"bytes,1,opt,name=join_response,json=joinResponse,proto3" json:"joinResponse,omitempty"`
	// CreatedAt is when the host queued the request.
	CreatedAt *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=created_at,json=createdAt,proto3" json:"createdAt,omitempty"`
	// contains filtered or unexported fields
}

SOJoinRequest is a redemption waiting for an owner to grant or refuse it.

func (*SOJoinRequest) CloneMessageVT

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

func (*SOJoinRequest) CloneVT

func (m *SOJoinRequest) CloneVT() *SOJoinRequest

func (*SOJoinRequest) EqualMessageVT

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

func (*SOJoinRequest) EqualVT

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

func (*SOJoinRequest) GetCreatedAt

func (x *SOJoinRequest) GetCreatedAt() *timestamppb.Timestamp

func (*SOJoinRequest) GetJoinResponse

func (x *SOJoinRequest) GetJoinResponse() *SOJoinResponse

func (*SOJoinRequest) MarshalJSON

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

MarshalJSON marshals the SOJoinRequest to JSON.

func (*SOJoinRequest) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOJoinRequest message to JSON.

func (*SOJoinRequest) MarshalProtoText

func (x *SOJoinRequest) MarshalProtoText() string

func (*SOJoinRequest) MarshalToSizedBufferVT

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

func (*SOJoinRequest) MarshalToVT

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

func (*SOJoinRequest) MarshalVT

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

func (*SOJoinRequest) ProtoMessage

func (*SOJoinRequest) ProtoMessage()

func (*SOJoinRequest) Reset

func (x *SOJoinRequest) Reset()

func (*SOJoinRequest) SizeVT

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

func (*SOJoinRequest) String

func (x *SOJoinRequest) String() string

func (*SOJoinRequest) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOJoinRequest from JSON.

func (*SOJoinRequest) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOJoinRequest message from JSON.

func (*SOJoinRequest) UnmarshalVT

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

type SOJoinRequestList

type SOJoinRequestList struct {

	// Requests are ordered by arrival.
	Requests []*SOJoinRequest `protobuf:"bytes,1,rep,name=requests,proto3" json:"requests,omitempty"`
	// contains filtered or unexported fields
}

SOJoinRequestList is a host's pending join requests for one Space, at most one per requesting peer.

func (*SOJoinRequestList) CloneMessageVT

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

func (*SOJoinRequestList) CloneVT

func (m *SOJoinRequestList) CloneVT() *SOJoinRequestList

func (*SOJoinRequestList) EqualMessageVT

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

func (*SOJoinRequestList) EqualVT

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

func (*SOJoinRequestList) GetRequests

func (x *SOJoinRequestList) GetRequests() []*SOJoinRequest

func (*SOJoinRequestList) MarshalJSON

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

MarshalJSON marshals the SOJoinRequestList to JSON.

func (*SOJoinRequestList) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOJoinRequestList message to JSON.

func (*SOJoinRequestList) MarshalProtoText

func (x *SOJoinRequestList) MarshalProtoText() string

func (*SOJoinRequestList) MarshalToSizedBufferVT

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

func (*SOJoinRequestList) MarshalToVT

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

func (*SOJoinRequestList) MarshalVT

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

func (*SOJoinRequestList) ProtoMessage

func (*SOJoinRequestList) ProtoMessage()

func (*SOJoinRequestList) Reset

func (x *SOJoinRequestList) Reset()

func (*SOJoinRequestList) SizeVT

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

func (*SOJoinRequestList) String

func (x *SOJoinRequestList) String() string

func (*SOJoinRequestList) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOJoinRequestList from JSON.

func (*SOJoinRequestList) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOJoinRequestList message from JSON.

func (*SOJoinRequestList) UnmarshalVT

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

type SOJoinResponse

type SOJoinResponse struct {

	// InviteId is the invite being accepted.
	InviteId string `protobuf:"bytes,1,opt,name=invite_id,json=inviteId,proto3" json:"inviteId,omitempty"`
	// ResponderPeerId is the peer ID of the responder (b58).
	ResponderPeerId string `protobuf:"bytes,2,opt,name=responder_peer_id,json=responderPeerId,proto3" json:"responderPeerId,omitempty"`
	// ResponderPubkey is the DER-encoded public key of the responder.
	ResponderPubkey []byte `protobuf:"bytes,3,opt,name=responder_pubkey,json=responderPubkey,proto3" json:"responderPubkey,omitempty"`
	// Signature is the responder's signature over this message (without this field).
	Signature *peer.Signature `protobuf:"bytes,4,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

SOJoinResponse is a signed response from an invitee requesting to join.

func (*SOJoinResponse) CloneMessageVT

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

func (*SOJoinResponse) CloneVT

func (m *SOJoinResponse) CloneVT() *SOJoinResponse

func (*SOJoinResponse) EqualMessageVT

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

func (*SOJoinResponse) EqualVT

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

func (*SOJoinResponse) GetInviteId

func (x *SOJoinResponse) GetInviteId() string

func (*SOJoinResponse) GetResponderPeerId

func (x *SOJoinResponse) GetResponderPeerId() string

func (*SOJoinResponse) GetResponderPubkey

func (x *SOJoinResponse) GetResponderPubkey() []byte

func (*SOJoinResponse) GetSignature

func (x *SOJoinResponse) GetSignature() *peer.Signature

func (*SOJoinResponse) MarshalJSON

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

MarshalJSON marshals the SOJoinResponse to JSON.

func (*SOJoinResponse) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOJoinResponse message to JSON.

func (*SOJoinResponse) MarshalProtoText

func (x *SOJoinResponse) MarshalProtoText() string

func (*SOJoinResponse) MarshalToSizedBufferVT

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

func (*SOJoinResponse) MarshalToVT

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

func (*SOJoinResponse) MarshalVT

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

func (*SOJoinResponse) ProtoMessage

func (*SOJoinResponse) ProtoMessage()

func (*SOJoinResponse) Reset

func (x *SOJoinResponse) Reset()

func (*SOJoinResponse) SizeVT

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

func (*SOJoinResponse) String

func (x *SOJoinResponse) String() string

func (*SOJoinResponse) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOJoinResponse from JSON.

func (*SOJoinResponse) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOJoinResponse message from JSON.

func (*SOJoinResponse) UnmarshalVT

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

type SOKeyEpoch

type SOKeyEpoch struct {

	// Epoch is the epoch number (0-based, increments on rotation).
	Epoch uint64 `protobuf:"varint,1,opt,name=epoch,proto3" json:"epoch,omitempty"`
	// Grants are the key encrypted to each reader of this epoch. Each grant is
	// signed by an owner, a voter under group control, or its recipient.
	Grants []*SOGrant `protobuf:"bytes,2,rep,name=grants,proto3" json:"grants,omitempty"`
	// ConfigChainSeqno is the config chain sequence number under which the
	// epoch was created. A reader removed at a later sequence number still holds
	// this epoch's key, so the next epoch must replace it.
	ConfigChainSeqno uint64 `protobuf:"varint,3,opt,name=config_chain_seqno,json=configChainSeqno,proto3" json:"configChainSeqno,omitempty"`
	// contains filtered or unexported fields
}

SOKeyEpoch is one encryption key of a shared object. A key rotation starts the next epoch; operations and checkpoints name the epoch they used.

func RotateTransformKey

func RotateTransformKey(
	privKey crypto.PrivKey,
	sharedObjectID string,
	participants []*SOParticipantConfig,
	currentEpoch uint64,
	configSeqno uint64,
) (*block_transform.Config, *SOKeyEpoch, error)

RotateTransformKey generates a new transform key and grants it to every reader in participants as the key epoch after currentEpoch. The caller, an owner or a voter under group control, signs the grants with privKey, passes the participants that remain after a revocation and records the config the epoch was created under.

func (*SOKeyEpoch) CloneMessageVT

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

func (*SOKeyEpoch) CloneVT

func (m *SOKeyEpoch) CloneVT() *SOKeyEpoch

func (*SOKeyEpoch) EqualMessageVT

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

func (*SOKeyEpoch) EqualVT

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

func (*SOKeyEpoch) FindGrant

func (e *SOKeyEpoch) FindGrant(peerID string) *SOGrant

FindGrant returns the grant of peerID in the epoch, or nil.

func (*SOKeyEpoch) GetConfigChainSeqno

func (x *SOKeyEpoch) GetConfigChainSeqno() uint64

func (*SOKeyEpoch) GetEpoch

func (x *SOKeyEpoch) GetEpoch() uint64

func (*SOKeyEpoch) GetGrants

func (x *SOKeyEpoch) GetGrants() []*SOGrant

func (*SOKeyEpoch) MarshalJSON

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

MarshalJSON marshals the SOKeyEpoch to JSON.

func (*SOKeyEpoch) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOKeyEpoch message to JSON.

func (*SOKeyEpoch) MarshalProtoText

func (x *SOKeyEpoch) MarshalProtoText() string

func (*SOKeyEpoch) MarshalToSizedBufferVT

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

func (*SOKeyEpoch) MarshalToVT

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

func (*SOKeyEpoch) MarshalVT

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

func (*SOKeyEpoch) ProtoMessage

func (*SOKeyEpoch) ProtoMessage()

func (*SOKeyEpoch) Reset

func (x *SOKeyEpoch) Reset()

func (*SOKeyEpoch) SizeVT

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

func (*SOKeyEpoch) String

func (x *SOKeyEpoch) String() string

func (*SOKeyEpoch) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOKeyEpoch from JSON.

func (*SOKeyEpoch) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOKeyEpoch message from JSON.

func (*SOKeyEpoch) UnmarshalVT

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

type SOLeaveRequest

type SOLeaveRequest struct {

	// SharedObjectId is the external shared object whose participation is relinquished.
	SharedObjectId string `protobuf:"bytes,1,opt,name=shared_object_id,json=sharedObjectId,proto3" json:"sharedObjectId,omitempty"`
	// ConfigHash binds consent to held authority so an old request cannot undo a later rejoin.
	ConfigHash []byte `protobuf:"bytes,2,opt,name=config_hash,json=configHash,proto3" json:"configHash,omitempty"`
	// Signatures prove each departing identity; each signs this message with Signatures cleared.
	Signatures []*peer.Signature `protobuf:"bytes,3,rep,name=signatures,proto3" json:"signatures,omitempty"`
	// contains filtered or unexported fields
}

SOLeaveRequest relinquishes only the identities that sign this exact object and configuration head.

func BuildSOLeaveRequest

func BuildSOLeaveRequest(sharedObjectID string, configHash []byte, keys ...crypto.PrivKey) (*SOLeaveRequest, error)

BuildSOLeaveRequest signs consent to remove each supplied identity at one held configuration.

func (*SOLeaveRequest) CloneMessageVT

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

func (*SOLeaveRequest) CloneVT

func (m *SOLeaveRequest) CloneVT() *SOLeaveRequest

func (*SOLeaveRequest) EqualMessageVT

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

func (*SOLeaveRequest) EqualVT

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

func (*SOLeaveRequest) GetConfigHash

func (x *SOLeaveRequest) GetConfigHash() []byte

func (*SOLeaveRequest) GetSharedObjectId

func (x *SOLeaveRequest) GetSharedObjectId() string

func (*SOLeaveRequest) GetSignatures

func (x *SOLeaveRequest) GetSignatures() []*peer.Signature

func (*SOLeaveRequest) MarshalJSON

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

MarshalJSON marshals the SOLeaveRequest to JSON.

func (*SOLeaveRequest) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOLeaveRequest message to JSON.

func (*SOLeaveRequest) MarshalProtoText

func (x *SOLeaveRequest) MarshalProtoText() string

func (*SOLeaveRequest) MarshalToSizedBufferVT

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

func (*SOLeaveRequest) MarshalToVT

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

func (*SOLeaveRequest) MarshalVT

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

func (*SOLeaveRequest) ProtoMessage

func (*SOLeaveRequest) ProtoMessage()

func (*SOLeaveRequest) Reset

func (x *SOLeaveRequest) Reset()

func (*SOLeaveRequest) SizeVT

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

func (*SOLeaveRequest) String

func (x *SOLeaveRequest) String() string

func (*SOLeaveRequest) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOLeaveRequest from JSON.

func (*SOLeaveRequest) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOLeaveRequest message from JSON.

func (*SOLeaveRequest) UnmarshalVT

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

func (*SOLeaveRequest) Verify

func (r *SOLeaveRequest) Verify() ([]string, error)

Verify authenticates departing identities without conferring authority over another participant.

type SOLeaveResponse

type SOLeaveResponse struct {

	// Changes is the signed configuration suffix from the request head through the first completed removal.
	Changes []*SOConfigChange `protobuf:"bytes,1,rep,name=changes,proto3" json:"changes,omitempty"`
	// contains filtered or unexported fields
}

SOLeaveResponse proves the owner committed removal, without returning channel data or root grants.

func LeaveSOParticipants

func LeaveSOParticipants(ctx context.Context, host *SOHost, owner crypto.PrivKey, request *SOLeaveRequest) (*SOLeaveResponse, error)

LeaveSOParticipants commits a proven voluntary removal under the owner's existing signing authority. The committing owner re-signs the departed peers' proofs, so it must remain while anyone remains. Retries return only the original removal proof; an old request cannot remove a rejoined participant.

func (*SOLeaveResponse) CloneMessageVT

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

func (*SOLeaveResponse) CloneVT

func (m *SOLeaveResponse) CloneVT() *SOLeaveResponse

func (*SOLeaveResponse) EqualMessageVT

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

func (*SOLeaveResponse) EqualVT

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

func (*SOLeaveResponse) GetChanges

func (x *SOLeaveResponse) GetChanges() []*SOConfigChange

func (*SOLeaveResponse) MarshalJSON

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

MarshalJSON marshals the SOLeaveResponse to JSON.

func (*SOLeaveResponse) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOLeaveResponse message to JSON.

func (*SOLeaveResponse) MarshalProtoText

func (x *SOLeaveResponse) MarshalProtoText() string

func (*SOLeaveResponse) MarshalToSizedBufferVT

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

func (*SOLeaveResponse) MarshalToVT

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

func (*SOLeaveResponse) MarshalVT

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

func (*SOLeaveResponse) ProtoMessage

func (*SOLeaveResponse) ProtoMessage()

func (*SOLeaveResponse) Reset

func (x *SOLeaveResponse) Reset()

func (*SOLeaveResponse) SizeVT

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

func (*SOLeaveResponse) String

func (x *SOLeaveResponse) String() string

func (*SOLeaveResponse) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOLeaveResponse from JSON.

func (*SOLeaveResponse) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOLeaveResponse message from JSON.

func (*SOLeaveResponse) UnmarshalVT

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

type SOOperation

type SOOperation struct {

	// Inner is the encoded SOOperationInner object.
	Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"`
	// Signature is the signature of inner.
	// The signature public key must match the participant's peer_id.
	Signature *peer.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

SOOperation represents an individual operation submitted by a participant.

func BuildSOOperation

func BuildSOOperation(
	sharedObjectID string,
	privKey crypto.PrivKey,
	opDataEnc []byte,
	link *SOOperationLink,
	opLocalID string,
) (*SOOperation, error)

BuildSOOperation signs a new operation by the author of privKey. opDataEnc should be opData encoded with the key of link.KeyEpoch.

func (*SOOperation) CloneMessageVT

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

func (*SOOperation) CloneVT

func (m *SOOperation) CloneVT() *SOOperation

func (*SOOperation) EqualMessageVT

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

func (*SOOperation) EqualVT

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

func (*SOOperation) GetInner

func (x *SOOperation) GetInner() []byte

func (*SOOperation) GetSignature

func (x *SOOperation) GetSignature() *peer.Signature

func (*SOOperation) Hash

func (op *SOOperation) Hash() []byte

Hash returns the identity of the operation.

func (*SOOperation) MarshalJSON

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

MarshalJSON marshals the SOOperation to JSON.

func (*SOOperation) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOOperation message to JSON.

func (*SOOperation) MarshalProtoText

func (x *SOOperation) MarshalProtoText() string

func (*SOOperation) MarshalToSizedBufferVT

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

func (*SOOperation) MarshalToVT

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

func (*SOOperation) MarshalVT

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

func (*SOOperation) ProtoMessage

func (*SOOperation) ProtoMessage()

func (*SOOperation) Reset

func (x *SOOperation) Reset()

func (*SOOperation) SizeVT

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

func (*SOOperation) String

func (x *SOOperation) String() string

func (*SOOperation) UnmarshalInner

func (op *SOOperation) UnmarshalInner() (*SOOperationInner, error)

UnmarshalInner unmarshals and verifies the SOOperationInner.

func (*SOOperation) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOOperation from JSON.

func (*SOOperation) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOOperation message from JSON.

func (*SOOperation) UnmarshalVT

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

func (*SOOperation) Validate

func (op *SOOperation) Validate() error

Validate performs cursory checks on the SOOperation.

func (*SOOperation) ValidateSignature

func (op *SOOperation) ValidateSignature(sharedObjectID string, participants []*SOParticipantConfig) error

ValidateSignature authenticates the operation and checks that its author may write operations under participants.

func (*SOOperation) Verify

func (op *SOOperation) Verify(sharedObjectID string) (*SOOperationInner, error)

Verify authenticates the operation as written for sharedObjectID by the author it names, and returns its body. It does not check authorization.

type SOOperationInner

type SOOperationInner struct {

	// PeerId is the identifier of the author.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// LocalId is the locally-assigned ulid for the operation.
	// Must be a valid ulid.
	// Must be lower-case.
	LocalId string `protobuf:"bytes,2,opt,name=local_id,json=localId,proto3" json:"localId,omitempty"`
	// Nonce is the author sequence: 1 for the author's first operation,
	// then one more than the operation named by prev_op_hash.
	Nonce uint64 `protobuf:"varint,3,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// OpData is the operation data, encrypted with the key of key_epoch.
	// Empty for an acknowledgment, which applies nothing and records that its
	// author has built on every operation it names.
	OpData []byte `protobuf:"bytes,4,opt,name=op_data,json=opData,proto3" json:"opData,omitempty"`
	// SharedObjectId binds the operation to one shared object.
	SharedObjectId string `protobuf:"bytes,5,opt,name=shared_object_id,json=sharedObjectId,proto3" json:"sharedObjectId,omitempty"`
	// ProtocolVersion is the operation format version.
	ProtocolVersion uint32 `protobuf:"varint,6,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocolVersion,omitempty"`
	// PrevOpHash is the hash of the author's previous operation.
	// Empty only when nonce is 1.
	PrevOpHash []byte `protobuf:"bytes,7,opt,name=prev_op_hash,json=prevOpHash,proto3" json:"prevOpHash,omitempty"`
	// Parents are the other heads the author knew, sorted by op_hash. Excludes
	// the previous operation. A parent's position lets every member tell a
	// parent its checkpoint covers from one it has not received yet.
	Parents []*SOOperationPosition `protobuf:"bytes,8,rep,name=parents,proto3" json:"parents,omitempty"`
	// ConfigHash is the config chain hash the operation was written under.
	ConfigHash []byte `protobuf:"bytes,9,opt,name=config_hash,json=configHash,proto3" json:"configHash,omitempty"`
	// KeyEpoch is the key epoch whose key encrypted op_data.
	KeyEpoch uint64 `protobuf:"varint,10,opt,name=key_epoch,json=keyEpoch,proto3" json:"keyEpoch,omitempty"`
	// contains filtered or unexported fields
}

SOOperationInner is the signed body of an operation: one step in its author's chain and one node of the shared object's operation DAG. The operation's identity is the hash of this encoded body.

func (*SOOperationInner) CloneMessageVT

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

func (*SOOperationInner) CloneVT

func (m *SOOperationInner) CloneVT() *SOOperationInner

func (*SOOperationInner) EqualMessageVT

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

func (*SOOperationInner) EqualVT

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

func (*SOOperationInner) GetConfigHash

func (x *SOOperationInner) GetConfigHash() []byte

func (*SOOperationInner) GetKeyEpoch

func (x *SOOperationInner) GetKeyEpoch() uint64

func (*SOOperationInner) GetLocalId

func (x *SOOperationInner) GetLocalId() string

func (*SOOperationInner) GetNonce

func (x *SOOperationInner) GetNonce() uint64

func (*SOOperationInner) GetOpData

func (x *SOOperationInner) GetOpData() []byte

func (*SOOperationInner) GetParents

func (x *SOOperationInner) GetParents() []*SOOperationPosition

func (*SOOperationInner) GetPeerId

func (x *SOOperationInner) GetPeerId() string

func (*SOOperationInner) GetPrevOpHash

func (x *SOOperationInner) GetPrevOpHash() []byte

func (*SOOperationInner) GetProtocolVersion

func (x *SOOperationInner) GetProtocolVersion() uint32

func (*SOOperationInner) GetSharedObjectId

func (x *SOOperationInner) GetSharedObjectId() string

func (*SOOperationInner) IsAcknowledgment

func (i *SOOperationInner) IsAcknowledgment() bool

IsAcknowledgment reports whether the operation is an acknowledgment: it applies nothing and records that its author has built on every operation it names.

func (*SOOperationInner) MarshalJSON

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

MarshalJSON marshals the SOOperationInner to JSON.

func (*SOOperationInner) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOOperationInner message to JSON.

func (*SOOperationInner) MarshalProtoText

func (x *SOOperationInner) MarshalProtoText() string

func (*SOOperationInner) MarshalToSizedBufferVT

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

func (*SOOperationInner) MarshalToVT

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

func (*SOOperationInner) MarshalVT

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

func (*SOOperationInner) ParsePeerID

func (i *SOOperationInner) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID.

func (*SOOperationInner) ProtoMessage

func (*SOOperationInner) ProtoMessage()

func (*SOOperationInner) Reset

func (x *SOOperationInner) Reset()

func (*SOOperationInner) SizeVT

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

func (*SOOperationInner) String

func (x *SOOperationInner) String() string

func (*SOOperationInner) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOOperationInner from JSON.

func (*SOOperationInner) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOOperationInner message from JSON.

func (*SOOperationInner) UnmarshalVT

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

func (*SOOperationInner) Validate

func (i *SOOperationInner) Validate() error

Validate performs cursory checks on the SOOperationInner.

type SOOperationLink struct {
	// Nonce is the author sequence of the new operation.
	Nonce uint64
	// PrevOpHash is the hash of the author's previous operation, empty when Nonce is 1.
	PrevOpHash []byte
	// Parents are the other heads the author knows.
	Parents []*SOOperationPosition
	// ConfigHash is the config chain hash the operation is written under.
	ConfigHash []byte
	// KeyEpoch is the key epoch whose key encrypts the operation data.
	KeyEpoch uint64
}

SOOperationLink places a new operation in its author's chain and in the operation DAG.

type SOOperationPosition

type SOOperationPosition struct {

	// PeerId is the author.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// Nonce is the author sequence of the operation.
	Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// OpHash is the hash of the operation.
	OpHash []byte `protobuf:"bytes,3,opt,name=op_hash,json=opHash,proto3" json:"opHash,omitempty"`
	// contains filtered or unexported fields
}

SOOperationPosition is an operation at one position of its author's chain.

func (*SOOperationPosition) CloneMessageVT

func (*SOOperationPosition) CloneVT

func (*SOOperationPosition) EqualMessageVT

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

func (*SOOperationPosition) EqualVT

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

func (*SOOperationPosition) GetNonce

func (x *SOOperationPosition) GetNonce() uint64

func (*SOOperationPosition) GetOpHash

func (x *SOOperationPosition) GetOpHash() []byte

func (*SOOperationPosition) GetPeerId

func (x *SOOperationPosition) GetPeerId() string

func (*SOOperationPosition) MarshalJSON

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

MarshalJSON marshals the SOOperationPosition to JSON.

func (*SOOperationPosition) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOOperationPosition message to JSON.

func (*SOOperationPosition) MarshalProtoText

func (x *SOOperationPosition) MarshalProtoText() string

func (*SOOperationPosition) MarshalToSizedBufferVT

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

func (*SOOperationPosition) MarshalToVT

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

func (*SOOperationPosition) MarshalVT

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

func (*SOOperationPosition) ProtoMessage

func (*SOOperationPosition) ProtoMessage()

func (*SOOperationPosition) Reset

func (x *SOOperationPosition) Reset()

func (*SOOperationPosition) SizeVT

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

func (*SOOperationPosition) String

func (x *SOOperationPosition) String() string

func (*SOOperationPosition) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOOperationPosition from JSON.

func (*SOOperationPosition) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOOperationPosition message from JSON.

func (*SOOperationPosition) UnmarshalVT

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

type SOOperationRef

type SOOperationRef struct {

	// PeerId is the identifier of the participant submitting the operation.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// Nonce is the nonce for the operation.
	Nonce uint64 `protobuf:"varint,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// contains filtered or unexported fields
}

SOOperationRef is a reference to an operation that was queued.

func (*SOOperationRef) CloneMessageVT

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

func (*SOOperationRef) CloneVT

func (m *SOOperationRef) CloneVT() *SOOperationRef

func (*SOOperationRef) EqualMessageVT

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

func (*SOOperationRef) EqualVT

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

func (*SOOperationRef) GetNonce

func (x *SOOperationRef) GetNonce() uint64

func (*SOOperationRef) GetPeerId

func (x *SOOperationRef) GetPeerId() string

func (*SOOperationRef) MarshalJSON

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

MarshalJSON marshals the SOOperationRef to JSON.

func (*SOOperationRef) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOOperationRef message to JSON.

func (*SOOperationRef) MarshalProtoText

func (x *SOOperationRef) MarshalProtoText() string

func (*SOOperationRef) MarshalToSizedBufferVT

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

func (*SOOperationRef) MarshalToVT

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

func (*SOOperationRef) MarshalVT

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

func (*SOOperationRef) ParsePeerID

func (r *SOOperationRef) ParsePeerID() (peer.ID, error)

ParsePeerID parses the peer ID.

func (*SOOperationRef) ProtoMessage

func (*SOOperationRef) ProtoMessage()

func (*SOOperationRef) Reset

func (x *SOOperationRef) Reset()

func (*SOOperationRef) SizeVT

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

func (*SOOperationRef) String

func (x *SOOperationRef) String() string

func (*SOOperationRef) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOOperationRef from JSON.

func (*SOOperationRef) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOOperationRef message from JSON.

func (*SOOperationRef) UnmarshalVT

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

func (*SOOperationRef) Validate

func (r *SOOperationRef) Validate() error

Validate validates the SOOperationRef.

type SOOperationRejectionErrorDetails

type SOOperationRejectionErrorDetails struct {

	// ErrorMsg is the error message.
	ErrorMsg string `protobuf:"bytes,1,opt,name=error_msg,json=errorMsg,proto3" json:"errorMsg,omitempty"`
	// MissingBlock is set when replay found a block the operation needs in no
	// store. The submitter may store its blocks again and resubmit.
	MissingBlock bool `protobuf:"varint,2,opt,name=missing_block,json=missingBlock,proto3" json:"missingBlock,omitempty"`
	// contains filtered or unexported fields
}

SOOperationRejectionErrorDetails contains error details.

func (*SOOperationRejectionErrorDetails) CloneMessageVT

func (*SOOperationRejectionErrorDetails) CloneVT

func (*SOOperationRejectionErrorDetails) EqualMessageVT

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

func (*SOOperationRejectionErrorDetails) EqualVT

func (*SOOperationRejectionErrorDetails) GetErrorMsg

func (x *SOOperationRejectionErrorDetails) GetErrorMsg() string

func (*SOOperationRejectionErrorDetails) GetMissingBlock

func (x *SOOperationRejectionErrorDetails) GetMissingBlock() bool

func (*SOOperationRejectionErrorDetails) MarshalJSON

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

MarshalJSON marshals the SOOperationRejectionErrorDetails to JSON.

func (*SOOperationRejectionErrorDetails) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOOperationRejectionErrorDetails message to JSON.

func (*SOOperationRejectionErrorDetails) MarshalProtoText

func (x *SOOperationRejectionErrorDetails) MarshalProtoText() string

func (*SOOperationRejectionErrorDetails) MarshalToSizedBufferVT

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

func (*SOOperationRejectionErrorDetails) MarshalToVT

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

func (*SOOperationRejectionErrorDetails) MarshalVT

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

func (*SOOperationRejectionErrorDetails) ProtoMessage

func (*SOOperationRejectionErrorDetails) ProtoMessage()

func (*SOOperationRejectionErrorDetails) Reset

func (*SOOperationRejectionErrorDetails) SizeVT

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

func (*SOOperationRejectionErrorDetails) String

func (*SOOperationRejectionErrorDetails) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOOperationRejectionErrorDetails from JSON.

func (*SOOperationRejectionErrorDetails) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOOperationRejectionErrorDetails message from JSON.

func (*SOOperationRejectionErrorDetails) UnmarshalVT

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

type SOOperationResult

type SOOperationResult struct {

	// OpRef is the operation reference.
	OpRef *SOOperationRef `protobuf:"bytes,1,opt,name=op_ref,json=opRef,proto3" json:"opRef,omitempty"`
	// Body is the body of the result.
	//
	// Types that are assignable to Body:
	//	*SOOperationResult_Success
	//	*SOOperationResult_ErrorDetails
	Body isSOOperationResult_Body `protobuf_oneof:"body"`
	// contains filtered or unexported fields
}

SOOperationResult is the result of applying an operation.

func BuildSOOperationResult

func BuildSOOperationResult(
	peerID string,
	nonce uint64,
	success bool,
	errorDetails *SOOperationRejectionErrorDetails,
) *SOOperationResult

BuildSOOperationResult constructs a new SOOperationResult. If success is false, errorDetails must be non-nil.

func (*SOOperationResult) CloneMessageVT

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

func (*SOOperationResult) CloneVT

func (m *SOOperationResult) CloneVT() *SOOperationResult

func (*SOOperationResult) EqualMessageVT

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

func (*SOOperationResult) EqualVT

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

func (*SOOperationResult) GetBody

func (m *SOOperationResult) GetBody() isSOOperationResult_Body

func (*SOOperationResult) GetErrorDetails

func (*SOOperationResult) GetOpRef

func (x *SOOperationResult) GetOpRef() *SOOperationRef

func (*SOOperationResult) GetSuccess

func (x *SOOperationResult) GetSuccess() bool

func (*SOOperationResult) MarshalJSON

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

MarshalJSON marshals the SOOperationResult to JSON.

func (*SOOperationResult) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOOperationResult message to JSON.

func (*SOOperationResult) MarshalProtoText

func (x *SOOperationResult) MarshalProtoText() string

func (*SOOperationResult) MarshalToSizedBufferVT

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

func (*SOOperationResult) MarshalToVT

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

func (*SOOperationResult) MarshalVT

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

func (*SOOperationResult) ProtoMessage

func (*SOOperationResult) ProtoMessage()

func (*SOOperationResult) Reset

func (x *SOOperationResult) Reset()

func (*SOOperationResult) SizeVT

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

func (*SOOperationResult) String

func (x *SOOperationResult) String() string

func (*SOOperationResult) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOOperationResult from JSON.

func (*SOOperationResult) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOOperationResult message from JSON.

func (*SOOperationResult) UnmarshalVT

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

type SOOperationResult_ErrorDetails

type SOOperationResult_ErrorDetails struct {
	// ErrorDetails contains the rejection error details.
	ErrorDetails *SOOperationRejectionErrorDetails `protobuf:"bytes,3,opt,name=error_details,json=errorDetails,proto3,oneof"`
}

func (*SOOperationResult_ErrorDetails) CloneOneofVT

func (m *SOOperationResult_ErrorDetails) CloneOneofVT() isSOOperationResult_Body

func (*SOOperationResult_ErrorDetails) CloneVT

func (*SOOperationResult_ErrorDetails) EqualVT

func (this *SOOperationResult_ErrorDetails) EqualVT(thatIface isSOOperationResult_Body) bool

func (*SOOperationResult_ErrorDetails) MarshalToSizedBufferVT

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

func (*SOOperationResult_ErrorDetails) MarshalToVT

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

func (*SOOperationResult_ErrorDetails) SizeVT

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

type SOOperationResult_Success

type SOOperationResult_Success struct {
	// Success indicates the op was successful.
	Success bool `protobuf:"varint,2,opt,name=success,proto3,oneof"`
}

func (*SOOperationResult_Success) CloneOneofVT

func (m *SOOperationResult_Success) CloneOneofVT() isSOOperationResult_Body

func (*SOOperationResult_Success) CloneVT

func (*SOOperationResult_Success) EqualVT

func (this *SOOperationResult_Success) EqualVT(thatIface isSOOperationResult_Body) bool

func (*SOOperationResult_Success) MarshalToSizedBufferVT

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

func (*SOOperationResult_Success) MarshalToVT

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

func (*SOOperationResult_Success) SizeVT

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

type SOOperationSet

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

SOOperationSet is a set of verified operations of one shared object above its checkpoint. Adding operations in any order yields the same set, heads and evidence.

func NewSOOperationSet

func NewSOOperationSet(sharedObjectID string, checkpoint *SOCheckpointInner) *SOOperationSet

NewSOOperationSet returns an empty operation set for one shared object above checkpoint, which may be nil before the first checkpoint.

func (*SOOperationSet) Add

func (s *SOOperationSet) Add(op *SOOperation) (bool, error)

Add verifies op and adds it. It reports false when the set already holds it or the checkpoint covers it. An author's second operation at one sequence is kept as evidence.

func (*SOOperationSet) Ancestors

func (s *SOOperationSet) Ancestors(h []byte) map[string]struct{}

Ancestors returns the operations in the set that the operation with hash h descends from, through its author chain and its causal parents. Like Order, it does not follow a link to a position the checkpoint covers.

func (*SOOperationSet) AuthorHead

func (s *SOOperationSet) AuthorHead(peerID string) (uint64, []byte)

AuthorHead returns the nonce and hash of peerID's latest operation in the set or its checkpoint, or 0 and nil when it has written none.

func (*SOOperationSet) BuiltOnLatest

func (s *SOOperationSet) BuiltOnLatest(peerID, author string) bool

BuiltOnLatest reports whether peerID has built on author's latest operation: a placed operation of peerID descends from it, or author has none above the checkpoint and peerID has a placed operation.

func (*SOOperationSet) Covers

func (s *SOOperationSet) Covers(peerID string, nonce uint64) bool

Covers reports whether the checkpoint below the set covers the operation at nonce in peerID's chain.

func (*SOOperationSet) Equivocated

func (s *SOOperationSet) Equivocated(h []byte) bool

Equivocated reports whether the author of the operation with hash h signed another operation at the same sequence.

func (*SOOperationSet) Equivocations

func (s *SOOperationSet) Equivocations() []SOEquivocation

Equivocations returns every author sequence with more than one operation, ordered by author and sequence.

func (*SOOperationSet) Find

func (s *SOOperationSet) Find(peerID, localID string) []byte

Find returns the hash of peerID's operation with localID, or nil.

func (*SOOperationSet) Get

func (s *SOOperationSet) Get(h []byte) *SOOperationInner

Get returns the verified body of the operation with hash h, or nil.

func (*SOOperationSet) Heads

func (s *SOOperationSet) Heads() []*SOOperationPosition

Heads returns the operations in the set and the checkpoint's author heads that no operation in the set names, in hash order.

func (*SOOperationSet) Len

func (s *SOOperationSet) Len() int

Len returns the number of operations in the set.

func (*SOOperationSet) NeedsAcknowledgment

func (s *SOOperationSet) NeedsAcknowledgment(checkpointer, peerID string, lag int) bool

NeedsAcknowledgment reports whether the writer peerID should write an acknowledgment. A sequencer makes operations stable without them. Otherwise every head must be placed, so the acknowledgment it would write is placed too. It then acknowledges when at least lag placed edits are not below its own latest operations, or when it has not built on an acknowledgment of checkpointer, which asks every member to answer at once. Other acknowledgments ask nothing, so members never answer each other's answers.

func (*SOOperationSet) Order

func (s *SOOperationSet) Order() [][]byte

Order returns the replay order of the operations whose ancestry the set or its checkpoint holds. The sequenced operations come first, in sequence order. The rest follow in a topological order of the operation DAG with concurrent operations in byte order of their hashes. Every member holding the same operations and positions above the same checkpoint computes the same order. A link to a position the checkpoint covers is satisfied, even when the set holds an operation with its hash, so placement never depends on which other operations have arrived. An operation naming one the set lacks and the checkpoint does not cover waits, with its descendants, until the missing operation arrives. An operation that arrives after the checkpoint covered what it names, such as an edit from a device off the trimming roster, is placed above the checkpoint.

func (*SOOperationSet) SequenceHead

func (s *SOOperationSet) SequenceHead(prefix [][]byte) *SOSequenceHead

SequenceHead returns the last position a checkpoint covering prefix, a prefix of Order, covers: the last position before the first one whose operation is neither covered nor in prefix. It is the checkpoint's position when the prefix holds no sequenced operation.

func (*SOOperationSet) SequenceTail

func (s *SOOperationSet) SequenceTail() *SOSequenceHead

SequenceTail returns a copy of the last position of the resolved sequence, or of the checkpoint's position when the sequence holds none above it. It returns nil before the first position.

func (*SOOperationSet) StablePoint

func (s *SOOperationSet) StablePoint(roster []string) [][]byte

StablePoint returns the stable prefix of Order. While the sequence is open it is the sequenced prefix: the sequencer places every later operation after it. Otherwise it is the longest prefix whose operations every member of roster has built on. Each later operation of a roster member descends from every stable operation, so replay never places a new operation inside the stable prefix and a checkpoint may cover it. An empty roster makes the whole order stable.

func (*SOOperationSet) Unordered

func (s *SOOperationSet) Unordered() int

Unordered returns how many edits of the order the appointed sequencer has not placed. Acknowledgments are not edits and do not count. It is zero under Merge.

func (*SOOperationSet) UnplacedHeads

func (s *SOOperationSet) UnplacedHeads() []*SOOperationPosition

UnplacedHeads returns the heads that replay has not placed and the checkpoint does not cover, in hash order. Each waits for an operation it names that this set does not hold.

type SOParticipantConfig

type SOParticipantConfig struct {

	// PeerId is the string representation of this participant's peer id.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// Role is the general role of the participant.
	//
	// - READER: can read the value of the shared object only.
	// - WRITER: can also write operations.
	// - OWNER: can also change the config and sign checkpoints.
	Role SOParticipantRole `protobuf:"varint,2,opt,name=role,proto3" json:"role,omitempty"`
	// EntityId is the account ID of the entity that owns this participant's session.
	// Set when an owner adds a cloud participant. Empty for local-only participants.
	EntityId string `protobuf:"bytes,3,opt,name=entity_id,json=entityId,proto3" json:"entityId,omitempty"`
	// Username is the provider username of entity_id, recorded by the owner
	// who added the participant. A self-enrolled peer repeats the username
	// already recorded for its entity. Empty when entity_id is empty.
	Username string `protobuf:"bytes,4,opt,name=username,proto3" json:"username,omitempty"`
	// VotingWeight is this device's vote under group control. Zero does not
	// vote. Only writers and owners vote.
	VotingWeight uint32 `protobuf:"varint,5,opt,name=voting_weight,json=votingWeight,proto3" json:"votingWeight,omitempty"`
	// contains filtered or unexported fields
}

SOParticipantConfig contains a listing of an entity associated with a shared object. Each entity may only appear one time in the list.

func DefaultVotingWeights

func DefaultVotingWeights(participants []*SOParticipantConfig) []*SOParticipantConfig

DefaultVotingWeights returns participants with the voting weights group control starts with: one for the first device of each entity that can write, in participant order, and one for each writing device without an entity. Every other device does not vote. Votes are per device because each device keeps its own locks.

func PrepareReplayOp

PrepareReplayOp authorizes the author of inner under the config the operation names, requires the current config to admit it, and decodes its data with the key of its epoch. It returns the author's participant entry and the decoded data, or the reason replay rejects the operation. A config or key the member lacks is an error, not a rejection.

func (*SOParticipantConfig) CloneMessageVT

func (*SOParticipantConfig) CloneVT

func (*SOParticipantConfig) EqualMessageVT

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

func (*SOParticipantConfig) EqualVT

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

func (*SOParticipantConfig) GetEntityId

func (x *SOParticipantConfig) GetEntityId() string

func (*SOParticipantConfig) GetPeerId

func (x *SOParticipantConfig) GetPeerId() string

func (*SOParticipantConfig) GetRole

func (*SOParticipantConfig) GetUsername

func (x *SOParticipantConfig) GetUsername() string

func (*SOParticipantConfig) GetVotingWeight

func (x *SOParticipantConfig) GetVotingWeight() uint32

func (*SOParticipantConfig) MarshalJSON

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

MarshalJSON marshals the SOParticipantConfig to JSON.

func (*SOParticipantConfig) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOParticipantConfig message to JSON.

func (*SOParticipantConfig) MarshalProtoText

func (x *SOParticipantConfig) MarshalProtoText() string

func (*SOParticipantConfig) MarshalToSizedBufferVT

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

func (*SOParticipantConfig) MarshalToVT

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

func (*SOParticipantConfig) MarshalVT

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

func (*SOParticipantConfig) ParsePeerID

func (p *SOParticipantConfig) ParsePeerID() (peer.ID, error)

ParsePeerID parses the participant peer ID.

func (*SOParticipantConfig) ProtoMessage

func (*SOParticipantConfig) ProtoMessage()

func (*SOParticipantConfig) Reset

func (x *SOParticipantConfig) Reset()

func (*SOParticipantConfig) SizeVT

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

func (*SOParticipantConfig) String

func (x *SOParticipantConfig) String() string

func (*SOParticipantConfig) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOParticipantConfig from JSON.

func (*SOParticipantConfig) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOParticipantConfig message from JSON.

func (*SOParticipantConfig) UnmarshalVT

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

func (*SOParticipantConfig) Validate

func (p *SOParticipantConfig) Validate() error

Validate performs cursory checks on the SOParticipant.

type SOParticipantRole

type SOParticipantRole int32

SOParticipantRole defines the general role of a shared object participant. In order of least permissive to most permissive.

const (
	// SOParticipantRole_UNKNOWN is the zero / invalid / unknown type.
	SOParticipantRole_SOParticipantRole_UNKNOWN SOParticipantRole = 0
	// SOParticipantRole_READER can read the value of the shared object only.
	SOParticipantRole_SOParticipantRole_READER SOParticipantRole = 1
	// SOParticipantRole_WRITER can also write operations.
	SOParticipantRole_SOParticipantRole_WRITER SOParticipantRole = 2
	// SOParticipantRole_OWNER can modify config, manage participants and sign
	// checkpoints.
	SOParticipantRole_SOParticipantRole_OWNER SOParticipantRole = 3
)

func MaxSOParticipantRole added in v0.51.7

func MaxSOParticipantRole(a, b SOParticipantRole) SOParticipantRole

MaxSOParticipantRole returns the higher-privilege participant role.

func (SOParticipantRole) Enum

func (SOParticipantRole) MarshalJSON

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

MarshalJSON marshals the SOParticipantRole to JSON.

func (SOParticipantRole) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOParticipantRole to JSON.

func (SOParticipantRole) MarshalProtoText

func (x SOParticipantRole) MarshalProtoText() string

func (SOParticipantRole) MarshalText

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

MarshalText marshals the SOParticipantRole to text.

func (SOParticipantRole) String

func (x SOParticipantRole) String() string

func (*SOParticipantRole) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOParticipantRole from JSON.

func (*SOParticipantRole) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOParticipantRole from JSON.

func (*SOParticipantRole) UnmarshalText

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

UnmarshalText unmarshals the SOParticipantRole from text.

type SORejectedEdit

type SORejectedEdit struct {

	// OpHash identifies the operation.
	OpHash []byte `protobuf:"bytes,1,opt,name=op_hash,json=opHash,proto3" json:"opHash,omitempty"`
	// Reason says in plain words why the operation did not apply.
	Reason string `protobuf:"bytes,2,opt,name=reason,proto3" json:"reason,omitempty"`
	// LostToPeerIds lists the authors of the applied operations that were
	// written concurrently and replay before it, sorted.
	LostToPeerIds []string `protobuf:"bytes,3,rep,name=lost_to_peer_ids,json=lostToPeerIds,proto3" json:"lostToPeerIds,omitempty"`
	// contains filtered or unexported fields
}

SORejectedEdit is an operation of this device that replay no longer applies.

func (*SORejectedEdit) CloneMessageVT

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

func (*SORejectedEdit) CloneVT

func (m *SORejectedEdit) CloneVT() *SORejectedEdit

func (*SORejectedEdit) EqualMessageVT

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

func (*SORejectedEdit) EqualVT

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

func (*SORejectedEdit) GetLostToPeerIds

func (x *SORejectedEdit) GetLostToPeerIds() []string

func (*SORejectedEdit) GetOpHash

func (x *SORejectedEdit) GetOpHash() []byte

func (*SORejectedEdit) GetReason

func (x *SORejectedEdit) GetReason() string

func (*SORejectedEdit) MarshalJSON

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

MarshalJSON marshals the SORejectedEdit to JSON.

func (*SORejectedEdit) MarshalProtoJSON

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

MarshalProtoJSON marshals the SORejectedEdit message to JSON.

func (*SORejectedEdit) MarshalProtoText

func (x *SORejectedEdit) MarshalProtoText() string

func (*SORejectedEdit) MarshalToSizedBufferVT

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

func (*SORejectedEdit) MarshalToVT

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

func (*SORejectedEdit) MarshalVT

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

func (*SORejectedEdit) ProtoMessage

func (*SORejectedEdit) ProtoMessage()

func (*SORejectedEdit) Reset

func (x *SORejectedEdit) Reset()

func (*SORejectedEdit) SizeVT

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

func (*SORejectedEdit) String

func (x *SORejectedEdit) String() string

func (*SORejectedEdit) UnmarshalJSON

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

UnmarshalJSON unmarshals the SORejectedEdit from JSON.

func (*SORejectedEdit) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SORejectedEdit message from JSON.

func (*SORejectedEdit) UnmarshalVT

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

type SORevocationInfo

type SORevocationInfo struct {

	// Reason is the reason for the revocation.
	Reason SORevocationReason `protobuf:"varint,1,opt,name=reason,proto3" json:"reason,omitempty"`
	// Timestamp is when the revocation occurred.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// Nonce is a unique value to prevent replay of revocation entries.
	Nonce uint64 `protobuf:"varint,3,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// LeaveRequestHash identifies the exact signed consent acknowledged by this removal.
	LeaveRequestHash []byte `protobuf:"bytes,4,opt,name=leave_request_hash,json=leaveRequestHash,proto3" json:"leaveRequestHash,omitempty"`
	// contains filtered or unexported fields
}

SORevocationInfo contains metadata about why a participant was removed.

func (*SORevocationInfo) CloneMessageVT

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

func (*SORevocationInfo) CloneVT

func (m *SORevocationInfo) CloneVT() *SORevocationInfo

func (*SORevocationInfo) EqualMessageVT

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

func (*SORevocationInfo) EqualVT

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

func (*SORevocationInfo) GetLeaveRequestHash

func (x *SORevocationInfo) GetLeaveRequestHash() []byte

func (*SORevocationInfo) GetNonce

func (x *SORevocationInfo) GetNonce() uint64

func (*SORevocationInfo) GetReason

func (x *SORevocationInfo) GetReason() SORevocationReason

func (*SORevocationInfo) GetTimestamp

func (x *SORevocationInfo) GetTimestamp() *timestamppb.Timestamp

func (*SORevocationInfo) MarshalJSON

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

MarshalJSON marshals the SORevocationInfo to JSON.

func (*SORevocationInfo) MarshalProtoJSON

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

MarshalProtoJSON marshals the SORevocationInfo message to JSON.

func (*SORevocationInfo) MarshalProtoText

func (x *SORevocationInfo) MarshalProtoText() string

func (*SORevocationInfo) MarshalToSizedBufferVT

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

func (*SORevocationInfo) MarshalToVT

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

func (*SORevocationInfo) MarshalVT

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

func (*SORevocationInfo) ProtoMessage

func (*SORevocationInfo) ProtoMessage()

func (*SORevocationInfo) Reset

func (x *SORevocationInfo) Reset()

func (*SORevocationInfo) SizeVT

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

func (*SORevocationInfo) String

func (x *SORevocationInfo) String() string

func (*SORevocationInfo) UnmarshalJSON

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

UnmarshalJSON unmarshals the SORevocationInfo from JSON.

func (*SORevocationInfo) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SORevocationInfo message from JSON.

func (*SORevocationInfo) UnmarshalVT

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

type SORevocationReason

type SORevocationReason int32

SORevocationReason describes why a participant was removed.

const (
	// SO_REVOCATION_REASON_UNKNOWN is the zero value.
	SORevocationReason_SO_REVOCATION_REASON_UNKNOWN SORevocationReason = 0
	// SO_REVOCATION_REASON_SESSION_REVOKED indicates the participant's session was revoked.
	SORevocationReason_SO_REVOCATION_REASON_SESSION_REVOKED SORevocationReason = 1
	// SO_REVOCATION_REASON_ORG_REMOVED indicates the participant was removed from the org.
	SORevocationReason_SO_REVOCATION_REASON_ORG_REMOVED SORevocationReason = 2
	// SO_REVOCATION_REASON_OWNER_REMOVED indicates the owner manually removed the participant.
	SORevocationReason_SO_REVOCATION_REASON_OWNER_REMOVED SORevocationReason = 3
	// SO_REVOCATION_REASON_INVITE_REVOKED indicates the participant's invite was revoked.
	SORevocationReason_SO_REVOCATION_REASON_INVITE_REVOKED SORevocationReason = 4
)

func (SORevocationReason) Enum

func (SORevocationReason) MarshalJSON

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

MarshalJSON marshals the SORevocationReason to JSON.

func (SORevocationReason) MarshalProtoJSON

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

MarshalProtoJSON marshals the SORevocationReason to JSON.

func (SORevocationReason) MarshalProtoText

func (x SORevocationReason) MarshalProtoText() string

func (SORevocationReason) MarshalText

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

MarshalText marshals the SORevocationReason to text.

func (SORevocationReason) String

func (x SORevocationReason) String() string

func (*SORevocationReason) UnmarshalJSON

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

UnmarshalJSON unmarshals the SORevocationReason from JSON.

func (*SORevocationReason) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SORevocationReason from JSON.

func (*SORevocationReason) UnmarshalText

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

UnmarshalText unmarshals the SORevocationReason from text.

type SOSequence

type SOSequence struct {

	// Inner is the encoded SOSequenceInner.
	Inner []byte `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"`
	// Signature is the sequencer's signature of inner.
	Signature *peer.Signature `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"`
	// contains filtered or unexported fields
}

SOSequence is one signed position of the sequence.

func BuildSOSequence

func BuildSOSequence(sharedObjectID string, privKey crypto.PrivKey, prev *SOSequenceHead, op *SOOperationPosition) (*SOSequence, error)

BuildSOSequence signs, as the sequencer of privKey, the position after prev that places op. prev is nil or height 0 before the first position.

func (*SOSequence) CloneMessageVT

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

func (*SOSequence) CloneVT

func (m *SOSequence) CloneVT() *SOSequence

func (*SOSequence) EqualMessageVT

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

func (*SOSequence) EqualVT

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

func (*SOSequence) GetInner

func (x *SOSequence) GetInner() []byte

func (*SOSequence) GetSignature

func (x *SOSequence) GetSignature() *peer.Signature

func (*SOSequence) Hash

func (q *SOSequence) Hash() []byte

Hash returns the identity of the position.

func (*SOSequence) MarshalJSON

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

MarshalJSON marshals the SOSequence to JSON.

func (*SOSequence) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOSequence message to JSON.

func (*SOSequence) MarshalProtoText

func (x *SOSequence) MarshalProtoText() string

func (*SOSequence) MarshalToSizedBufferVT

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

func (*SOSequence) MarshalToVT

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

func (*SOSequence) MarshalVT

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

func (*SOSequence) ProtoMessage

func (*SOSequence) ProtoMessage()

func (*SOSequence) Reset

func (x *SOSequence) Reset()

func (*SOSequence) SizeVT

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

func (*SOSequence) String

func (x *SOSequence) String() string

func (*SOSequence) UnmarshalHeight

func (q *SOSequence) UnmarshalHeight() (uint64, error)

UnmarshalHeight decodes the position's height.

func (*SOSequence) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOSequence from JSON.

func (*SOSequence) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOSequence message from JSON.

func (*SOSequence) UnmarshalVT

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

func (*SOSequence) Verify

func (q *SOSequence) Verify(sharedObjectID string) (*SOSequenceInner, string, error)

Verify authenticates the position as signed for sharedObjectID, and returns its body and its signer. It does not check that the signer is the sequencer.

type SOSequenceHead

type SOSequenceHead struct {

	// Height is the position, counted from 1.
	Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
	// Hash is the identity of the position's signed record.
	Hash []byte `protobuf:"bytes,2,opt,name=hash,proto3" json:"hash,omitempty"`
	// contains filtered or unexported fields
}

SOSequenceHead names one position of the sequence.

func (*SOSequenceHead) CloneMessageVT

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

func (*SOSequenceHead) CloneVT

func (m *SOSequenceHead) CloneVT() *SOSequenceHead

func (*SOSequenceHead) EqualMessageVT

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

func (*SOSequenceHead) EqualVT

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

func (*SOSequenceHead) GetHash

func (x *SOSequenceHead) GetHash() []byte

func (*SOSequenceHead) GetHeight

func (x *SOSequenceHead) GetHeight() uint64

func (*SOSequenceHead) MarshalJSON

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

MarshalJSON marshals the SOSequenceHead to JSON.

func (*SOSequenceHead) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOSequenceHead message to JSON.

func (*SOSequenceHead) MarshalProtoText

func (x *SOSequenceHead) MarshalProtoText() string

func (*SOSequenceHead) MarshalToSizedBufferVT

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

func (*SOSequenceHead) MarshalToVT

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

func (*SOSequenceHead) MarshalVT

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

func (*SOSequenceHead) ProtoMessage

func (*SOSequenceHead) ProtoMessage()

func (*SOSequenceHead) Reset

func (x *SOSequenceHead) Reset()

func (*SOSequenceHead) SizeVT

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

func (*SOSequenceHead) String

func (x *SOSequenceHead) String() string

func (*SOSequenceHead) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOSequenceHead from JSON.

func (*SOSequenceHead) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOSequenceHead message from JSON.

func (*SOSequenceHead) UnmarshalVT

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

type SOSequenceInner

type SOSequenceInner struct {

	// SharedObjectId binds the position to one shared object.
	SharedObjectId string `protobuf:"bytes,1,opt,name=shared_object_id,json=sharedObjectId,proto3" json:"sharedObjectId,omitempty"`
	// Height is one more than the previous position, 1 for the first.
	Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"`
	// PrevHash is the identity of the previous position. Empty at height 1.
	PrevHash []byte `protobuf:"bytes,3,opt,name=prev_hash,json=prevHash,proto3" json:"prevHash,omitempty"`
	// Op is the operation placed at this position. Its author and nonce let a
	// member skip an operation its checkpoint covers.
	Op *SOOperationPosition `protobuf:"bytes,4,opt,name=op,proto3" json:"op,omitempty"`
	// PeerId is the sequencer that signed the position, so positions two
	// sequencers sign for one operation differ.
	PeerId string `protobuf:"bytes,5,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// contains filtered or unexported fields
}

SOSequenceInner is the signed body of a position. Its identity is the hash of this encoded body.

func (*SOSequenceInner) CloneMessageVT

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

func (*SOSequenceInner) CloneVT

func (m *SOSequenceInner) CloneVT() *SOSequenceInner

func (*SOSequenceInner) EqualMessageVT

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

func (*SOSequenceInner) EqualVT

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

func (*SOSequenceInner) GetHeight

func (x *SOSequenceInner) GetHeight() uint64

func (*SOSequenceInner) GetOp

func (*SOSequenceInner) GetPeerId

func (x *SOSequenceInner) GetPeerId() string

func (*SOSequenceInner) GetPrevHash

func (x *SOSequenceInner) GetPrevHash() []byte

func (*SOSequenceInner) GetSharedObjectId

func (x *SOSequenceInner) GetSharedObjectId() string

func (*SOSequenceInner) MarshalJSON

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

MarshalJSON marshals the SOSequenceInner to JSON.

func (*SOSequenceInner) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOSequenceInner message to JSON.

func (*SOSequenceInner) MarshalProtoText

func (x *SOSequenceInner) MarshalProtoText() string

func (*SOSequenceInner) MarshalToSizedBufferVT

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

func (*SOSequenceInner) MarshalToVT

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

func (*SOSequenceInner) MarshalVT

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

func (*SOSequenceInner) ProtoMessage

func (*SOSequenceInner) ProtoMessage()

func (*SOSequenceInner) Reset

func (x *SOSequenceInner) Reset()

func (*SOSequenceInner) SizeVT

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

func (*SOSequenceInner) String

func (x *SOSequenceInner) String() string

func (*SOSequenceInner) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOSequenceInner from JSON.

func (*SOSequenceInner) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOSequenceInner message from JSON.

func (*SOSequenceInner) UnmarshalVT

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

func (*SOSequenceInner) Validate

func (i *SOSequenceInner) Validate() error

Validate checks the position body's structure.

type SOSequencer

type SOSequencer struct {

	// PeerId is the sequencer's key. Empty is Merge: nothing places operations
	// after start.
	PeerId string `protobuf:"bytes,1,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// Start is the last position of the sequence before this sequencer, as the
	// owner who appointed it held the sequence. Positions up to start are
	// authenticated by their hash links to it; the sequencer signs every later
	// one. Unset when no position came before.
	Start *SOSequenceHead `protobuf:"bytes,2,opt,name=start,proto3" json:"start,omitempty"`
	// contains filtered or unexported fields
}

SOSequencer names the device or service that signs the sequence: one position per operation, each naming the position before it.

func (*SOSequencer) CloneMessageVT

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

func (*SOSequencer) CloneVT

func (m *SOSequencer) CloneVT() *SOSequencer

func (*SOSequencer) EqualMessageVT

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

func (*SOSequencer) EqualVT

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

func (*SOSequencer) GetPeerId

func (x *SOSequencer) GetPeerId() string

func (*SOSequencer) GetStart

func (x *SOSequencer) GetStart() *SOSequenceHead

func (*SOSequencer) MarshalJSON

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

MarshalJSON marshals the SOSequencer to JSON.

func (*SOSequencer) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOSequencer message to JSON.

func (*SOSequencer) MarshalProtoText

func (x *SOSequencer) MarshalProtoText() string

func (*SOSequencer) MarshalToSizedBufferVT

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

func (*SOSequencer) MarshalToVT

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

func (*SOSequencer) MarshalVT

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

func (*SOSequencer) ProtoMessage

func (*SOSequencer) ProtoMessage()

func (*SOSequencer) Reset

func (x *SOSequencer) Reset()

func (*SOSequencer) SizeVT

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

func (*SOSequencer) String

func (x *SOSequencer) String() string

func (*SOSequencer) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOSequencer from JSON.

func (*SOSequencer) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOSequencer message from JSON.

func (*SOSequencer) UnmarshalVT

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

func (*SOSequencer) Validate

func (s *SOSequencer) Validate() error

Validate checks the sequencer's structure. An unset sequencer is Merge.

type SOState

type SOState struct {

	// Config is the shared object config.
	Config *SharedObjectConfig `protobuf:"bytes,1,opt,name=config,proto3" json:"config,omitempty"`
	// Checkpoint is the latest checkpoint: the World members replay from.
	Checkpoint *SOCheckpoint `protobuf:"bytes,2,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"`
	// KeyEpochs are the key epochs, sorted by epoch, each with a grant to every
	// reader that holds its key.
	KeyEpochs []*SOKeyEpoch `protobuf:"bytes,3,rep,name=key_epochs,json=keyEpochs,proto3" json:"keyEpochs,omitempty"`
	// Ops are the operations above the checkpoint, sorted by hash.
	Ops []*SOOperation `protobuf:"bytes,4,rep,name=ops,proto3" json:"ops,omitempty"`
	// Invites is the list of pending invites on this shared object.
	// Stored in plaintext so both providers and cloud can verify invite validity.
	Invites []*SOInvite `protobuf:"bytes,5,rep,name=invites,proto3" json:"invites,omitempty"`
	// Sequence are the positions above the checkpoint, sorted by height, then
	// by hash.
	Sequence []*SOSequence `protobuf:"bytes,6,rep,name=sequence,proto3" json:"sequence,omitempty"`
	// ControlMessages are the messages of the open group decisions under the
	// current config, sorted by hash. A voter's own messages are its persisted
	// locks.
	ControlMessages []*SOControlMessage `protobuf:"bytes,7,rep,name=control_messages,json=controlMessages,proto3" json:"controlMessages,omitempty"`
	// contains filtered or unexported fields
}

SOState contains the state of the shared object. Some implementations may drop or obscure some fields for some peers.

func UnmarshalSOState

func UnmarshalSOState(ctx context.Context, bcs *block.Cursor) (*SOState, error)

UnmarshalSOState unmarshals a SOState from a block cursor.

func (*SOState) AddControlMessage

func (s *SOState) AddControlMessage(sharedObjectID string, msg *SOControlMessage) (bool, error)

AddControlMessage adds a voter's message to the open decision. It reports false for a message the state holds, belongs to a closed decision, or exceeds the evidence kept of its signer. Under group control only a voter of the held config signs messages, and only the round's proposer proposes.

func (*SOState) AddOperation

func (s *SOState) AddOperation(sharedObjectID string, op *SOOperation) (bool, error)

AddOperation verifies op and adds it to the set. It reports false when the state already holds op or the checkpoint covers it. Authorization is decided by replay under the config op names.

func (*SOState) AddSequence

func (s *SOState) AddSequence(sharedObjectID string, record *SOSequence) (bool, error)

AddSequence verifies a sequence position and adds it. It reports false when the state holds it, the checkpoint covers it, or it is above the sequencer's start and the sequencer did not sign it. Whether it extends the sequence is decided when the sequence is resolved.

func (*SOState) AdoptCheckpoint

func (s *SOState) AdoptCheckpoint(sharedObjectID string, next *SOCheckpoint) error

AdoptCheckpoint replaces the held checkpoint with next when an owner under the held config signed it and it descends from the held checkpoint. The held checkpoint, or one below its height, is ignored without an authority check: a lagging peer's state imports cleanly even after its signer left. The operations next covers leave the set.

func (*SOState) BuildNextCheckpoint

func (s *SOState) BuildNextCheckpoint(sharedObjectID string, privKey crypto.PrivKey, stateDataEnc []byte) (*SOCheckpoint, error)

BuildNextCheckpoint signs, as the owner of privKey, the checkpoint after the held one that covers every held operation under the current config. stateDataEnc is the state after those operations, encrypted with the key of the current key epoch.

func (*SOState) BuildStableCheckpoint

func (s *SOState) BuildStableCheckpoint(
	sharedObjectID string,
	privKey crypto.PrivKey,
	prefix [][]byte,
	stateDataEnc []byte,
) (*SOCheckpoint, error)

BuildStableCheckpoint signs, as the owner of privKey, the checkpoint after the held one that covers prefix, a stable prefix of the held operations. stateDataEnc is the state after prefix, encrypted with the key of the current key epoch.

func (*SOState) CloneMessageVT

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

func (*SOState) CloneVT

func (m *SOState) CloneVT() *SOState

func (*SOState) ControlAgreements

func (s *SOState) ControlAgreements() ([]*ControlAgreement, error)

ControlAgreements returns the changes of the held config voters agree to, by most voting weight, then by hash.

func (*SOState) CurrentKeyEpoch

func (s *SOState) CurrentKeyEpoch() *SOKeyEpoch

CurrentKeyEpoch returns the latest key epoch, or nil before the first.

func (*SOState) EqualMessageVT

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

func (*SOState) EqualVT

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

func (*SOState) GetCheckpoint

func (x *SOState) GetCheckpoint() *SOCheckpoint

func (*SOState) GetCheckpointInner

func (s *SOState) GetCheckpointInner() (*SOCheckpointInner, error)

GetCheckpointInner returns the held checkpoint's body, or nil before the first checkpoint.

func (*SOState) GetConfig

func (x *SOState) GetConfig() *SharedObjectConfig

func (*SOState) GetControlMessages

func (x *SOState) GetControlMessages() []*SOControlMessage

func (*SOState) GetInvites

func (x *SOState) GetInvites() []*SOInvite

func (*SOState) GetKeyEpoch

func (s *SOState) GetKeyEpoch(epoch uint64) *SOKeyEpoch

GetKeyEpoch returns the key epoch with the given number, or nil.

func (*SOState) GetKeyEpochs

func (x *SOState) GetKeyEpochs() []*SOKeyEpoch

func (*SOState) GetOperation

func (s *SOState) GetOperation(peerID, localID string) (*SOOperation, error)

GetOperation returns peerID's held operation with localID, or nil.

func (*SOState) GetOps

func (x *SOState) GetOps() []*SOOperation

func (*SOState) GetSequence

func (x *SOState) GetSequence() []*SOSequence

func (*SOState) MarshalBlock

func (s *SOState) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*SOState) MarshalJSON

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

MarshalJSON marshals the SOState to JSON.

func (*SOState) MarshalProtoJSON

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

MarshalProtoJSON marshals the SOState message to JSON.

func (*SOState) MarshalProtoText

func (x *SOState) MarshalProtoText() string

func (*SOState) MarshalToSizedBufferVT

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

func (*SOState) MarshalToVT

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

func (*SOState) MarshalVT

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

func (*SOState) MergeControlMessages

func (s *SOState) MergeControlMessages(sharedObjectID string, msgs []*SOControlMessage)

MergeControlMessages adds the messages of a peer's state that belong to an open decision, skipping the rest.

func (*SOState) MergeKeyEpochs

func (s *SOState) MergeKeyEpochs(sharedObjectID string, epochs []*SOKeyEpoch) error

MergeKeyEpochs drops the held grants of peers that can no longer read, then adds the grants in epochs that the state lacks, checking each against the held config. A held grant for a recipient is kept unless its signer has left and epochs carries a replacement.

func (s *SOState) NextOperationLink(sharedObjectID, peerID string) (*SOOperationLink, error)

NextOperationLink returns where peerID's next operation goes: one past the head of its chain, naming every other head of the operation DAG, under the current config and key epoch.

func (*SOState) OpenControlMessages

func (s *SOState) OpenControlMessages() ([]ControlMessage, error)

OpenControlMessages returns the held messages of the open decision and the agreements to changes of the held config.

func (*SOState) OperationSet

func (s *SOState) OperationSet(sharedObjectID string) (*SOOperationSet, error)

OperationSet returns the held operations as a verified set above the held checkpoint.

func (*SOState) ProtoMessage

func (*SOState) ProtoMessage()

func (*SOState) Reset

func (x *SOState) Reset()

func (*SOState) SequenceOperations

func (s *SOState) SequenceOperations(sharedObjectID string, privKey crypto.PrivKey) ([]*SOSequence, error)

SequenceOperations signs, as the sequencer of privKey, a position for each placed operation after the sequence. It signs nothing unless privKey is the config's sequencer, every resolved position up to the sequencer's start is placed, and the sequencer has signed nothing above them, so it extends the one sequence every member resolves and never forks it. It returns the new positions.

func (*SOState) SetKeyEpoch

func (s *SOState) SetKeyEpoch(epoch *SOKeyEpoch)

SetKeyEpoch adds epoch, or replaces the held epoch with its number, keeping the epochs sorted.

func (*SOState) SizeVT

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

func (*SOState) StableCheckpointInner

func (s *SOState) StableCheckpointInner(sharedObjectID string, prefix [][]byte, stateDataEnc []byte) (*SOCheckpointInner, error)

StableCheckpointInner returns the body of the checkpoint after the held one that covers prefix, a prefix of the held operations, with the state data stateDataEnc. A group decides it unsigned.

func (*SOState) String

func (x *SOState) String() string

func (*SOState) UnmarshalBlock

func (s *SOState) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*SOState) UnmarshalJSON

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

UnmarshalJSON unmarshals the SOState from JSON.

func (*SOState) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SOState message from JSON.

func (*SOState) UnmarshalVT

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

func (*SOState) Validate

func (s *SOState) Validate(sharedObjectID string) error

Validate checks the configuration, checkpoint, key epochs, operations, sequence positions and control messages. It authenticates every signature but does not check that a checkpoint or grant signer still holds authority: that is checked when they are adopted, so a signer's later departure leaves them valid.

func (*SOState) ValidateAuthority

func (s *SOState) ValidateAuthority(sharedObjectID string) error

ValidateAuthority checks that the checkpoint and every grant were signed with authority under the held config. Validate checks only that the signatures are authentic.

type SOStateLock

type SOStateLock interface {
	// GetSOState returns the SOState as of when the lock was acquired.
	GetSOState() *SOState

	// WriteSOState writes an updated SOState and its accepted configuration changes.
	// Persistent providers commit the supplied lineage with the state atomically.
	// Returns an error if the lock was released already.
	// Only the locked handle should be able to write.
	WriteSOState(ctx context.Context, state *SOState, changes ...*SOConfigChange) error

	// Release releases the lock.
	Release()
}

SOStateLock is a lock handle to a SOState. The caller serializes all handle use.

func NewSOStateLock

func NewSOStateLock(
	initialState *SOState,
	writeFn func(ctx context.Context, state *SOState, changes ...*SOConfigChange) error,
	release func(),
) SOStateLock

NewSOStateLock constructs a SOStateLock with an initial value and callbacks.

type SOStateLockFunc

type SOStateLockFunc = func(ctx context.Context, sharedObjectID string) (SOStateLock, error)

SOStateLockFunc is a function to lock and load the SOState.

type SOStateParticipantHandle

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

SOStateParticipantHandle implements SharedObjectStateSnapshot over a SOState as one participant.

func NewSOStateParticipantHandle

func NewSOStateParticipantHandle(
	le *logrus.Entry,
	sfs *block_transform.StepFactorySet,
	sharedObjectID string,
	state *SOState,
	privKey crypto.PrivKey,
	localPeerID peer.ID,
) *SOStateParticipantHandle

NewSOStateParticipantHandle constructs a SOStateParticipantHandle from a SOState and private key.

func (*SOStateParticipantHandle) DecodeCheckpoint

func (s *SOStateParticipantHandle) DecodeCheckpoint(inner *SOCheckpointInner) (*SOCheckpointInner, error)

DecodeCheckpoint returns a copy of a checkpoint body with its state data decoded with the key of its epoch.

func (*SOStateParticipantHandle) DecodeOperation

func (s *SOStateParticipantHandle) DecodeOperation(_ context.Context, inner *SOOperationInner) ([]byte, error)

DecodeOperation decodes the operation data with the key of its epoch. An acknowledgment decodes to no data.

func (*SOStateParticipantHandle) GetCheckpoint

GetCheckpoint returns the checkpoint body with its state data decoded.

func (*SOStateParticipantHandle) GetConfig

GetConfig returns the accepted config.

func (*SOStateParticipantHandle) GetConfigByHash

func (s *SOStateParticipantHandle) GetConfigByHash(ctx context.Context, hash []byte) (*SharedObjectConfig, error)

GetConfigByHash returns the current config or a retained earlier one.

func (*SOStateParticipantHandle) GetOperationSet

GetOperationSet returns the verified operations above the checkpoint. The handle verifies them once and shares the set, which callers must not modify.

func (*SOStateParticipantHandle) GetParticipantConfig

func (s *SOStateParticipantHandle) GetParticipantConfig(ctx context.Context) (*SOParticipantConfig, error)

GetParticipantConfig returns the participant record for our participant. uses the peer identity from the SharedObject. returns ErrNotParticipant if the local peer is not a participant.

func (*SOStateParticipantHandle) GetParticipantConfigForPeer

func (s *SOStateParticipantHandle) GetParticipantConfigForPeer(_ context.Context, peerID string) (*SOParticipantConfig, error)

GetParticipantConfigForPeer returns a participant from this accepted config.

func (*SOStateParticipantHandle) GetTransformInfo

func (s *SOStateParticipantHandle) GetTransformInfo(context.Context) (*TransformInfo, error)

GetTransformInfo implements SharedObjectStateSnapshot.GetTransformInfo.

func (*SOStateParticipantHandle) GetTransformer

GetTransformer returns the transformer of the current key epoch.

func (*SOStateParticipantHandle) WithConfigHistory

WithConfigHistory resolves configs other than the current one through read, which returns the retained config change with a hash, or nil. Call it before sharing the handle.

type SOStateWatchFunc

type SOStateWatchFunc = func(ctx context.Context, sharedObjectID string, released func()) (ccontainer.Watchable[*SOState], func(), error)

SOStateWatchFunc is a function to watch the SOState for changes.

type SequencerHost

type SequencerHost interface {
	// SetSequencer appoints peerID as the sequencer from the sequence the local
	// peer holds, or selects Merge when peerID is empty. It reports false when
	// peerID already sequences.
	SetSequencer(ctx context.Context, peerID string) (bool, error)
}

SequencerHost is an optional interface on SharedObject implementations whose local peer can choose the sequencer as an owner.

type SharedObject

type SharedObject interface {
	// GetBus returns the bus used by the session.
	GetBus() bus.Bus

	// GetPeerID returns the peer ID attached to this SharedObject handle.
	GetPeerID() peer.ID

	// GetSharedObjectID returns the shared object id.
	GetSharedObjectID() string

	// GetBlockStore returns the block store mounted along with the SharedObject.
	GetBlockStore() bstore.BlockStore

	// AccessLocalStateStore accesses a kvtx ops for a local state store with the given ID.
	// This state store is stored along with the local SharedObject state.
	AccessLocalStateStore(ctx context.Context, storeID string, released func()) (kvtx.Store, func(), error)

	// GetSharedObjectState returns a snapshot of the shared object state.
	GetSharedObjectState(ctx context.Context) (SharedObjectStateSnapshot, error)

	// AccessSharedObjectState adds a reference to the state and returns the state container.
	// Returns a release function. Accepts a function that is called if the Watchable becomes invalid.
	AccessSharedObjectState(ctx context.Context, released func()) (ccontainer.Watchable[SharedObjectStateSnapshot], func(), error)

	// QueueOperation signs op as the local peer and adds it to the operation
	// set. Returns the local operation id once the local state holds it.
	QueueOperation(ctx context.Context, op []byte) (string, error)
}

SharedObject is the shared object handle interface.

This is the interface exposed by the provider on the "client side."

func ExMountSharedObject

func ExMountSharedObject(
	ctx context.Context,
	b bus.Bus,
	ref *SharedObjectRef,
	returnIfIdle bool,
	valDisposeCb func(),
) (SharedObject, directive.Reference, error)

ExMountSharedObject executes a lookup for a single provider on the bus.

If returnIfIdle is set, returns when the directive becomes idle.

type SharedObjectConfig

type SharedObjectConfig struct {

	// Participants is the list of shared object participants.
	// An empty audience with a retained signed history head represents final departure.
	Participants []*SOParticipantConfig `protobuf:"bytes,1,rep,name=participants,proto3" json:"participants,omitempty"`
	// ConfigChainHash is the hash of the latest SOConfigChange entry.
	ConfigChainHash []byte `protobuf:"bytes,10,opt,name=config_chain_hash,json=configChainHash,proto3" json:"configChainHash,omitempty"`
	// ConfigChainSeqno is the sequence number of the latest SOConfigChange entry.
	// The next entry must have config_seqno == config_chain_seqno + 1.
	// Zero means no config changes have been applied yet (genesis state).
	ConfigChainSeqno uint64 `protobuf:"varint,11,opt,name=config_chain_seqno,json=configChainSeqno,proto3" json:"configChainSeqno,omitempty"`
	// RemovedAuthors pins the last operation the removing owner held from each
	// removed author whose operations the checkpoint does not yet cover, sorted
	// by peer ID. Replay applies a removed author's operations up to that
	// operation and skips the rest, which may postdate the removal.
	RemovedAuthors []*SOOperationPosition `protobuf:"bytes,12,rep,name=removed_authors,json=removedAuthors,proto3" json:"removedAuthors,omitempty"`
	// RosterDroppedPeerIds are the writers left off the trimming roster, sorted.
	// Every other writer is on the roster: the stable point waits until each
	// has built on an operation before history below it is trimmed.
	RosterDroppedPeerIds []string `protobuf:"bytes,13,rep,name=roster_dropped_peer_ids,json=rosterDroppedPeerIds,proto3" json:"rosterDroppedPeerIds,omitempty"`
	// Sequencer places operations in One order. An unset sequencer or an empty
	// peer ID is Merge.
	Sequencer *SOSequencer `protobuf:"bytes,14,opt,name=sequencer,proto3" json:"sequencer,omitempty"`
	// Control says who changes this config and signs checkpoints: an owner, or
	// more than two thirds of the voting weight.
	Control SOControl `protobuf:"varint,15,opt,name=control,proto3" json:"control,omitempty"`
	// SealedCheckpoint is the checkpoint the group held when it decided this
	// config. The config vouches for it by hash, so it stays valid after the
	// voters who committed it change. Required under group control; a change
	// back to owner control keeps it.
	SealedCheckpoint *SOCheckpointHead `protobuf:"bytes,16,opt,name=sealed_checkpoint,json=sealedCheckpoint,proto3" json:"sealedCheckpoint,omitempty"`
	// contains filtered or unexported fields
}

SharedObjectConfig configures the SharedObject.

func VerifyConfigChange

func VerifyConfigChange(sharedObjectID string, current *SharedObjectConfig, entry *SOConfigChange) (*SharedObjectConfig, error)

VerifyConfigChange verifies one authorized transition against the held configuration and returns an independent configuration with its resulting chain head. The resulting configuration must pass Validate, so a nonempty result keeps an OWNER. An empty held head permits sequence zero for locally authorized bootstrap. SELF_ENROLL_PEER requires a separate authenticated peer-to-entity binding.

func VerifyConfigLineage

func VerifyConfigLineage(sharedObjectID string, target *SharedObjectConfig, lineage []*SOConfigChange) (*SharedObjectConfig, error)

VerifyConfigLineage authenticates changes, oldest first, that lead to an authenticated target configuration. Each change links by hash to the next and the last produced target, so target's head authenticates every earlier change; each change after the first must also be authorized by the configuration before it. It returns the configuration the first change produced, or target when lineage is empty.

func (*SharedObjectConfig) AdmitsOperation

func (c *SharedObjectConfig) AdmitsOperation(peerID string, nonce uint64) bool

AdmitsOperation reports whether replay under this config applies the operation at nonce in peerID's chain: the author participates, or a removal pinned an operation at or after nonce.

func (*SharedObjectConfig) Checkpointer

func (c *SharedObjectConfig) Checkpointer() string

Checkpointer returns the owner that checkpoints the stable point: the first owner on the trimming roster, in participant order, or empty when none is. One checkpointer keeps owners from signing different checkpoints at one height.

func (*SharedObjectConfig) CloneMessageVT

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

func (*SharedObjectConfig) CloneVT

func (m *SharedObjectConfig) CloneVT() *SharedObjectConfig

func (*SharedObjectConfig) EqualMessageVT

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

func (*SharedObjectConfig) EqualVT

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

func (*SharedObjectConfig) GetConfigChainHash

func (x *SharedObjectConfig) GetConfigChainHash() []byte

func (*SharedObjectConfig) GetConfigChainSeqno

func (x *SharedObjectConfig) GetConfigChainSeqno() uint64

func (*SharedObjectConfig) GetControl

func (x *SharedObjectConfig) GetControl() SOControl

func (*SharedObjectConfig) GetParticipants

func (x *SharedObjectConfig) GetParticipants() []*SOParticipantConfig

func (*SharedObjectConfig) GetRemovedAuthors

func (x *SharedObjectConfig) GetRemovedAuthors() []*SOOperationPosition

func (*SharedObjectConfig) GetRosterDroppedPeerIds

func (x *SharedObjectConfig) GetRosterDroppedPeerIds() []string

func (*SharedObjectConfig) GetSealedCheckpoint

func (x *SharedObjectConfig) GetSealedCheckpoint() *SOCheckpointHead

func (*SharedObjectConfig) GetSequencer

func (x *SharedObjectConfig) GetSequencer() *SOSequencer

func (*SharedObjectConfig) IsGroupControl

func (c *SharedObjectConfig) IsGroupControl() bool

IsGroupControl reports whether the config's voters, not an owner, decide its control records and checkpoints.

func (*SharedObjectConfig) MarshalJSON

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

MarshalJSON marshals the SharedObjectConfig to JSON.

func (*SharedObjectConfig) MarshalProtoJSON

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

MarshalProtoJSON marshals the SharedObjectConfig message to JSON.

func (*SharedObjectConfig) MarshalProtoText

func (x *SharedObjectConfig) MarshalProtoText() string

func (*SharedObjectConfig) MarshalToSizedBufferVT

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

func (*SharedObjectConfig) MarshalToVT

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

func (*SharedObjectConfig) MarshalVT

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

func (*SharedObjectConfig) ProtoMessage

func (*SharedObjectConfig) ProtoMessage()

func (*SharedObjectConfig) Reset

func (x *SharedObjectConfig) Reset()

func (*SharedObjectConfig) SizeVT

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

func (*SharedObjectConfig) String

func (x *SharedObjectConfig) String() string

func (*SharedObjectConfig) TotalVotingWeight

func (c *SharedObjectConfig) TotalVotingWeight() uint64

TotalVotingWeight returns the sum of every voter's weight under group control, or zero.

func (*SharedObjectConfig) TrimRoster

func (c *SharedObjectConfig) TrimRoster() []string

TrimRoster returns the trimming roster: every writer the roster does not drop, in participant order.

func (*SharedObjectConfig) UnmarshalJSON

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

UnmarshalJSON unmarshals the SharedObjectConfig from JSON.

func (*SharedObjectConfig) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SharedObjectConfig message from JSON.

func (*SharedObjectConfig) UnmarshalVT

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

func (*SharedObjectConfig) Validate

func (c *SharedObjectConfig) Validate() error

Validate checks bootstrap structure or a retained configuration, including a terminal empty audience. A nonempty configuration must keep an OWNER so later changes remain authorizable.

func (*SharedObjectConfig) Voters

func (c *SharedObjectConfig) Voters() []string

Voters returns the peer IDs that vote under group control, sorted.

func (*SharedObjectConfig) VotingWeight

func (c *SharedObjectConfig) VotingWeight(peerID string) uint64

VotingWeight returns peerID's voting weight under group control, or zero.

func (*SharedObjectConfig) Writers

func (c *SharedObjectConfig) Writers() []string

Writers returns every participant that can write operations, in participant order.

type SharedObjectConfigHistoryAccessor

type SharedObjectConfigHistoryAccessor interface {
	// ReadSharedObjectConfigHistory returns the held checkpoint and verified changes through target.
	ReadSharedObjectConfigHistory(ctx context.Context, target *SharedObjectConfig) (*SharedObjectConfig, []*SOConfigChange, error)
}

SharedObjectConfigHistoryAccessor reads the retained native lineage of an accepted head. Missing history cannot be reconstructed from client observations.

type SharedObjectHealth

type SharedObjectHealth struct {

	// Status is the lifecycle status for the SharedObject.
	Status SharedObjectHealthStatus `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
	// Layer identifies whether the issue is on the SharedObject or body layer.
	Layer SharedObjectHealthLayer `protobuf:"varint,2,opt,name=layer,proto3" json:"layer,omitempty"`
	// CommonReason identifies a stable cross-provider reason when known.
	CommonReason SharedObjectHealthCommonReason `protobuf:"varint,3,opt,name=common_reason,json=commonReason,proto3" json:"commonReason,omitempty"`
	// RemediationHint suggests the next action to present to the user.
	RemediationHint SharedObjectHealthRemediationHint `protobuf:"varint,4,opt,name=remediation_hint,json=remediationHint,proto3" json:"remediationHint,omitempty"`
	// Error preserves provider-specific or body-specific detail when needed.
	Error string `protobuf:"bytes,5,opt,name=error,proto3" json:"error,omitempty"`
	// Metadata reserves an opaque slot for future provider-specific or body-specific remediation data.
	// Empty in v1. Callers must treat the contents as opaque.
	Metadata []byte `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// SyncDeniedPeerIds lists base58 participant IDs whose latest authenticated sync admission denied this object identity.
	// Each peer was readable under local authority. This is source availability, not proof of membership removal.
	// A successful admission from that participant clears its denial; transport failures leave it unchanged.
	SyncDeniedPeerIds []string `protobuf:"bytes,7,rep,name=sync_denied_peer_ids,json=syncDeniedPeerIds,proto3" json:"syncDeniedPeerIds,omitempty"`
	// SyncRecoveryPeerIds lists authenticated participants whose direct sync needs
	// an upgrade or trusted history recovery. Local content remains available.
	// Verified convergence clears the participant; admission alone does not.
	SyncRecoveryPeerIds []string `protobuf:"bytes,8,rep,name=sync_recovery_peer_ids,json=syncRecoveryPeerIds,proto3" json:"syncRecoveryPeerIds,omitempty"`
	// RejectedEdits lists this device's operations that applied and that a later
	// replay rejected, in replay order. An operation rejected when it is written
	// is reported to its writer instead.
	RejectedEdits []*SORejectedEdit `protobuf:"bytes,9,rep,name=rejected_edits,json=rejectedEdits,proto3" json:"rejectedEdits,omitempty"`
	// CheckpointMismatch is set while the latest checkpoint this device could
	// judge holds a World different from the one this device replayed through
	// the operations it covers.
	CheckpointMismatch *SOCheckpointMismatch `protobuf:"bytes,10,opt,name=checkpoint_mismatch,json=checkpointMismatch,proto3" json:"checkpointMismatch,omitempty"`
	// UnorderedCount is the number of operations this device holds that the
	// appointed sequencer has not placed yet. It is zero under Merge.
	UnorderedCount uint32 `protobuf:"varint,11,opt,name=unordered_count,json=unorderedCount,proto3" json:"unorderedCount,omitempty"`
	// contains filtered or unexported fields
}

SharedObjectHealth describes the current lifecycle and failure state of a SharedObject. This payload is shared across local, spacewave, and CDN providers.

func BuildSharedObjectHealthFromError

func BuildSharedObjectHealthFromError(
	layer SharedObjectHealthLayer,
	err error,
) *SharedObjectHealth

BuildSharedObjectHealthFromError maps a known error into a SharedObjectHealth snapshot.

func GetSharedObjectHealthFromError

func GetSharedObjectHealthFromError(err error) (*SharedObjectHealth, bool)

GetSharedObjectHealthFromError returns an attached SharedObjectHealth snapshot when available.

func NewSharedObjectClosedHealth

func NewSharedObjectClosedHealth(
	layer SharedObjectHealthLayer,
	commonReason SharedObjectHealthCommonReason,
	remediationHint SharedObjectHealthRemediationHint,
	errText string,
) *SharedObjectHealth

NewSharedObjectClosedHealth constructs a closed SharedObjectHealth snapshot.

func NewSharedObjectHealth

func NewSharedObjectHealth(
	status SharedObjectHealthStatus,
	layer SharedObjectHealthLayer,
	commonReason SharedObjectHealthCommonReason,
	remediationHint SharedObjectHealthRemediationHint,
	errText string,
) *SharedObjectHealth

NewSharedObjectHealth constructs a SharedObjectHealth snapshot.

func NewSharedObjectLoadingHealth

func NewSharedObjectLoadingHealth(
	layer SharedObjectHealthLayer,
) *SharedObjectHealth

NewSharedObjectLoadingHealth constructs a loading SharedObjectHealth snapshot.

func NewSharedObjectReadyHealth

func NewSharedObjectReadyHealth(
	layer SharedObjectHealthLayer,
) *SharedObjectHealth

NewSharedObjectReadyHealth constructs a ready SharedObjectHealth snapshot.

func (*SharedObjectHealth) CloneMessageVT

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

func (*SharedObjectHealth) CloneVT

func (m *SharedObjectHealth) CloneVT() *SharedObjectHealth

func (*SharedObjectHealth) EqualMessageVT

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

func (*SharedObjectHealth) EqualVT

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

func (*SharedObjectHealth) GetCheckpointMismatch

func (x *SharedObjectHealth) GetCheckpointMismatch() *SOCheckpointMismatch

func (*SharedObjectHealth) GetCommonReason

func (*SharedObjectHealth) GetError

func (x *SharedObjectHealth) GetError() string

func (*SharedObjectHealth) GetLayer

func (*SharedObjectHealth) GetMetadata

func (x *SharedObjectHealth) GetMetadata() []byte

func (*SharedObjectHealth) GetRejectedEdits

func (x *SharedObjectHealth) GetRejectedEdits() []*SORejectedEdit

func (*SharedObjectHealth) GetRemediationHint

func (x *SharedObjectHealth) GetRemediationHint() SharedObjectHealthRemediationHint

func (*SharedObjectHealth) GetStatus

func (*SharedObjectHealth) GetSyncDeniedPeerIds

func (x *SharedObjectHealth) GetSyncDeniedPeerIds() []string

func (*SharedObjectHealth) GetSyncRecoveryPeerIds

func (x *SharedObjectHealth) GetSyncRecoveryPeerIds() []string

func (*SharedObjectHealth) GetUnorderedCount

func (x *SharedObjectHealth) GetUnorderedCount() uint32

func (*SharedObjectHealth) MarshalJSON

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

MarshalJSON marshals the SharedObjectHealth to JSON.

func (*SharedObjectHealth) MarshalProtoJSON

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

MarshalProtoJSON marshals the SharedObjectHealth message to JSON.

func (*SharedObjectHealth) MarshalProtoText

func (x *SharedObjectHealth) MarshalProtoText() string

func (*SharedObjectHealth) MarshalToSizedBufferVT

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

func (*SharedObjectHealth) MarshalToVT

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

func (*SharedObjectHealth) MarshalVT

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

func (*SharedObjectHealth) ProtoMessage

func (*SharedObjectHealth) ProtoMessage()

func (*SharedObjectHealth) Reset

func (x *SharedObjectHealth) Reset()

func (*SharedObjectHealth) SizeVT

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

func (*SharedObjectHealth) String

func (x *SharedObjectHealth) String() string

func (*SharedObjectHealth) UnmarshalJSON

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

UnmarshalJSON unmarshals the SharedObjectHealth from JSON.

func (*SharedObjectHealth) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SharedObjectHealth message from JSON.

func (*SharedObjectHealth) UnmarshalVT

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

func (*SharedObjectHealth) WithCheckpointMismatch

func (h *SharedObjectHealth) WithCheckpointMismatch(mismatch *SOCheckpointMismatch) *SharedObjectHealth

WithCheckpointMismatch returns a snapshot reporting mismatch, or no mismatch when it is nil.

func (*SharedObjectHealth) WithRejectedEdits

func (h *SharedObjectHealth) WithRejectedEdits(edits []*SORejectedEdit) *SharedObjectHealth

WithRejectedEdits returns a snapshot listing edits as this device's edits that replay no longer applies.

func (*SharedObjectHealth) WithSyncPeerAdmission

func (h *SharedObjectHealth) WithSyncPeerAdmission(peerID string, accepted bool) *SharedObjectHealth

WithSyncPeerAdmission returns a health snapshot reflecting a verified peer's admission response without changing local mount readiness or authority. The caller must have verified that peerID is readable under local authority.

func (*SharedObjectHealth) WithSyncPeerRecovery

func (h *SharedObjectHealth) WithSyncPeerRecovery(peerID string, required bool) *SharedObjectHealth

WithSyncPeerRecovery records a recovery requirement without closing local access. The caller supplies an authenticated participant; only verified convergence clears it.

func (*SharedObjectHealth) WithUnorderedCount

func (h *SharedObjectHealth) WithUnorderedCount(n uint32) *SharedObjectHealth

WithUnorderedCount returns a snapshot reporting n operations the sequencer has not placed yet.

func (*SharedObjectHealth) WithoutSyncDenials

func (h *SharedObjectHealth) WithoutSyncDenials() *SharedObjectHealth

WithoutSyncDenials returns a snapshot that forgets every recorded admission denial. A newly installed authenticated checkpoint replaces the authority those denials answered; later sync rounds record fresh decisions.

type SharedObjectHealthAccessor

type SharedObjectHealthAccessor interface {
	// AccessSharedObjectHealth adds a reference to SharedObject health and returns the state container.
	// Returns a release function. Accepts a function that is called if the Watchable becomes invalid.
	AccessSharedObjectHealth(ctx context.Context, released func()) (ccontainer.Watchable[*SharedObjectHealth], func(), error)
}

SharedObjectHealthAccessor exposes SharedObject health directly from a mounted object.

type SharedObjectHealthCommonReason

type SharedObjectHealthCommonReason int32

SharedObjectHealthCommonReason identifies a stable cross-provider reason when one is known.

const (
	// SHARED_OBJECT_HEALTH_COMMON_REASON_UNKNOWN is the zero / invalid value.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_UNKNOWN SharedObjectHealthCommonReason = 0
	// SHARED_OBJECT_HEALTH_COMMON_REASON_NOT_FOUND indicates the SharedObject or required body data could not be found.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_NOT_FOUND SharedObjectHealthCommonReason = 1
	// SHARED_OBJECT_HEALTH_COMMON_REASON_ACCESS_REVOKED indicates access to the SharedObject was removed.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_ACCESS_REVOKED SharedObjectHealthCommonReason = 2
	// SHARED_OBJECT_HEALTH_COMMON_REASON_INITIAL_STATE_REJECTED indicates the initial SharedObject state failed verification.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_INITIAL_STATE_REJECTED SharedObjectHealthCommonReason = 3
	// SHARED_OBJECT_HEALTH_COMMON_REASON_BLOCK_NOT_FOUND indicates a required block is missing.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_BLOCK_NOT_FOUND SharedObjectHealthCommonReason = 4
	// SHARED_OBJECT_HEALTH_COMMON_REASON_TRANSFORM_CONFIG_DECODE_FAILED indicates the transform configuration could not be decoded.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_TRANSFORM_CONFIG_DECODE_FAILED SharedObjectHealthCommonReason = 5
	// SHARED_OBJECT_HEALTH_COMMON_REASON_BODY_CONFIG_DECODE_FAILED indicates the body configuration could not be decoded.
	SharedObjectHealthCommonReason_SHARED_OBJECT_HEALTH_COMMON_REASON_BODY_CONFIG_DECODE_FAILED SharedObjectHealthCommonReason = 6
)

func (SharedObjectHealthCommonReason) Enum

func (SharedObjectHealthCommonReason) MarshalJSON

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

MarshalJSON marshals the SharedObjectHealthCommonReason to JSON.

func (SharedObjectHealthCommonReason) MarshalProtoJSON

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

MarshalProtoJSON marshals the SharedObjectHealthCommonReason to JSON.

func (SharedObjectHealthCommonReason) MarshalProtoText

func (x SharedObjectHealthCommonReason) MarshalProtoText() string

func (SharedObjectHealthCommonReason) MarshalText

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

MarshalText marshals the SharedObjectHealthCommonReason to text.

func (SharedObjectHealthCommonReason) String

func (*SharedObjectHealthCommonReason) UnmarshalJSON

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

UnmarshalJSON unmarshals the SharedObjectHealthCommonReason from JSON.

func (*SharedObjectHealthCommonReason) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SharedObjectHealthCommonReason from JSON.

func (*SharedObjectHealthCommonReason) UnmarshalText

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

UnmarshalText unmarshals the SharedObjectHealthCommonReason from text.

type SharedObjectHealthError

type SharedObjectHealthError interface {
	error

	// GetSharedObjectHealth returns the attached SharedObjectHealth snapshot.
	GetSharedObjectHealth() *SharedObjectHealth
}

SharedObjectHealthError exposes a SharedObjectHealth snapshot through an error wrapper.

type SharedObjectHealthLayer

type SharedObjectHealthLayer int32

SharedObjectHealthLayer identifies where the current issue is happening.

const (
	// SHARED_OBJECT_HEALTH_LAYER_UNKNOWN is the zero / invalid value.
	SharedObjectHealthLayer_SHARED_OBJECT_HEALTH_LAYER_UNKNOWN SharedObjectHealthLayer = 0
	// SHARED_OBJECT_HEALTH_LAYER_SHARED_OBJECT indicates the failure happened while mounting or syncing the SharedObject itself.
	SharedObjectHealthLayer_SHARED_OBJECT_HEALTH_LAYER_SHARED_OBJECT SharedObjectHealthLayer = 1
	// SHARED_OBJECT_HEALTH_LAYER_BODY indicates the failure happened while mounting or decoding the body.
	SharedObjectHealthLayer_SHARED_OBJECT_HEALTH_LAYER_BODY SharedObjectHealthLayer = 2
)

func (SharedObjectHealthLayer) Enum

func (SharedObjectHealthLayer) MarshalJSON

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

MarshalJSON marshals the SharedObjectHealthLayer to JSON.

func (SharedObjectHealthLayer) MarshalProtoJSON

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

MarshalProtoJSON marshals the SharedObjectHealthLayer to JSON.

func (SharedObjectHealthLayer) MarshalProtoText

func (x SharedObjectHealthLayer) MarshalProtoText() string

func (SharedObjectHealthLayer) MarshalText

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

MarshalText marshals the SharedObjectHealthLayer to text.

func (SharedObjectHealthLayer) String

func (x SharedObjectHealthLayer) String() string

func (*SharedObjectHealthLayer) UnmarshalJSON

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

UnmarshalJSON unmarshals the SharedObjectHealthLayer from JSON.

func (*SharedObjectHealthLayer) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SharedObjectHealthLayer from JSON.

func (*SharedObjectHealthLayer) UnmarshalText

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

UnmarshalText unmarshals the SharedObjectHealthLayer from text.

type SharedObjectHealthProvider

type SharedObjectHealthProvider interface {
	// AccessSharedObjectHealth adds a reference to SharedObject health by ref.
	// Returns a release function. Accepts a function that is called if the Watchable becomes invalid.
	AccessSharedObjectHealth(ctx context.Context, ref *SharedObjectRef, released func()) (ccontainer.Watchable[*SharedObjectHealth], func(), error)
}

SharedObjectHealthProvider streams SharedObject health snapshots before body mount.

func GetSharedObjectHealthProvider

func GetSharedObjectHealthProvider(
	provAcc provider.ProviderAccount,
) (SharedObjectHealthProvider, bool)

GetSharedObjectHealthProvider returns the optional SharedObjectHealthProvider for a ProviderAccount.

type SharedObjectHealthRemediationHint

type SharedObjectHealthRemediationHint int32

SharedObjectHealthRemediationHint suggests a next step for the caller or UI.

const (
	// SHARED_OBJECT_HEALTH_REMEDIATION_HINT_UNKNOWN is the zero / invalid value.
	SharedObjectHealthRemediationHint_SHARED_OBJECT_HEALTH_REMEDIATION_HINT_UNKNOWN SharedObjectHealthRemediationHint = 0
	// SHARED_OBJECT_HEALTH_REMEDIATION_HINT_NONE indicates no explicit action is suggested.
	SharedObjectHealthRemediationHint_SHARED_OBJECT_HEALTH_REMEDIATION_HINT_NONE SharedObjectHealthRemediationHint = 1
	// SHARED_OBJECT_HEALTH_REMEDIATION_HINT_RETRY indicates retrying the operation may succeed.
	SharedObjectHealthRemediationHint_SHARED_OBJECT_HEALTH_REMEDIATION_HINT_RETRY SharedObjectHealthRemediationHint = 2
	// SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REQUEST_ACCESS indicates the user should request access again.
	SharedObjectHealthRemediationHint_SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REQUEST_ACCESS SharedObjectHealthRemediationHint = 3
	// SHARED_OBJECT_HEALTH_REMEDIATION_HINT_CONTACT_OWNER indicates the user should contact the owner or operator.
	SharedObjectHealthRemediationHint_SHARED_OBJECT_HEALTH_REMEDIATION_HINT_CONTACT_OWNER SharedObjectHealthRemediationHint = 4
	// SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REPAIR_SOURCE_DATA indicates the backing SharedObject or body data must be repaired.
	SharedObjectHealthRemediationHint_SHARED_OBJECT_HEALTH_REMEDIATION_HINT_REPAIR_SOURCE_DATA SharedObjectHealthRemediationHint = 5
)

func (SharedObjectHealthRemediationHint) Enum

func (SharedObjectHealthRemediationHint) MarshalJSON

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

MarshalJSON marshals the SharedObjectHealthRemediationHint to JSON.

func (SharedObjectHealthRemediationHint) MarshalProtoJSON

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

MarshalProtoJSON marshals the SharedObjectHealthRemediationHint to JSON.

func (SharedObjectHealthRemediationHint) MarshalProtoText

func (x SharedObjectHealthRemediationHint) MarshalProtoText() string

func (SharedObjectHealthRemediationHint) MarshalText

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

MarshalText marshals the SharedObjectHealthRemediationHint to text.

func (SharedObjectHealthRemediationHint) String

func (*SharedObjectHealthRemediationHint) UnmarshalJSON

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

UnmarshalJSON unmarshals the SharedObjectHealthRemediationHint from JSON.

func (*SharedObjectHealthRemediationHint) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SharedObjectHealthRemediationHint from JSON.

func (*SharedObjectHealthRemediationHint) UnmarshalText

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

UnmarshalText unmarshals the SharedObjectHealthRemediationHint from text.

type SharedObjectHealthStatus

type SharedObjectHealthStatus int32

SharedObjectHealthStatus describes the lifecycle status of a SharedObject mount.

const (
	// SHARED_OBJECT_HEALTH_STATUS_UNKNOWN is the zero / invalid value.
	SharedObjectHealthStatus_SHARED_OBJECT_HEALTH_STATUS_UNKNOWN SharedObjectHealthStatus = 0
	// SHARED_OBJECT_HEALTH_STATUS_LOADING indicates the object is still mounting.
	SharedObjectHealthStatus_SHARED_OBJECT_HEALTH_STATUS_LOADING SharedObjectHealthStatus = 1
	// SHARED_OBJECT_HEALTH_STATUS_READY indicates the object is mounted and usable.
	SharedObjectHealthStatus_SHARED_OBJECT_HEALTH_STATUS_READY SharedObjectHealthStatus = 2
	// SHARED_OBJECT_HEALTH_STATUS_DEGRADED indicates the object is usable with a known problem.
	SharedObjectHealthStatus_SHARED_OBJECT_HEALTH_STATUS_DEGRADED SharedObjectHealthStatus = 3
	// SHARED_OBJECT_HEALTH_STATUS_CLOSED indicates the mount cannot proceed without remediation.
	SharedObjectHealthStatus_SHARED_OBJECT_HEALTH_STATUS_CLOSED SharedObjectHealthStatus = 4
)

func (SharedObjectHealthStatus) Enum

func (SharedObjectHealthStatus) MarshalJSON

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

MarshalJSON marshals the SharedObjectHealthStatus to JSON.

func (SharedObjectHealthStatus) MarshalProtoJSON

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

MarshalProtoJSON marshals the SharedObjectHealthStatus to JSON.

func (SharedObjectHealthStatus) MarshalProtoText

func (x SharedObjectHealthStatus) MarshalProtoText() string

func (SharedObjectHealthStatus) MarshalText

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

MarshalText marshals the SharedObjectHealthStatus to text.

func (SharedObjectHealthStatus) String

func (x SharedObjectHealthStatus) String() string

func (*SharedObjectHealthStatus) UnmarshalJSON

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

UnmarshalJSON unmarshals the SharedObjectHealthStatus from JSON.

func (*SharedObjectHealthStatus) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SharedObjectHealthStatus from JSON.

func (*SharedObjectHealthStatus) UnmarshalText

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

UnmarshalText unmarshals the SharedObjectHealthStatus from text.

type SharedObjectList

type SharedObjectList struct {

	// SharedObjects is the list of shared objects.
	SharedObjects []*SharedObjectListEntry `protobuf:"bytes,1,rep,name=shared_objects,json=sharedObjects,proto3" json:"sharedObjects,omitempty"`
	// contains filtered or unexported fields
}

SharedObjectList is the list of objects in the provider account.

func (*SharedObjectList) CloneMessageVT

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

func (*SharedObjectList) CloneVT

func (m *SharedObjectList) CloneVT() *SharedObjectList

func (*SharedObjectList) EqualMessageVT

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

func (*SharedObjectList) EqualVT

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

func (*SharedObjectList) GetSharedObjects

func (x *SharedObjectList) GetSharedObjects() []*SharedObjectListEntry

func (*SharedObjectList) MarshalJSON

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

MarshalJSON marshals the SharedObjectList to JSON.

func (*SharedObjectList) MarshalProtoJSON

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

MarshalProtoJSON marshals the SharedObjectList message to JSON.

func (*SharedObjectList) MarshalProtoText

func (x *SharedObjectList) MarshalProtoText() string

func (*SharedObjectList) MarshalToSizedBufferVT

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

func (*SharedObjectList) MarshalToVT

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

func (*SharedObjectList) MarshalVT

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

func (*SharedObjectList) ProtoMessage

func (*SharedObjectList) ProtoMessage()

func (*SharedObjectList) Reset

func (x *SharedObjectList) Reset()

func (*SharedObjectList) SizeVT

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

func (*SharedObjectList) String

func (x *SharedObjectList) String() string

func (*SharedObjectList) UnmarshalJSON

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

UnmarshalJSON unmarshals the SharedObjectList from JSON.

func (*SharedObjectList) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SharedObjectList message from JSON.

func (*SharedObjectList) UnmarshalVT

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

type SharedObjectListEntry

type SharedObjectListEntry struct {

	// Ref is the reference to the shared object.
	Ref *SharedObjectRef `protobuf:"bytes,1,opt,name=ref,proto3" json:"ref,omitempty"`
	// Meta is the metadata for the shared object.
	Meta *SharedObjectMeta `protobuf:"bytes,2,opt,name=meta,proto3" json:"meta,omitempty"`
	// Source indicates how the shared object was acquired.
	// Known values: "created" (owner-created), "shared" (invite-received or org-enrolled).
	Source string `protobuf:"bytes,3,opt,name=source,proto3" json:"source,omitempty"`
	// TransportPeerId is the verified invite endpoint retained for reconnect.
	// Empty for entries created before this field was added.
	TransportPeerId string `protobuf:"bytes,4,opt,name=transport_peer_id,json=transportPeerId,proto3" json:"transportPeerId,omitempty"`
	// contains filtered or unexported fields
}

SharedObjectListEntry is an entry in the SharedObjectList.

func (*SharedObjectListEntry) CloneMessageVT

func (*SharedObjectListEntry) CloneVT

func (*SharedObjectListEntry) EqualMessageVT

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

func (*SharedObjectListEntry) EqualVT

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

func (*SharedObjectListEntry) GetMeta

func (*SharedObjectListEntry) GetRef

func (*SharedObjectListEntry) GetSource

func (x *SharedObjectListEntry) GetSource() string

func (*SharedObjectListEntry) GetTransportPeerId added in v0.57.4

func (x *SharedObjectListEntry) GetTransportPeerId() string

func (*SharedObjectListEntry) MarshalJSON

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

MarshalJSON marshals the SharedObjectListEntry to JSON.

func (*SharedObjectListEntry) MarshalProtoJSON

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

MarshalProtoJSON marshals the SharedObjectListEntry message to JSON.

func (*SharedObjectListEntry) MarshalProtoText

func (x *SharedObjectListEntry) MarshalProtoText() string

func (*SharedObjectListEntry) MarshalToSizedBufferVT

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

func (*SharedObjectListEntry) MarshalToVT

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

func (*SharedObjectListEntry) MarshalVT

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

func (*SharedObjectListEntry) ProtoMessage

func (*SharedObjectListEntry) ProtoMessage()

func (*SharedObjectListEntry) Reset

func (x *SharedObjectListEntry) Reset()

func (*SharedObjectListEntry) SizeVT

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

func (*SharedObjectListEntry) String

func (x *SharedObjectListEntry) String() string

func (*SharedObjectListEntry) UnmarshalJSON

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

UnmarshalJSON unmarshals the SharedObjectListEntry from JSON.

func (*SharedObjectListEntry) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SharedObjectListEntry message from JSON.

func (*SharedObjectListEntry) UnmarshalVT

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

type SharedObjectMeta

type SharedObjectMeta struct {

	// BodyType is the type of object in the body of the shared object.
	// Known types: "space"
	BodyType string `protobuf:"bytes,1,opt,name=body_type,json=bodyType,proto3" json:"bodyType,omitempty"`
	// BodyMeta is additional metadata about the shared object body.
	BodyMeta []byte `protobuf:"bytes,2,opt,name=body_meta,json=bodyMeta,proto3" json:"bodyMeta,omitempty"`
	// AccountPrivate marks a shared object as private to one account and not
	// eligible for transfer, merge, or ownership-migration flows.
	AccountPrivate bool `protobuf:"varint,3,opt,name=account_private,json=accountPrivate,proto3" json:"accountPrivate,omitempty"`
	// contains filtered or unexported fields
}

SharedObjectMeta is the contents of the provider_feature_meta field for a SharedObject.

func (*SharedObjectMeta) CloneMessageVT

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

func (*SharedObjectMeta) CloneVT

func (m *SharedObjectMeta) CloneVT() *SharedObjectMeta

func (*SharedObjectMeta) EqualMessageVT

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

func (*SharedObjectMeta) EqualVT

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

func (*SharedObjectMeta) GetAccountPrivate

func (x *SharedObjectMeta) GetAccountPrivate() bool

func (*SharedObjectMeta) GetBodyMeta

func (x *SharedObjectMeta) GetBodyMeta() []byte

func (*SharedObjectMeta) GetBodyType

func (x *SharedObjectMeta) GetBodyType() string

func (*SharedObjectMeta) MarshalJSON

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

MarshalJSON marshals the SharedObjectMeta to JSON.

func (*SharedObjectMeta) MarshalProtoJSON

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

MarshalProtoJSON marshals the SharedObjectMeta message to JSON.

func (*SharedObjectMeta) MarshalProtoText

func (x *SharedObjectMeta) MarshalProtoText() string

func (*SharedObjectMeta) MarshalToSizedBufferVT

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

func (*SharedObjectMeta) MarshalToVT

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

func (*SharedObjectMeta) MarshalVT

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

func (*SharedObjectMeta) ProtoMessage

func (*SharedObjectMeta) ProtoMessage()

func (*SharedObjectMeta) Reset

func (x *SharedObjectMeta) Reset()

func (*SharedObjectMeta) SizeVT

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

func (*SharedObjectMeta) String

func (x *SharedObjectMeta) String() string

func (*SharedObjectMeta) UnmarshalJSON

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

UnmarshalJSON unmarshals the SharedObjectMeta from JSON.

func (*SharedObjectMeta) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SharedObjectMeta message from JSON.

func (*SharedObjectMeta) UnmarshalVT

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

func (*SharedObjectMeta) Validate

func (m *SharedObjectMeta) Validate() error

Validate validates the metadata.

type SharedObjectProvider

type SharedObjectProvider interface {
	provider.ProviderAccountFeature

	// CreateSharedObject creates a new shared object with the given details.
	// The ID may not necessarily be used for the shared object ID.
	// ownerType is "account" or "organization"; ownerID is the principal id
	// (account id for account-owned, org id for org-owned).
	CreateSharedObject(ctx context.Context, id string, meta *SharedObjectMeta, ownerType, ownerID string) (*SharedObjectRef, error)

	// MountSharedObject attempts to mount a SharedObject returning the object handle and a release function.
	//
	// This also mounts the block store associated with the shared object.
	//
	// note: use the MountSharedObject directive to call this.
	// usually called by the provider controller
	MountSharedObject(ctx context.Context, ref *SharedObjectRef, released func()) (SharedObject, func(), error)

	// DeleteSharedObject deletes the shared object with the given ID.
	// Removes from the shared object list, cleans up GC references,
	// and removes the bucket from the volume.
	DeleteSharedObject(ctx context.Context, id string) error

	// AccessSharedObjectList adds a reference to the list of shared objects and returns the container.
	// Returns a release function. Accepts a function that is called if the Watchable becomes invalid.
	AccessSharedObjectList(ctx context.Context, released func()) (ccontainer.Watchable[*SharedObjectList], func(), error)

	// RefreshSharedObjectList invalidates and reloads the current shared object
	// list snapshot when the provider has a remote list source.
	RefreshSharedObjectList(ctx context.Context) error
}

SharedObjectProvider implements ProviderFeature_SHARED_OBJECT.

func GetSharedObjectProviderAccountFeature

func GetSharedObjectProviderAccountFeature(ctx context.Context, provAcc provider.ProviderAccount) (SharedObjectProvider, error)

GetSharedObjectProviderAccountFeature returns the SharedObjectProvider for a ProviderAccount.

type SharedObjectReadCheckpoint

type SharedObjectReadCheckpoint struct {
	// Config records the audience at departure.
	Config *SharedObjectConfig
	// Snapshot is the state held at departure. Replaying it yields the World
	// the participant last could read.
	Snapshot SharedObjectStateSnapshot
}

SharedObjectReadCheckpoint records the state a participant last held before read access ended. It is descriptive history, never current participant authority.

type SharedObjectReadCheckpointAccessor

type SharedObjectReadCheckpointAccessor interface {
	// GetSharedObjectReadCheckpoint returns nil when no history was retained.
	GetSharedObjectReadCheckpoint(ctx context.Context) (*SharedObjectReadCheckpoint, error)
}

SharedObjectReadCheckpointAccessor exposes history retained before read access ended. The checkpoint conveys no current membership or write authority.

type SharedObjectRecoveryDecoder

type SharedObjectRecoveryDecoder interface {
	// DecryptSharedObjectRecoveryEnvelope decrypts the envelope into recovery material.
	DecryptSharedObjectRecoveryEnvelope(ctx context.Context, env *SOEntityRecoveryEnvelope) (*SOEntityRecoveryMaterial, error)
}

SharedObjectRecoveryDecoder decrypts shared object recovery envelopes.

type SharedObjectRecoveryProvider

type SharedObjectRecoveryProvider interface {
	provider.ProviderAccountFeature

	// GetSelfEntityID returns the stable entity ID for the mounted provider account.
	GetSelfEntityID(ctx context.Context) (string, error)

	// ReadSharedObjectRecoveryEnvelope reads the current recovery envelope for the entity on an SO.
	ReadSharedObjectRecoveryEnvelope(ctx context.Context, ref *SharedObjectRef) (*SOEntityRecoveryEnvelope, error)

	// GetSharedObjectRecoveryDecoder returns a provider-owned decoder for recovery envelopes.
	GetSharedObjectRecoveryDecoder(ctx context.Context) (SharedObjectRecoveryDecoder, error)
}

SharedObjectRecoveryProvider implements ProviderFeature_SHARED_OBJECT_RECOVERY.

func GetSharedObjectRecoveryProviderAccountFeature

func GetSharedObjectRecoveryProviderAccountFeature(ctx context.Context, provAcc provider.ProviderAccount) (SharedObjectRecoveryProvider, error)

GetSharedObjectRecoveryProviderAccountFeature returns the SharedObjectRecoveryProvider for a ProviderAccount.

type SharedObjectRef

type SharedObjectRef struct {

	// ProviderResourceRef is the reference to the resource on the provider.
	ProviderResourceRef *provider.ProviderResourceRef `protobuf:"bytes,1,opt,name=provider_resource_ref,json=providerResourceRef,proto3" json:"providerResourceRef,omitempty"`
	// BlockStoreId is the identifier of the block store.
	// The block store must exist on the same provider + account id.
	BlockStoreId string `protobuf:"bytes,2,opt,name=block_store_id,json=blockStoreId,proto3" json:"blockStoreId,omitempty"`
	// contains filtered or unexported fields
}

SharedObjectRef is a reference to a shared object managed by a provider.

func NewSharedObjectRef

func NewSharedObjectRef(providerID, providerAccountID, sobjectID, blockStoreID string) *SharedObjectRef

NewSharedObjectRef builds a new SharedObjectRef.

func UnmarshalSharedObjectRef

func UnmarshalSharedObjectRef(ctx context.Context, bcs *block.Cursor) (*SharedObjectRef, error)

UnmarshalSharedObjectRef unmarshals a SharedObjectRef from a block cursor.

func (*SharedObjectRef) CloneMessageVT

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

func (*SharedObjectRef) CloneVT

func (m *SharedObjectRef) CloneVT() *SharedObjectRef

func (*SharedObjectRef) EqualMessageVT

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

func (*SharedObjectRef) EqualVT

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

func (*SharedObjectRef) GetBlockStoreId

func (x *SharedObjectRef) GetBlockStoreId() string

func (*SharedObjectRef) GetLogger

func (i *SharedObjectRef) GetLogger(le *logrus.Entry) *logrus.Entry

GetLogger adds debug values to the logger.

func (*SharedObjectRef) GetProviderResourceRef

func (x *SharedObjectRef) GetProviderResourceRef() *provider.ProviderResourceRef

func (*SharedObjectRef) MarshalBlock

func (i *SharedObjectRef) MarshalBlock() ([]byte, error)

MarshalBlock marshals the block to binary. This is the initial step of marshaling, before transformations.

func (*SharedObjectRef) MarshalJSON

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

MarshalJSON marshals the SharedObjectRef to JSON.

func (*SharedObjectRef) MarshalProtoJSON

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

MarshalProtoJSON marshals the SharedObjectRef message to JSON.

func (*SharedObjectRef) MarshalProtoText

func (x *SharedObjectRef) MarshalProtoText() string

func (*SharedObjectRef) MarshalToSizedBufferVT

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

func (*SharedObjectRef) MarshalToVT

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

func (*SharedObjectRef) MarshalVT

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

func (*SharedObjectRef) ProtoMessage

func (*SharedObjectRef) ProtoMessage()

func (*SharedObjectRef) Reset

func (x *SharedObjectRef) Reset()

func (*SharedObjectRef) SizeVT

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

func (*SharedObjectRef) String

func (x *SharedObjectRef) String() string

func (*SharedObjectRef) UnmarshalBlock

func (i *SharedObjectRef) UnmarshalBlock(data []byte) error

UnmarshalBlock unmarshals the block to the object. This is the final step of decoding, after transformations.

func (*SharedObjectRef) UnmarshalJSON

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

UnmarshalJSON unmarshals the SharedObjectRef from JSON.

func (*SharedObjectRef) UnmarshalProtoJSON

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

UnmarshalProtoJSON unmarshals the SharedObjectRef message from JSON.

func (*SharedObjectRef) UnmarshalVT

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

func (*SharedObjectRef) Validate

func (i *SharedObjectRef) Validate() error

Validate validates the shared object ref.

type SharedObjectStateSnapshot

type SharedObjectStateSnapshot interface {
	// GetParticipantConfigForPeer returns a participant in the accepted config.
	GetParticipantConfigForPeer(ctx context.Context, peerID string) (*SOParticipantConfig, error)
	// GetParticipantConfig returns the participant record for our participant.
	// uses the peer identity from the SharedObject.
	// returns ErrNotParticipant if the local peer is not a participant.
	GetParticipantConfig(ctx context.Context) (*SOParticipantConfig, error)
	// GetConfig returns the accepted config.
	GetConfig(ctx context.Context) (*SharedObjectConfig, error)
	// GetConfigByHash returns the config with the given config chain hash.
	// Returns ErrConfigHistoryUnavailable when the config is not retained.
	GetConfigByHash(ctx context.Context, hash []byte) (*SharedObjectConfig, error)

	// GetTransformer returns the transformer of the current key epoch, which
	// encrypts new operations and checkpoints.
	GetTransformer(ctx context.Context) (*block_transform.Transformer, error)

	// GetTransformInfo returns redacted transform configuration for display.
	// Decrypts the local participant's grant to extract step configs, then
	// strips sensitive fields (encryption keys). Returns epoch and grant count.
	GetTransformInfo(ctx context.Context) (*TransformInfo, error)

	// GetCheckpoint returns the checkpoint body with its state data decoded.
	// Returns nil, nil before the first checkpoint.
	GetCheckpoint(ctx context.Context) (*SOCheckpointInner, error)

	// GetOperationSet returns the verified operations above the checkpoint.
	// Callers must not modify the returned set.
	GetOperationSet(ctx context.Context) (*SOOperationSet, error)

	// DecodeOperation returns the operation data decoded with the key of the
	// epoch the operation names. Returns ErrKeyEpochUnavailable when the local
	// peer holds no grant for that epoch.
	DecodeOperation(ctx context.Context, inner *SOOperationInner) ([]byte, error)
}

SharedObjectStateSnapshot is the state snapshot interface for the SharedObject.

type StateHost

type StateHost interface {
	// GetSOHost returns the SOHost holding the state.
	GetSOHost() *SOHost
	// GetPrivKey returns the private key of the local participant.
	GetPrivKey() crypto.PrivKey
}

StateHost is an optional interface on SharedObject implementations that hold the state on this device. The World engine checkpoints and votes in the group's decisions through it.

type TransformInfo

type TransformInfo struct {
	// Steps contains the transform steps with sensitive fields redacted.
	Steps []*block_transform.StepConfig
	// GrantCount is the number of participants with active grants.
	GrantCount uint32
}

TransformInfo contains redacted transform configuration for display.

Directories

Path Synopsis
world

Jump to

Keyboard shortcuts

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