verifreg

package
v7.0.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: Apache-2.0, MIT Imports: 16 Imported by: 8

Documentation

Index

Constants

View Source
const SignatureDomainSeparation_RemoveDataCap = "fil_removedatacap:"

Variables

View Source
var MinVerifiedDealSize = abi.NewStoragePower(1 << 20)

Functions

This section is empty.

Types

type Actor

type Actor struct{}

func (Actor) AddVerifiedClient

func (a Actor) AddVerifiedClient(rt runtime.Runtime, params *AddVerifiedClientParams) *abi.EmptyValue

func (Actor) AddVerifier

func (a Actor) AddVerifier(rt runtime.Runtime, params *AddVerifierParams) *abi.EmptyValue

func (Actor) Code

func (a Actor) Code() cid.Cid

func (Actor) Constructor

func (a Actor) Constructor(rt runtime.Runtime, rootKey *addr.Address) *abi.EmptyValue

func (Actor) Exports

func (a Actor) Exports() []interface{}

func (Actor) IsSingleton

func (a Actor) IsSingleton() bool

func (Actor) RemoveVerifiedClientDataCap

func (a Actor) RemoveVerifiedClientDataCap(rt runtime.Runtime, params *RemoveDataCapParams) *RemoveDataCapReturn

sender must be the VRK, and message must include proof that 2 verifiers signed the proposal

func (Actor) RemoveVerifier

func (a Actor) RemoveVerifier(rt runtime.Runtime, verifierAddr *addr.Address) *abi.EmptyValue

func (Actor) RestoreBytes

func (a Actor) RestoreBytes(rt runtime.Runtime, params *RestoreBytesParams) *abi.EmptyValue

Called by HandleInitTimeoutDeals from StorageMarketActor when a VerifiedDeal fails to init. Restore allowable cap for the client, creating new entry if the client has been deleted.

func (Actor) State

func (a Actor) State() cbor.Er

func (Actor) UseBytes

func (a Actor) UseBytes(rt runtime.Runtime, params *UseBytesParams) *abi.EmptyValue

Called by StorageMarketActor during PublishStorageDeals. Do not allow partially verified deals (DealSize must be greater than equal to allowed cap). Delete VerifiedClient if remaining DataCap is smaller than minimum VerifiedDealSize.

type AddVerifiedClientParams

type AddVerifiedClientParams = verifreg0.AddVerifiedClientParams
type AddVerifiedClientParams struct {
	Address   addr.Address
	Allowance DataCap
}

type AddVerifierParams

type AddVerifierParams = verifreg0.AddVerifierParams
type AddVerifierParams struct {
	Address   addr.Address
	Allowance DataCap
}

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 = verifreg0.RestoreBytesParams
type RestoreBytesParams struct {
	Address  addr.Address
	DealSize abi.StoragePower
}

type RmDcProposalID

type RmDcProposalID struct {
	ProposalID uint64
}

func (*RmDcProposalID) MarshalCBOR

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

func (*RmDcProposalID) UnmarshalCBOR

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

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

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

func CheckStateInvariants

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

Checks internal invariants of verified registry state.

type UseBytesParams

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

Jump to

Keyboard shortcuts

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