Documentation
¶
Index ¶
- Constants
- func BuildSha254Memtree(rawIn io.Reader, size abi.UnpaddedPieceSize) ([]byte, error)
- func BuildSha254MemtreeFromSnapshot(data []byte) ([]byte, error)
- func BuildTreeD(data io.Reader, unpaddedData bool, outPath string, size abi.PaddedPieceSize) (_ cid.Cid, err error)
- func ComputeBinShaParent(left, right [NODE_SIZE]byte) [NODE_SIZE]byte
- func DecodeHasherDomain[H HasherDomain](r io.Reader) (H, error)
- func DeriveInteractiveChallenges(challengesPerPartition uint64, sectorNnodes SectorNodes, ReplicaID Commitment, ...) []uint64
- func EncodeColumn[H HasherDomain](w io.Writer, c Column[H]) error
- func EncodeColumnProof[H HasherDomain](w io.Writer, cp ColumnProof[H]) error
- func EncodeCommit1OutRaw(w io.Writer, c Commit1OutRaw) error
- func EncodeCommitment(w io.Writer, c Commitment) error
- func EncodeEncodingProof[H HasherDomain](w io.Writer, ep EncodingProof[H]) error
- func EncodeHasherDomain[H HasherDomain](w io.Writer, h H) error
- func EncodeInclusionPath[H HasherDomain](w io.Writer, ip InclusionPath[H]) error
- func EncodeLabelingProof[H HasherDomain](w io.Writer, lp LabelingProof[H]) error
- func EncodeLabels(w io.Writer, labels TAuxLabels) error
- func EncodeMerkleProof[H HasherDomain](w io.Writer, m MerkleProof[H]) error
- func EncodePathElement[H HasherDomain](w io.Writer, pe PathElement[H]) error
- func EncodeProofData[H HasherDomain](w io.Writer, pd ProofData[H]) error
- func EncodeReplicaColumnProof[H HasherDomain](w io.Writer, rcp ReplicaColumnProof[H]) error
- func EncodeSingleProof[H HasherDomain](w io.Writer, sp SingleProof[H]) error
- func EncodeStoreConfig(w io.Writer, sc StoreConfig) error
- func EncodeSubProof[H HasherDomain](w io.Writer, sp SubProof[H]) error
- func EncodeTAux(w io.Writer, taux TemporaryAux) error
- func EncodeTicket(w io.Writer, t Ticket) error
- func EncodeTopProof[H HasherDomain](w io.Writer, tp TopProof[H]) error
- func EncodeVanillaStackedProof(w io.Writer, v VanillaStackedProof) error
- func EnsureTauxForType(spt abi.RegisteredSealProof, path string) error
- func NodeLevel(leaves, arity int64) int
- func ProveAllPartitions()
- func ProveLayers()
- func ReadLE[T any](r io.Reader) (T, error)
- func ReadPAux(cache string) ([32]byte, [32]byte, error)
- func ReadString(r io.Reader) (string, error)
- func StringProofFromAbi(p abi.RegisteredSealProof) (string, error)
- func VerifyProof(leaf [32]byte, siblings [][32]byte, root [32]byte, position uint64) bool
- func VerifyWindowPoStVanilla(pvi proof.WindowPoStVerifyInfo) (bool, error)
- func WriteLE[T any](w io.Writer, data T) error
- func WritePAux(cache string, commC, commRLast [32]byte) error
- func WriteString(w io.Writer, s string) error
- type CacheProofParams
- type Column
- type ColumnProof
- type Commit1OutRaw
- type Commitment
- type DataCIDSize
- type DataCidWriter
- type EncodingProof
- type FallbackPoStSectorProof
- type HasherDomain
- type InclusionPath
- type Label
- type LabelingProof
- type Labels
- type MerkleProof
- type PathElement
- type PieceReader
- type PoStConfig
- type PoStType
- type PoseidonDomain
- type PreCommit1OutRaw
- type ProofCache
- type ProofData
- type PublicReplicaInfo
- type RawMerkleProof
- type ReplicaColumnProof
- type SectionReadCloser
- type SectorNodes
- type SectorProof
- type Sha256Domain
- type SingleProof
- type Snap
- type StoreConfig
- type StringRegisteredProofType
- type SubProof
- type TAuxLabels
- type TemporaryAux
- type Ticket
- type TopProof
- type VanillaProof
- type VanillaStackedProof
Constants ¶
const ( WinningPostChallengeCount = 66 WinningPostSectorCount = 1 WindowPostChallengeCount = 10 )
const CommPBuf = abi.UnpaddedPieceSize(commPBufPad - (commPBufPad / 128)) // can't use .Unpadded() for const
const MaxMemtreeSize = 1 << 30
const NODE_SIZE = 32
const PauxFile = "p_aux"
Variables ¶
This section is empty.
Functions ¶
func BuildSha254Memtree ¶ added in v1.25.1
BuildSha254Memtree builds a sha256 memtree from the input data Returned slice should be released to the pool after use
func BuildSha254MemtreeFromSnapshot ¶ added in v1.27.2
func BuildTreeD ¶
func ComputeBinShaParent ¶ added in v1.25.1
func DecodeHasherDomain ¶ added in v1.23.1
func DecodeHasherDomain[H HasherDomain](r io.Reader) (H, error)
func DeriveInteractiveChallenges ¶ added in v1.23.1
func DeriveInteractiveChallenges( challengesPerPartition uint64, sectorNnodes SectorNodes, ReplicaID Commitment, Seed Ticket, k uint8, ) []uint64
func EncodeColumn ¶ added in v1.26.0
func EncodeColumn[H HasherDomain](w io.Writer, c Column[H]) error
func EncodeColumnProof ¶ added in v1.26.0
func EncodeColumnProof[H HasherDomain](w io.Writer, cp ColumnProof[H]) error
func EncodeCommit1OutRaw ¶ added in v1.26.0
func EncodeCommit1OutRaw(w io.Writer, c Commit1OutRaw) error
EncodeCommit1OutRaw serializes Commit1OutRaw into w in the same bincode style that DecodeCommit1OutRaw expects.
func EncodeCommitment ¶ added in v1.26.0
func EncodeCommitment(w io.Writer, c Commitment) error
EncodeCommitment is likewise just 32 raw bytes. Must match decoding logic.
func EncodeEncodingProof ¶ added in v1.26.0
func EncodeEncodingProof[H HasherDomain](w io.Writer, ep EncodingProof[H]) error
func EncodeHasherDomain ¶ added in v1.26.0
func EncodeHasherDomain[H HasherDomain](w io.Writer, h H) error
EncodeHasherDomain writes a HasherDomain (e.g. [32]byte) in LE order matching the decode. For a [32]byte it’s just 32 raw bytes, no reordering.
func EncodeInclusionPath ¶ added in v1.26.0
func EncodeInclusionPath[H HasherDomain](w io.Writer, ip InclusionPath[H]) error
func EncodeLabelingProof ¶ added in v1.26.0
func EncodeLabelingProof[H HasherDomain](w io.Writer, lp LabelingProof[H]) error
func EncodeLabels ¶ added in v1.23.1
func EncodeLabels(w io.Writer, labels TAuxLabels) error
func EncodeMerkleProof ¶ added in v1.26.0
func EncodeMerkleProof[H HasherDomain](w io.Writer, m MerkleProof[H]) error
EncodeMerkleProof writes a MerkleProof of type H.
func EncodePathElement ¶ added in v1.26.0
func EncodePathElement[H HasherDomain](w io.Writer, pe PathElement[H]) error
func EncodeProofData ¶ added in v1.26.0
func EncodeProofData[H HasherDomain](w io.Writer, pd ProofData[H]) error
EncodeProofData checks Single, Sub, or Top and writes the matching tag + data.
func EncodeReplicaColumnProof ¶ added in v1.26.0
func EncodeReplicaColumnProof[H HasherDomain](w io.Writer, rcp ReplicaColumnProof[H]) error
func EncodeSingleProof ¶ added in v1.26.0
func EncodeSingleProof[H HasherDomain](w io.Writer, sp SingleProof[H]) error
func EncodeStoreConfig ¶ added in v1.23.1
func EncodeStoreConfig(w io.Writer, sc StoreConfig) error
func EncodeSubProof ¶ added in v1.26.0
func EncodeSubProof[H HasherDomain](w io.Writer, sp SubProof[H]) error
func EncodeTAux ¶ added in v1.23.1
func EncodeTAux(w io.Writer, taux TemporaryAux) error
func EncodeTicket ¶ added in v1.26.0
EncodeTicket is simply 32 raw bytes. Must match decoding logic.
func EncodeTopProof ¶ added in v1.26.0
func EncodeTopProof[H HasherDomain](w io.Writer, tp TopProof[H]) error
func EncodeVanillaStackedProof ¶ added in v1.26.0
func EncodeVanillaStackedProof(w io.Writer, v VanillaStackedProof) error
EncodeVanillaStackedProof serializes a single VanillaStackedProof.
func EnsureTauxForType ¶ added in v1.23.1
func EnsureTauxForType(spt abi.RegisteredSealProof, path string) error
EnsureTauxForType ensures that the t_aux file exists in the specified path for the specified seal proof type. If the file does not exist, it will be created with the default values for the specified seal proof type.
func ProveAllPartitions ¶ added in v1.23.1
func ProveAllPartitions()
func ProveLayers ¶ added in v1.23.1
func ProveLayers()
func StringProofFromAbi ¶ added in v1.26.0
func StringProofFromAbi(p abi.RegisteredSealProof) (string, error)
func VerifyProof ¶ added in v1.27.3
VerifyProof walks a merkle inclusion proof from leaf to root using SHA254, returning true if the computed root matches the expected root.
At each level, if the position is even the node is on the left (hash(node||sibling)), if odd the node is on the right (hash(sibling||node)). SHA254 masking (clear top 2 bits of byte 31) is applied after each hash for BLS12-381 field compatibility.
This is a Go translation of the on-chain MerkleVerify.processInclusionProofMemory: https://github.com/FilOzone/pdp/blob/8ea3a99c11cc9194929408f603846e9965965ee5/src/Proofs.sol#L43-L60
func VerifyWindowPoStVanilla ¶ added in v1.26.0
func VerifyWindowPoStVanilla(pvi proof.WindowPoStVerifyInfo) (bool, error)
Types ¶
type CacheProofParams ¶ added in v1.27.3
type CacheProofParams struct {
SnapshotNodeIndex int64 // which snapshot node contains the challenged leaf
StartLeaf int64 // first leaf covered by this snapshot node
LeavesPerNode int64 // number of leaves per snapshot node (2^layerIdx)
SubTreeChallenge int64 // challenged leaf's position within the snapshot node's subtree
SectionOffset int64 // unpadded byte offset into piece data for this section
SectionLength int64 // unpadded byte length of the section
SubrootSize abi.PaddedPieceSize // padded size for the sub-section memtree
}
CacheProofParams holds the computed positions and byte ranges for generating a cached split proof. All fields are derived from the snapshot layer index and the challenged leaf position.
func ComputeCacheProofParams ¶ added in v1.27.3
func ComputeCacheProofParams(layerIdx int, challengedLeaf int64) CacheProofParams
ComputeCacheProofParams derives the snapshot-relative positions and byte ranges needed to generate a cached proof for the given challenged leaf.
type Column ¶ added in v1.23.1
type Column[H HasherDomain] struct { Index uint32 `json:"index"` Rows []H `json:"rows"` H any `json:"_h"` }
func DecodeColumn ¶ added in v1.23.1
func DecodeColumn[H HasherDomain](r io.Reader) (Column[H], error)
type ColumnProof ¶ added in v1.23.1
type ColumnProof[H HasherDomain] struct { Column Column[H] `json:"column"` InclusionProof MerkleProof[H] `json:"inclusion_proof"` }
func DecodeColumnProof ¶ added in v1.23.1
func DecodeColumnProof[H HasherDomain](r io.Reader) (ColumnProof[H], error)
type Commit1OutRaw ¶ added in v1.23.1
type Commit1OutRaw struct {
CommD Commitment `json:"comm_d"`
CommR Commitment `json:"comm_r"`
RegisteredProof StringRegisteredProofType `json:"registered_proof"`
ReplicaID Commitment `json:"replica_id"`
Seed Ticket `json:"seed"`
Ticket Ticket `json:"ticket"`
// ProofType -> [partitions] -> [challenge_index?] -> Proof
VanillaProofs map[StringRegisteredProofType][][]VanillaStackedProof `json:"vanilla_proofs"`
}
func DecodeCommit1OutRaw ¶ added in v1.23.1
func DecodeCommit1OutRaw(r io.Reader) (Commit1OutRaw, error)
type Commitment ¶ added in v1.23.1
type Commitment [32]byte
func DecodeCommitment ¶ added in v1.23.1
func DecodeCommitment(r io.Reader) (Commitment, error)
type DataCIDSize ¶ added in v1.23.1
type DataCIDSize struct {
PayloadSize int64
PieceSize abi.PaddedPieceSize
PieceCID cid.Cid
}
type DataCidWriter ¶ added in v1.23.1
type DataCidWriter struct {
// contains filtered or unexported fields
}
DataCidWriter is used as follows:
cc := new(DataCidWriter) _, err = io.Copy(cc, f) dc, err := cc.Sum()
This computes CommP / PieceCID from a stream, also returns piece and payload sizes.
func (*DataCidWriter) Sum ¶ added in v1.23.1
func (w *DataCidWriter) Sum() (DataCIDSize, error)
type EncodingProof ¶ added in v1.23.1
type EncodingProof[H HasherDomain] struct { Parents []H `json:"parents"` LayerIndex uint32 `json:"layer_index"` Node uint64 `json:"node"` }
func DecodeEncodingProof ¶ added in v1.23.1
func DecodeEncodingProof[H HasherDomain](r io.Reader) (EncodingProof[H], error)
type FallbackPoStSectorProof ¶ added in v1.26.0
type FallbackPoStSectorProof struct {
SectorID uint64 `json:"sector_id"`
CommR PoseidonDomain `json:"comm_r"`
VanillaProof VanillaProof `json:"vanilla_proof"`
}
FallbackPoStSectorProof corresponds to Rust:
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct FallbackPoStSectorProof<Tree: MerkleTreeTrait> {
pub sector_id: SectorId,
pub comm_r: <Tree::Hasher as Hasher>::Domain,
pub vanilla_proof: Proof<<Tree as MerkleTreeTrait>::Proof>,
}
func DecodeFallbackPoStSectorProof ¶ added in v1.26.0
func DecodeFallbackPoStSectorProof(r io.Reader) (FallbackPoStSectorProof, error)
DecodeFallbackPoStSectorProof decodes a single FallbackPoStSectorProof from the reader.
Rust struct reference for context: #[derive(Clone, Debug, Serialize, Deserialize)]
pub struct FallbackPoStSectorProof<Tree: MerkleTreeTrait> {
pub sector_id: SectorId,
pub comm_r: <Tree::Hasher as Hasher>::Domain,
pub vanilla_proof: Proof<<Tree as MerkleTreeTrait>::Proof>,
}
type HasherDomain ¶ added in v1.23.1
type HasherDomain = any
type InclusionPath ¶ added in v1.23.1
type InclusionPath[H HasherDomain] struct { Path []PathElement[H] `json:"path"` }
func DecodeInclusionPath ¶ added in v1.23.1
func DecodeInclusionPath[H HasherDomain](r io.Reader) (InclusionPath[H], error)
type LabelingProof ¶ added in v1.23.1
type LabelingProof[H HasherDomain] struct { Parents []H `json:"parents"` LayerIndex uint32 `json:"layer_index"` Node uint64 `json:"node"` }
func DecodeLabelingProof ¶ added in v1.23.1
func DecodeLabelingProof[H HasherDomain](r io.Reader) (LabelingProof[H], error)
type MerkleProof ¶ added in v1.23.1
type MerkleProof[H HasherDomain] struct { Data ProofData[H] `json:"data"` }
func DecodeMerkleProof ¶ added in v1.23.1
func DecodeMerkleProof[H HasherDomain](r io.Reader) (MerkleProof[H], error)
type PathElement ¶ added in v1.23.1
type PathElement[H HasherDomain] struct { Hashes []H `json:"hashes"` Index uint64 `json:"index"` }
func DecodePathElement ¶ added in v1.23.1
func DecodePathElement[H HasherDomain](r io.Reader) (PathElement[H], error)
type PieceReader ¶ added in v1.27.3
type PieceReader interface {
GetPieceReader(ctx context.Context, pieceCid cid.Cid) (SectionReadCloser, abi.UnpaddedPieceSize, error)
}
PieceReader abstracts reading raw (unpadded) piece data by CID. The returned reader must support both sequential reads and random access (io.ReaderAt) to allow section-based reads for cached proofs. The caller is responsible for closing the reader.
type PoStConfig ¶ added in v1.26.0
type PoStConfig struct {
PoStType PoStType
SectorSize abi.SectorSize
SectorCount int
ChallengeCount int
Priority bool
}
PoStConfig: controlling how many sectors per partition, how many challenges, etc.
func GetPoStConfig ¶ added in v1.26.0
func GetPoStConfig(sectorSize abi.SectorSize) *PoStConfig
fn window_post_info(sector_size: u64, api_version: ApiVersion) -> CircuitInfo {
with_shape!(
sector_size,
get_window_post_info,
&PoStConfig {
sector_size: SectorSize(sector_size),
challenge_count: WINDOW_POST_CHALLENGE_COUNT,
sector_count: *WINDOW_POST_SECTOR_COUNT
.read()
.expect("WINDOW_POST_SECTOR_COUNT poisoned")
.get(§or_size)
.expect("unknown sector size"),
typ: PoStType::Window,
priority: true,
api_version,
}
)
}
type PoseidonDomain ¶ added in v1.23.1
type PoseidonDomain [32]byte // Fr
func CommRLastFromTreeRLastRoots ¶ added in v1.27.3
func CommRLastFromTreeRLastRoots(roots []PoseidonDomain) (PoseidonDomain, error)
CommRLastFromTreeRLastRoots computes comm_r_last from the roots of the tree-r-last partition files (each root is the last 32 bytes of sc-02-data-tree-r-last[-N].dat).
Important: the Poseidon hashing here must match the rust-fil-proofs "compound merkle tree" reduction. In particular, when there are 16 partitions, fil-proofs reduces 16 -> 2 using an 8-arity hash twice, and then hashes those 2 with arity-2.
func (PoseidonDomain) MarshalJSON ¶ added in v1.26.0
func (p PoseidonDomain) MarshalJSON() ([]byte, error)
type PreCommit1OutRaw ¶ added in v1.23.1
type PreCommit1OutRaw struct {
LotusSealRand []byte `json:"_lotus_SealRandomness"`
CommD Commitment `json:"comm_d"`
Config Label `json:"config"`
Labels map[StringRegisteredProofType]Labels `json:"labels"`
RegisteredProof StringRegisteredProofType `json:"registered_proof"`
}
type ProofCache ¶ added in v1.27.3
type ProofCache interface {
GetLayerIndex(ctx context.Context, pieceCidV2 cid.Cid) (bool, int, error)
GetNode(ctx context.Context, pieceCidV2 cid.Cid, layerIdx int, index int64) (bool, [32]byte, error)
GetLayer(ctx context.Context, pieceCidV2 cid.Cid, layerIdx int) ([]byte, error)
}
ProofCache abstracts the snapshot layer cache (backed by CQL in production). GetLayer returns the full cached layer as concatenated 32-byte node hashes (a flat []byte slice of length numNodes * NODE_SIZE).
type ProofData ¶ added in v1.23.1
type ProofData[H HasherDomain] struct { Single *SingleProof[H] `json:"Single,omitempty"` Sub *SubProof[H] `json:"Sub,omitempty"` Top *TopProof[H] `json:"Top,omitempty"` }
func DecodeProofData ¶ added in v1.23.1
func DecodeProofData[H HasherDomain](r io.Reader) (ProofData[H], error)
type PublicReplicaInfo ¶ added in v1.26.0
type PublicReplicaInfo struct {
CommR PoseidonDomain
}
type RawMerkleProof ¶ added in v1.25.1
func CombineSplitProofs ¶ added in v1.27.3
func CombineSplitProofs(subProof, upperProof *RawMerkleProof) *RawMerkleProof
CombineSplitProofs joins a sub-tree proof (leaf -> snapshot node) with an upper proof (snapshot node -> root) into a single end-to-end proof.
func GenerateCachedProof ¶ added in v1.27.3
func GenerateCachedProof( ctx context.Context, reader PieceReader, cache ProofCache, pieceCidV2 cid.Cid, challengedLeaf int64, ) (*RawMerkleProof, error)
GenerateCachedProof builds a split merkle proof using a cached middle layer. It reads only the section of data around the challenged leaf (not the full piece), builds a small memtree for that section, then combines it with a proof from the cached snapshot layer up to the root.
This operates on a single piece. If the caller uses subpiece aggregation (piece composed of multiple subpieces), it should call this per-subpiece and join the result with any higher-level tree proof externally.
Returns (nil, nil) if no cache is available, signaling the caller to fall back to full memtree proof generation.
func MemtreeProof ¶ added in v1.25.1
func MemtreeProof(memtree []byte, leafIndex int64) (*RawMerkleProof, error)
MemtreeProof generates a Merkle proof for the given leaf index from the memtree. The memtree is a byte slice containing all the nodes of the Merkle tree, including leaves and internal nodes.
type ReplicaColumnProof ¶ added in v1.23.1
type ReplicaColumnProof[H HasherDomain] struct { C_X ColumnProof[H] `json:"c_x"` DrgParents []ColumnProof[H] `json:"drg_parents"` ExpParents []ColumnProof[H] `json:"exp_parents"` }
func DecodeReplicaColumnProof ¶ added in v1.23.1
func DecodeReplicaColumnProof[H HasherDomain](r io.Reader) (ReplicaColumnProof[H], error)
type SectionReadCloser ¶ added in v1.27.3
SectionReadCloser is a reader that supports both sequential and random access.
type SectorNodes ¶ added in v1.23.1
type SectorNodes uint64
SectorNodes is sector size as node count
type SectorProof ¶ added in v1.26.0
type SectorProof struct {
// One or more “MerkleProof” objects describing the inclusion paths
InclusionProofs []MerkleProof[PoseidonDomain] `json:"inclusion_proofs"`
CommC PoseidonDomain `json:"comm_c"`
CommRLast PoseidonDomain `json:"comm_r_last"`
}
SectorProof parallels Rust’s
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SectorProof<Proof: MerkleProofTrait> {
pub inclusion_proofs: Vec<MerkleProof<...>>,
pub comm_c: <Proof::Hasher as Hasher>::Domain,
pub comm_r_last: <Proof::Hasher as Hasher>::Domain,
}
func DecodeSectorProof ¶ added in v1.26.0
func DecodeSectorProof(r io.Reader) (SectorProof, error)
DecodeSectorProof decodes a single SectorProof from the reader.
Rust struct reference for context: #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct SectorProof<Proof: MerkleProofTrait> {
pub inclusion_proofs: Vec<Proof>,
pub comm_c: <Proof::Hasher as Hasher>::Domain,
pub comm_r_last: <Proof::Hasher as Hasher>::Domain,
}
type Sha256Domain ¶ added in v1.23.1
type Sha256Domain [32]byte
func (Sha256Domain) MarshalJSON ¶ added in v1.26.0
func (s Sha256Domain) MarshalJSON() ([]byte, error)
type SingleProof ¶ added in v1.23.1
type SingleProof[H HasherDomain] struct { Root H `json:"root"` Leaf H `json:"leaf"` Path InclusionPath[H] `json:"path"` }
func DecodeSingleProof ¶ added in v1.23.1
func DecodeSingleProof[H HasherDomain](r io.Reader) (SingleProof[H], error)
type Snap ¶ added in v1.26.0
type Snap struct {
ProofType abi.RegisteredUpdateProof
OldR Commitment `json:"old_r"`
NewR Commitment `json:"new_r"`
NewD Commitment `json:"new_d"`
// rust-fil-proofs bincoded repr; Todo is implementing types in Go
Proofs [][]byte
}
type StoreConfig ¶ added in v1.23.1
type StoreConfig struct {
// A directory in which data (a merkle tree) can be persisted.
Path string
// A unique identifier used to help specify the on-disk store location for this particular data.
ID string
// The number of elements in the DiskStore. This field is optional, and unused internally.
Size *uint64
// The number of merkle tree rows_to_discard then cache on disk.
RowsToDiscard uint64
}
func DecodeStoreConfig ¶ added in v1.23.1
func DecodeStoreConfig(r io.Reader) (StoreConfig, error)
type StringRegisteredProofType ¶ added in v1.23.1
type StringRegisteredProofType string // e.g. "StackedDrg2KiBV1", StackedDrg32GiBV1_1
func (StringRegisteredProofType) ToABI ¶ added in v1.26.0
func (s StringRegisteredProofType) ToABI() (abi.RegisteredSealProof, error)
// These enumerations must match the proofs library and never change. type RegisteredSealProof int64
const (
RegisteredSealProof_StackedDrg2KiBV1 = RegisteredSealProof(0) RegisteredSealProof_StackedDrg8MiBV1 = RegisteredSealProof(1) RegisteredSealProof_StackedDrg512MiBV1 = RegisteredSealProof(2) RegisteredSealProof_StackedDrg32GiBV1 = RegisteredSealProof(3) RegisteredSealProof_StackedDrg64GiBV1 = RegisteredSealProof(4) RegisteredSealProof_StackedDrg2KiBV1_1 = RegisteredSealProof(5) RegisteredSealProof_StackedDrg8MiBV1_1 = RegisteredSealProof(6) RegisteredSealProof_StackedDrg512MiBV1_1 = RegisteredSealProof(7) RegisteredSealProof_StackedDrg32GiBV1_1 = RegisteredSealProof(8) RegisteredSealProof_StackedDrg64GiBV1_1 = RegisteredSealProof(9) RegisteredSealProof_StackedDrg2KiBV1_1_Feat_SyntheticPoRep = RegisteredSealProof(10) RegisteredSealProof_StackedDrg8MiBV1_1_Feat_SyntheticPoRep = RegisteredSealProof(11) RegisteredSealProof_StackedDrg512MiBV1_1_Feat_SyntheticPoRep = RegisteredSealProof(12) RegisteredSealProof_StackedDrg32GiBV1_1_Feat_SyntheticPoRep = RegisteredSealProof(13) RegisteredSealProof_StackedDrg64GiBV1_1_Feat_SyntheticPoRep = RegisteredSealProof(14) RegisteredSealProof_StackedDrg2KiBV1_2_Feat_NiPoRep = RegisteredSealProof(15) RegisteredSealProof_StackedDrg8MiBV1_2_Feat_NiPoRep = RegisteredSealProof(16) RegisteredSealProof_StackedDrg512MiBV1_2_Feat_NiPoRep = RegisteredSealProof(17) RegisteredSealProof_StackedDrg32GiBV1_2_Feat_NiPoRep = RegisteredSealProof(18) RegisteredSealProof_StackedDrg64GiBV1_2_Feat_NiPoRep = RegisteredSealProof(19)
)
Rust: /// Available seal proofs. // Enum is append-only: once published, a `RegisteredSealProof` value must never change. #[allow(non_camel_case_types)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum RegisteredSealProof {
StackedDrg2KiBV1,
StackedDrg8MiBV1,
StackedDrg512MiBV1,
StackedDrg32GiBV1,
StackedDrg64GiBV1,
StackedDrg2KiBV1_1,
StackedDrg8MiBV1_1,
StackedDrg512MiBV1_1,
StackedDrg32GiBV1_1,
StackedDrg64GiBV1_1,
StackedDrg2KiBV1_1_Feat_SyntheticPoRep,
StackedDrg8MiBV1_1_Feat_SyntheticPoRep,
StackedDrg512MiBV1_1_Feat_SyntheticPoRep,
StackedDrg32GiBV1_1_Feat_SyntheticPoRep,
StackedDrg64GiBV1_1_Feat_SyntheticPoRep,
// NOTE: The SyntheticPoRep feature was added in proofs API
// version 1.2, however the published proof name has the incorrect
// version 1_1 coded into it.
//
// Non-interactive PoRep is also a feature added at API version
// 1.2, so the naming has been corrected before publication.
StackedDrg2KiBV1_2_Feat_NonInteractivePoRep,
StackedDrg8MiBV1_2_Feat_NonInteractivePoRep,
StackedDrg512MiBV1_2_Feat_NonInteractivePoRep,
StackedDrg32GiBV1_2_Feat_NonInteractivePoRep,
StackedDrg64GiBV1_2_Feat_NonInteractivePoRep,
}
type SubProof ¶ added in v1.23.1
type SubProof[H HasherDomain] struct { BaseProof InclusionPath[H] `json:"base_proof"` SubProof InclusionPath[H] `json:"sub_proof"` Root H `json:"root"` Leaf H `json:"leaf"` }
func DecodeSubProof ¶ added in v1.23.1
func DecodeSubProof[H HasherDomain](r io.Reader) (SubProof[H], error)
type TAuxLabels ¶ added in v1.23.1
type TAuxLabels struct {
Labels []StoreConfig
}
func DecodeLabels ¶ added in v1.23.1
func DecodeLabels(r io.Reader) (*TAuxLabels, error)
type TemporaryAux ¶ added in v1.23.1
type TemporaryAux struct {
Labels TAuxLabels
TreeDConfig StoreConfig
TreeRConfig StoreConfig
TreeCConfig StoreConfig
}
func DecodeTAux ¶ added in v1.23.1
func DecodeTAux(r io.Reader) (*TemporaryAux, error)
type TopProof ¶ added in v1.23.1
type TopProof[H HasherDomain] struct { BaseProof InclusionPath[H] `json:"base_proof"` SubProof InclusionPath[H] `json:"sub_proof"` TopProof InclusionPath[H] `json:"top_proof"` Root H `json:"root"` Leaf H `json:"leaf"` }
func DecodeTopProof ¶ added in v1.23.1
func DecodeTopProof[H HasherDomain](r io.Reader) (TopProof[H], error)
type VanillaProof ¶ added in v1.26.0
type VanillaProof struct {
// Each “SectorProof” holds merkle inclusion proofs, comm_c, comm_r_last, etc.
Sectors []SectorProof `json:"sectors"`
}
VanillaProof parallels Rust’s
pub struct Proof<P: MerkleProofTrait> {
pub sectors: Vec<SectorProof<P>>
}
func DecodeVanillaProof ¶ added in v1.26.0
func DecodeVanillaProof(r io.Reader) (VanillaProof, error)
DecodeVanillaProof decodes a VanillaProof from the reader.
Rust struct reference for context:
pub struct Proof<P: MerkleProofTrait> {
pub sectors: Vec<SectorProof<P>>
}
type VanillaStackedProof ¶ added in v1.23.1
type VanillaStackedProof struct {
CommDProofs MerkleProof[Sha256Domain] `json:"comm_d_proofs"`
CommRLastProof MerkleProof[PoseidonDomain] `json:"comm_r_last_proof"`
ReplicaColumnProofs ReplicaColumnProof[PoseidonDomain] `json:"replica_column_proofs"`
LabelingProofs []LabelingProof[PoseidonDomain] `json:"labeling_proofs"`
EncodingProof EncodingProof[PoseidonDomain] `json:"encoding_proof"`
}
func DecodeVanillaStackedProof ¶ added in v1.23.1
func DecodeVanillaStackedProof(r io.Reader) (VanillaStackedProof, error)
Source Files
¶
- bincode_util.go
- cached_proof.go
- datacid.go
- merkle.go
- merkle_proof_memtree.go
- merkle_sha254_memtree.go
- p_aux_util.go
- porep_vproof_bin_decode.go
- porep_vproof_bin_encode.go
- porep_vproof_challenges.go
- porep_vproof_types.go
- porep_vproof_vanilla.go
- post_vproof_bin_decode.go
- post_vproof_types.go
- post_vproof_verify.go
- t_aux_gen.go
- t_aux_types.go
- tree_r_last_comm.go
- tree_size.go
- treed_build.go
- update_vproof_types.go
- verify.go