Documentation
¶
Index ¶
- Constants
- Variables
- func NewSenderETH(client SenderETHClient, wallet wallet.Wallet, db *gorm.DB) (*SenderETH, *SendTaskETH, error)
- func NewWatcherCreate(db *gorm.DB, verifier smartcontracts.Verifier, pcs *chainsched.Scheduler, ...) error
- func NewWatcherProviderRegister(db *gorm.DB, pcs *chainsched.Scheduler, contractAddr common.Address) error
- func NewWatcherRootAdd(db *gorm.DB, pcs *chainsched.Scheduler, verifier smartcontracts.Verifier) error
- func Verify(proof smartcontracts.IPDPTypesProof, root [32]byte, position uint64) bool
- type ChainAPI
- type InitProvingPeriodTask
- type MessageWatcherEth
- type MessageWatcherEthClient
- type NextProvingPeriodTask
- func (n *NextProvingPeriodTask) Adder(taskFunc scheduler.AddTaskFunc)
- func (n *NextProvingPeriodTask) CanAccept(ids []scheduler.TaskID, engine *scheduler.TaskEngine) (*scheduler.TaskID, error)
- func (n *NextProvingPeriodTask) Do(taskID scheduler.TaskID) (done bool, err error)
- func (n *NextProvingPeriodTask) TypeDetails() scheduler.TaskTypeDetails
- type ProofSetCreate
- type ProofSetRootAdd
- type ProveTask
- func (p *ProveTask) Adder(taskFunc scheduler.AddTaskFunc)
- func (p *ProveTask) CanAccept(ids []scheduler.TaskID, engine *scheduler.TaskEngine) (*scheduler.TaskID, error)
- func (p *ProveTask) Do(taskID scheduler.TaskID) (done bool, err error)
- func (p *ProveTask) GenerateProofs(ctx context.Context, proofSetID int64, seed abi.Randomness, numChallenges int) ([]smartcontracts.IPDPTypesProof, error)
- func (p *ProveTask) TypeDetails() scheduler.TaskTypeDetails
- type RootAddEntry
- type SendTaskETH
- func (s *SendTaskETH) Adder(taskFunc scheduler.AddTaskFunc)
- func (s *SendTaskETH) CanAccept(ids []scheduler.TaskID, engine *scheduler.TaskEngine) (*scheduler.TaskID, error)
- func (s *SendTaskETH) Do(taskID scheduler.TaskID) (done bool, err error)
- func (s *SendTaskETH) TypeDetails() scheduler.TaskTypeDetails
- type SenderETH
- type SenderETHClient
- type TransactionResult
- type WatcherOption
Constants ¶
View Source
const LeafSize = proof.NODE_SIZE
View Source
const MinConfidence = 6
MinConfidence defines how many blocks must be applied before we accept the message as applied. Synonymous with finality
Variables ¶
View Source
var SendLockedWait = 100 * time.Millisecond
Functions ¶
func NewSenderETH ¶
func NewSenderETH(client SenderETHClient, wallet wallet.Wallet, db *gorm.DB) (*SenderETH, *SendTaskETH, error)
NewSenderETH creates a new SenderETH.
func NewWatcherCreate ¶
func NewWatcherCreate( db *gorm.DB, verifier smartcontracts.Verifier, pcs *chainsched.Scheduler, serviceContract smartcontracts.Service, ) error
func NewWatcherProviderRegister ¶ added in v0.0.17
func NewWatcherProviderRegister(db *gorm.DB, pcs *chainsched.Scheduler, contractAddr common.Address) error
NewWatcherProviderRegister sets up the watcher for provider registrations
func NewWatcherRootAdd ¶
func NewWatcherRootAdd(db *gorm.DB, pcs *chainsched.Scheduler, verifier smartcontracts.Verifier) error
NewWatcherRootAdd sets up the watcher for proof set root additions
func Verify ¶
func Verify(proof smartcontracts.IPDPTypesProof, root [32]byte, position uint64) bool
Types ¶
type ChainAPI ¶
type ChainAPI interface {
ChainHead(context.Context) (*chaintypes.TipSet, error)
StateGetRandomnessDigestFromBeacon(ctx context.Context, randEpoch abi.ChainEpoch, tsk chaintypes.TipSetKey) (abi.Randomness, error) //perm:read
}
type InitProvingPeriodTask ¶
type InitProvingPeriodTask struct {
// contains filtered or unexported fields
}
func NewInitProvingPeriodTask ¶
func NewInitProvingPeriodTask( db *gorm.DB, ethClient bind.ContractBackend, chain ChainAPI, chainSched *chainsched.Scheduler, sender ethereum.Sender, serviceContract smartcontracts.Service, verifierContact smartcontracts.Verifier, ) (*InitProvingPeriodTask, error)
func (*InitProvingPeriodTask) Adder ¶
func (ipp *InitProvingPeriodTask) Adder(taskFunc scheduler.AddTaskFunc)
func (*InitProvingPeriodTask) Do ¶
func (ipp *InitProvingPeriodTask) Do(taskID scheduler.TaskID) (done bool, err error)
func (*InitProvingPeriodTask) TypeDetails ¶
func (ipp *InitProvingPeriodTask) TypeDetails() scheduler.TaskTypeDetails
type MessageWatcherEth ¶
type MessageWatcherEth struct {
// contains filtered or unexported fields
}
func NewMessageWatcherEth ¶
func NewMessageWatcherEth(db *gorm.DB, pcs *chainsched.Scheduler, api MessageWatcherEthClient, opts ...WatcherOption) (*MessageWatcherEth, error)
func (*MessageWatcherEth) Start ¶ added in v0.0.13
func (mw *MessageWatcherEth) Start()
type MessageWatcherEthClient ¶
type NextProvingPeriodTask ¶
type NextProvingPeriodTask struct {
// contains filtered or unexported fields
}
func NewNextProvingPeriodTask ¶
func NewNextProvingPeriodTask( db *gorm.DB, ethClient bind.ContractBackend, api ChainAPI, chainSched *chainsched.Scheduler, sender ethereum.Sender, verifier smartcontracts.Verifier, service smartcontracts.Service, ) (*NextProvingPeriodTask, error)
func (*NextProvingPeriodTask) Adder ¶
func (n *NextProvingPeriodTask) Adder(taskFunc scheduler.AddTaskFunc)
func (*NextProvingPeriodTask) CanAccept ¶
func (n *NextProvingPeriodTask) CanAccept(ids []scheduler.TaskID, engine *scheduler.TaskEngine) (*scheduler.TaskID, error)
func (*NextProvingPeriodTask) Do ¶
func (n *NextProvingPeriodTask) Do(taskID scheduler.TaskID) (done bool, err error)
func (*NextProvingPeriodTask) TypeDetails ¶
func (n *NextProvingPeriodTask) TypeDetails() scheduler.TaskTypeDetails
type ProofSetCreate ¶
type ProofSetRootAdd ¶
type ProofSetRootAdd struct {
ProofSet uint64 `db:"proofset"`
AddMessageHash string `db:"add_message_hash"`
}
Structures to represent database records
type ProveTask ¶
type ProveTask struct {
// contains filtered or unexported fields
}
func NewProveTask ¶
func NewProveTask( chainSched *chainsched.Scheduler, db *gorm.DB, ethClient bind.ContractBackend, verifier smartcontracts.Verifier, api ChainAPI, sender ethereum.Sender, bs blobstore.Blobstore, reader types.PieceReaderAPI, resolver types.PieceResolverAPI, ) (*ProveTask, error)
func (*ProveTask) Adder ¶
func (p *ProveTask) Adder(taskFunc scheduler.AddTaskFunc)
func (*ProveTask) GenerateProofs ¶
func (p *ProveTask) GenerateProofs(ctx context.Context, proofSetID int64, seed abi.Randomness, numChallenges int) ([]smartcontracts.IPDPTypesProof, error)
func (*ProveTask) TypeDetails ¶
func (p *ProveTask) TypeDetails() scheduler.TaskTypeDetails
type RootAddEntry ¶
type RootAddEntry struct {
ProofSet uint64 `db:"proofset"`
Root string `db:"root"`
AddMessageHash string `db:"add_message_hash"`
AddMessageIndex uint64 `db:"add_message_index"`
Subroot string `db:"subroot"`
SubrootOffset int64 `db:"subroot_offset"`
SubrootSize int64 `db:"subroot_size"`
PDPPieceRefID int64 `db:"pdp_pieceref"`
AddMessageOK *bool `db:"add_message_ok"`
PDPProofSetID uint64 `db:"proofset"`
}
RootAddEntry represents entries from pdp_proofset_root_adds
type SendTaskETH ¶
type SendTaskETH struct {
// contains filtered or unexported fields
}
func (*SendTaskETH) Adder ¶
func (s *SendTaskETH) Adder(taskFunc scheduler.AddTaskFunc)
func (*SendTaskETH) CanAccept ¶
func (s *SendTaskETH) CanAccept(ids []scheduler.TaskID, engine *scheduler.TaskEngine) (*scheduler.TaskID, error)
func (*SendTaskETH) TypeDetails ¶
func (s *SendTaskETH) TypeDetails() scheduler.TaskTypeDetails
type SenderETHClient ¶
type SenderETHClient interface {
NetworkID(ctx context.Context) (*big.Int, error)
HeaderByNumber(ctx context.Context, number *big.Int) (*ethtypes.Header, error)
PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)
EstimateGas(ctx context.Context, msg ethereum.CallMsg) (uint64, error)
SendTransaction(ctx context.Context, transaction *ethtypes.Transaction) error
SuggestGasTipCap(ctx context.Context) (*big.Int, error)
}
type TransactionResult ¶ added in v0.0.7
type TransactionResult struct {
TxHash string
Receipt *types.Receipt
Transaction *types.Transaction
ConfirmedBlockNumber int64
TxDataJSON []byte
ReceiptJSON []byte
TxSuccess bool
}
TransactionResult holds all the data needed to update a transaction in the database
type WatcherOption ¶ added in v0.0.7
type WatcherOption func(*MessageWatcherEth)
WatcherOption is a functional option for configuring MessageWatcherEth
func WithMaxEthAPIRetries ¶ added in v0.0.7
func WithMaxEthAPIRetries(n uint) WatcherOption
WithMaxEthAPIRetries sets the maximum number of retries for the eth api
Click to show internal directories.
Click to hide internal directories.