verifreg

package
v0.11.0-alpha-2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: Apache-2.0, MIT Imports: 12 Imported by: 27

Documentation

Index

Constants

View Source
const SignatureDomainSeparation_RemoveDataCap = "fil_removedatacap:"

Variables

View Source
var Methods = map[abi.MethodNum]builtin.MethodMeta{
	1: {"Constructor", *new(func(*address.Address) *abi.EmptyValue)},
	2: {"AddVerifier", *new(func(*AddVerifierParams) *abi.EmptyValue)},
	3: {"RemoveVerifier", *new(func(*address.Address) *abi.EmptyValue)},
	4: {"AddVerifiedClient", *new(func(*AddVerifiedClientParams) *abi.EmptyValue)},
	5: {"UseBytes", *new(func(*UseBytesParams) *abi.EmptyValue)},
	6: {"RestoreBytes", *new(func(*RestoreBytesParams) *abi.EmptyValue)},
	7: {"RemoveVerifiedClientDataCap", *new(func(*RemoveDataCapParams) *RemoveDataCapReturn)},
}
View Source
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)

Functions

This section is empty.

Types

type AddVerifiedClientParams

type AddVerifiedClientParams struct {
	Address   addr.Address
	Allowance DataCap
}

func (*AddVerifiedClientParams) MarshalCBOR

func (t *AddVerifiedClientParams) MarshalCBOR(w io.Writer) error

func (*AddVerifiedClientParams) UnmarshalCBOR

func (t *AddVerifiedClientParams) UnmarshalCBOR(r io.Reader) error

type AddVerifierParams

type AddVerifierParams struct {
	Address   addr.Address
	Allowance DataCap
}

func (*AddVerifierParams) MarshalCBOR

func (t *AddVerifierParams) MarshalCBOR(w io.Writer) error

func (*AddVerifierParams) UnmarshalCBOR

func (t *AddVerifierParams) UnmarshalCBOR(r io.Reader) error

type DataCap

type DataCap = abi.StoragePower

DataCap is an integer number of bytes. We can introduce policy changes and replace this in the future.

type RemoveDataCapParams

type RemoveDataCapParams struct {
	VerifiedClientToRemove addr.Address
	DataCapAmountToRemove  DataCap
	VerifierRequest1       RemoveDataCapRequest
	VerifierRequest2       RemoveDataCapRequest
}

func (*RemoveDataCapParams) MarshalCBOR

func (t *RemoveDataCapParams) MarshalCBOR(w io.Writer) error

func (*RemoveDataCapParams) UnmarshalCBOR

func (t *RemoveDataCapParams) UnmarshalCBOR(r io.Reader) error

type RemoveDataCapProposal

type RemoveDataCapProposal struct {
	// VerifiedClient is the client address to remove the DataCap from
	// The address must be an ID address
	VerifiedClient addr.Address
	// DataCapAmount is the amount of DataCap to be removed from the VerifiedClient address
	DataCapAmount DataCap
	// RemovalProposalID is the counter of the proposal sent by the Verifier for the VerifiedClient
	RemovalProposalID RmDcProposalID
}

A verifier who wants to send/agree to a RemoveDataCapRequest should sign a RemoveDataCapProposal and send the signed proposal to the root key holder.

func (*RemoveDataCapProposal) MarshalCBOR

func (t *RemoveDataCapProposal) MarshalCBOR(w io.Writer) error

func (*RemoveDataCapProposal) UnmarshalCBOR

func (t *RemoveDataCapProposal) UnmarshalCBOR(r io.Reader) error

type RemoveDataCapRequest

type RemoveDataCapRequest struct {
	// Verifier is the verifier address used for VerifierSignature.
	// The address can be address.SECP256K1 or address.BLS
	Verifier addr.Address
	// VerifierSignature is the Verifier's signature over a RemoveDataCapProposal
	VerifierSignature crypto.Signature
}

A verifier who wants to submit a request should send their RemoveDataCapRequest to the RKH.

func (*RemoveDataCapRequest) MarshalCBOR

func (t *RemoveDataCapRequest) MarshalCBOR(w io.Writer) error

func (*RemoveDataCapRequest) UnmarshalCBOR

func (t *RemoveDataCapRequest) UnmarshalCBOR(r io.Reader) error

type RemoveDataCapReturn

type RemoveDataCapReturn struct {
	VerifiedClient addr.Address
	DataCapRemoved DataCap
}

func (*RemoveDataCapReturn) MarshalCBOR

func (t *RemoveDataCapReturn) MarshalCBOR(w io.Writer) error

func (*RemoveDataCapReturn) UnmarshalCBOR

func (t *RemoveDataCapReturn) UnmarshalCBOR(r io.Reader) error

type RestoreBytesParams

type RestoreBytesParams struct {
	Address  addr.Address
	DealSize abi.StoragePower
}

func (*RestoreBytesParams) MarshalCBOR

func (t *RestoreBytesParams) MarshalCBOR(w io.Writer) error

func (*RestoreBytesParams) UnmarshalCBOR

func (t *RestoreBytesParams) UnmarshalCBOR(r io.Reader) error

type RmDcProposalID

type RmDcProposalID = uint64

type State

type State struct {
	// Root key holder multisig.
	// Authorize and remove verifiers.
	RootKey addr.Address

	// Verifiers authorize VerifiedClients.
	// Verifiers delegate their DataCap.
	Verifiers cid.Cid // HAMT[addr.Address]DataCap

	// VerifiedClients can add VerifiedClientData, up to DataCap.
	VerifiedClients cid.Cid // HAMT[addr.Address]DataCap

	// RemoveDataCapProposalIDs keeps the counters of the datacap removal proposal a verifier has submitted for a
	//specific client. Unique proposal ids ensure that removal proposals cannot be replayed.√
	// AddrPairKey is constructed as <verifier address, client address>, both using ID addresses.
	RemoveDataCapProposalIDs cid.Cid // HAMT[AddrPairKey]RmDcProposalID
}

func ConstructState

func ConstructState(store adt.Store, rootKeyAddress addr.Address) (*State, error)

rootKeyAddress comes from genesis.

func (*State) MarshalCBOR

func (t *State) MarshalCBOR(w io.Writer) error

func (*State) UnmarshalCBOR

func (t *State) UnmarshalCBOR(r io.Reader) error

type StateSummary added in v0.9.3

type StateSummary struct {
	Verifiers map[addr.Address]DataCap
	Clients   map[addr.Address]DataCap
}

func CheckStateInvariants added in v0.9.3

func CheckStateInvariants(st *State, store adt.Store) (*StateSummary, *builtin.MessageAccumulator)

Checks internal invariants of verified registry state.

type UseBytesParams

type UseBytesParams struct {
	Address  addr.Address     // Address of verified client.
	DealSize abi.StoragePower // Number of bytes to use.
}

func (*UseBytesParams) MarshalCBOR

func (t *UseBytesParams) MarshalCBOR(w io.Writer) error

func (*UseBytesParams) UnmarshalCBOR

func (t *UseBytesParams) UnmarshalCBOR(r io.Reader) error

Jump to

Keyboard shortcuts

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