meta

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCosignerMismatch reports a client-declared cosigner set that does not match the authoritative wallet/admin configuration.
	ErrCosignerMismatch = fmt.Errorf("%w: invalid cosigners", status.HTTP[400])
	// ErrCosignerThresholdMismatch reports a client-declared cosigner threshold that does not match the authoritative configuration.
	ErrCosignerThresholdMismatch = fmt.Errorf("%w: invalid cosigner threshold", status.HTTP[400])
	// ErrMalformedPayload reports an unparseable cosigner-resolution payload.
	ErrMalformedPayload = fmt.Errorf("%w: malformed payload", status.HTTP[400])

	// ErrFDCThresholdTooLow reports an FDC2 PROVE data-provider threshold below the minimum the TEE accepts.
	ErrFDCThresholdTooLow = fmt.Errorf("%w: FDC2 data provider threshold below minimum", status.HTTP[400])
	// ErrFDCThresholdBelowHalf reports a below-half FDC2 PROVE threshold lacking the required cosigner majority.
	ErrFDCThresholdBelowHalf = fmt.Errorf("%w: FDC2 data provider threshold below half requires cosigner threshold above half", status.HTTP[400])
	// ErrFDCThresholdTooHigh reports an FDC2 PROVE data-provider threshold at or above the maximum.
	ErrFDCThresholdTooHigh = fmt.Errorf("%w: FDC2 data provider threshold too high", status.HTTP[400])
)

Exported so voting.RejectReason can classify rejections into bounded metric labels.

Functions

This section is empty.

Types

type Meta

type Meta interface {
	// Cosigners returns cosigners' addresses and the cosigners threshold.
	//
	// If no cosigners are set, empty set and threshold zero is returned.
	Cosigners(*instruction.DataFixed) (map[common.Address]bool, uint64, error)

	// CheckConsistency validates instruction according to its opType.
	//
	// For example, for the F_FDC2 Prove OPCommand, it verifies the internal signature of the FDC message.
	CheckConsistency(*instruction.Data, common.Address) error

	// ThresholdBIPS returns custom thresholdBIPS for the instruction.
	// If no specific threshold is set -1 is returned.
	ThresholdBIPS(*instruction.DataFixed) (int, error)
}

Meta provides meta data for the instructions.

func New

func New(ws *wallets.Service, chainID uint64) Meta

New creates a Meta implementation backed by the given wallets Service. chainID is bound into FDC2 message hashes during consistency checks; it must match the chainID configured on the TEE node.

Jump to

Keyboard shortcuts

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