Documentation
¶
Index ¶
- Constants
- Variables
- func BeaconBlockHeaderToSlotAndRoot(header *structs.BeaconBlockHeader) (uint64, []byte, error)
- func BtcToSat(value float64) int64
- func DbTxMinerReward(txId string) []byte
- func DbValue(a string) string
- func DoTask(name string, fn func() error, exit chan os.Signal)
- func DoTimerTask(name string, interval time.Duration, fn func() error, exit chan os.Signal, ...)
- func FileKeyToIndex(fileKey store.FileKey) (uint64, uint64, uint64, error)
- func GenRequestData(p *Prepared, reqType common.ProofType, fIndex, sIndex uint64, hash string, ...) (interface{}, bool, error)
- func LowercaseFirstLetter(s string) string
- func NewCacheState() *cache
- func NewFetchId(updateType FetchType, index uint64) string
- func NewLocalWorker(btcSetupDir, ethSetupDir, dataDir, wid string, maxNums, cacheCap int) (rpc.IWorker, error)
- func NewRat() *big.Rat
- func PrintPanicStack(extras ...interface{})
- func RsToSignature(sig string) ([]byte, error)
- func TxHeightKeyToTxId(key []byte) (string, error)
- func TxIdIsEmpty(txId [32]byte) bool
- func UUID() string
- func WorkerGenProof(worker rpc.IWorker, req *common.ProofRequest) ([]*common.ProofResponse, error)
- type ArrayQueue
- func (q *ArrayQueue) Filter(fn func(value *common.ProofRequest) bool) []*common.ProofRequest
- func (q *ArrayQueue) Len() int
- func (q *ArrayQueue) List() []*common.ProofRequest
- func (q *ArrayQueue) Pop() (*common.ProofRequest, bool)
- func (q *ArrayQueue) PopFn(fn func(req *common.ProofRequest) bool) (*common.ProofRequest, bool)
- func (q *ArrayQueue) Push(value *common.ProofRequest)
- func (q *ArrayQueue) Remove(fn func(value *common.ProofRequest) bool) []*common.ProofRequest
- type BtcClient
- func (c *BtcClient) GetBlock(hash string) (*btcjson.GetBlockVerboseResult, error)
- func (c *BtcClient) GetBlockHash(height int64) (*chainhash.Hash, error)
- func (c *BtcClient) GetHeaderByHash(hash *chainhash.Hash) (string, error)
- func (c *BtcClient) GetHeaderByHashStr(hash string) (string, error)
- func (c *BtcClient) GetHeaderByHeight(height int64) (string, error)
- func (c *BtcClient) SetInitHeight(height int64)
- type BtcFilter
- type ChainFork
- type ChainIndex
- type ChainStore
- func (cs *ChainStore) BtcDeleteData(height uint64) error
- func (cs *ChainStore) BtcSaveData(height uint64, depositTxs, redeemTxes []*DbTx) error
- func (cs *ChainStore) Compact(start, limit []byte) error
- func (cs *ChainStore) DelBtcClientCache(height uint64) error
- func (cs *ChainStore) DelDbProof(txId string) error
- func (cs *ChainStore) DeleteAddrTxPrefix(addr string, txType common.TxType, hash string) error
- func (cs *ChainStore) DeleteAddrTxesPrefix(txIds []string) error
- func (cs *ChainStore) DeleteBtcTxHeight(height uint64, txIds []string) error
- func (cs *ChainStore) DeleteBtcTxParam(txId string) error
- func (cs *ChainStore) DeleteDbProof(txIds []string) error
- func (cs *ChainStore) DeleteDbTxes(txId []string) error
- func (cs *ChainStore) DeleteDbUnGenProofs(chainType common.ChainType, txIds []string) error
- func (cs *ChainStore) DeleteDestHash(txIds []string) error
- func (cs *ChainStore) DeleteEthTxHeight(height uint64, txIds []string) error
- func (cs *ChainStore) DeletePendingRequest(proofId string) error
- func (cs *ChainStore) DeleteProofResponse(requestId string) error
- func (cs *ChainStore) DeleteRedeemSotCache(txSlot, finalizeSlot uint64, hash string) error
- func (cs *ChainStore) DeleteTxProved(txIds []string) error
- func (cs *ChainStore) DeleteUnGenProof(chainType common.ChainType, txIds ...string) error
- func (cs *ChainStore) DeleteUnSubmitTx(hash string) error
- func (cs *ChainStore) EthDeleteData(height uint64) error
- func (cs *ChainStore) EthSaveData(beginHeight, endHeight uint64, depositTxes, redeemTxes, updateUtxoTxes []*DbTx) error
- func (cs *ChainStore) GetDestHash(key string) (string, bool, error)
- func (cs *ChainStore) ReadAllMiners() ([]string, error)
- func (cs *ChainStore) ReadAllPendingRequests() ([]*common.ProofRequest, error)
- func (cs *ChainStore) ReadAllProofResponse() ([]*common.SubmitProof, error)
- func (cs *ChainStore) ReadBitcoinHash(height uint64) (string, bool, error)
- func (cs *ChainStore) ReadBlockHeader(hash string) (string, bool, error)
- func (cs *ChainStore) ReadBtcBlock(hash string) (string, bool, error)
- func (cs *ChainStore) ReadBtcHeaderHash(start, end uint64) ([]string, error)
- func (cs *ChainStore) ReadBtcHeight() (uint64, bool, error)
- func (cs *ChainStore) ReadBtcTx(hash string) (*DbTx, bool, error)
- func (cs *ChainStore) ReadBtcTxHeight(height uint64) ([]string, error)
- func (cs *ChainStore) ReadBtcTxParam(txId string) (*common.ProofRequest, bool)
- func (cs *ChainStore) ReadChainForks(chain string) ([]*ChainFork, error)
- func (cs *ChainStore) ReadCheckpoint(height uint64) (string, bool, error)
- func (cs *ChainStore) ReadCheckpointHash(txId string) (string, bool, error)
- func (cs *ChainStore) ReadDbProof(txId string) (DbProof, error)
- func (cs *ChainStore) ReadDbTxes(txId string) ([]*DbTx, error)
- func (cs *ChainStore) ReadDbUnGenProof(chainType common.ChainType, txId string) (*DbUnGenProof, bool, error)
- func (cs *ChainStore) ReadDestHash(key string) (string, error)
- func (cs *ChainStore) ReadEthTxHeight(height uint64) ([]string, error)
- func (cs *ChainStore) ReadEthereumHeight() (uint64, bool, error)
- func (cs *ChainStore) ReadIcpSignature(height uint64) (DbIcpSignature, bool, error)
- func (cs *ChainStore) ReadLatestBeaconSlot() (uint64, bool, error)
- func (cs *ChainStore) ReadLatestCheckPoint() (uint64, bool, error)
- func (cs *ChainStore) ReadMaxGasPrice() (uint64, bool, error)
- func (cs *ChainStore) ReadMinerPower(addr string) (*DbMiner, error)
- func (cs *ChainStore) ReadNonce(network, addr string) (uint64, bool, error)
- func (cs *ChainStore) ReadRedeemTx(txId string) (*DbTx, bool, error)
- func (cs *ChainStore) ReadSlotByHeight(number uint64) (uint64, bool, error)
- func (cs *ChainStore) ReadSubmitMaxValue() (uint64, bool, error)
- func (cs *ChainStore) ReadSubmitMinValue() (uint64, bool, error)
- func (cs *ChainStore) ReadTxIdsByAddr(txType common.TxType, addr string) ([]string, error)
- func (cs *ChainStore) ReadTxProved(txId string) (bool, error)
- func (cs *ChainStore) ReadUnGenProofs(chainType common.ChainType) ([]*DbUnGenProof, error)
- func (cs *ChainStore) ReadUnSubmitTxs() ([]DbUnSubmitTx, error)
- func (cs *ChainStore) ReadUpdateCpTx() (*DbTx, bool)
- func (cs *ChainStore) ReadUpdateUtxoDest(hash string) (string, bool, error)
- func (cs *ChainStore) ReadWorkerId() (string, bool, error)
- func (cs *ChainStore) ReadZkParamVerify() (bool, error)
- func (cs *ChainStore) UpdateProof(txId string, proof string, proofType common.ProofType, ...) error
- func (cs *ChainStore) UpdateProofStatus(txId string, proofType common.ProofType, status common.ProofStatus) error
- func (cs *ChainStore) WriteAddrPrefixTx(txes []*DbTx) error
- func (cs *ChainStore) WriteBeaconSlot(number, slot uint64) error
- func (cs *ChainStore) WriteBitcoinHash(height uint64, hash string) error
- func (cs *ChainStore) WriteBlockHeader(hash string, header string) error
- func (cs *ChainStore) WriteBtcBlock(hash string, block string) error
- func (cs *ChainStore) WriteBtcHeight(height uint64) error
- func (cs *ChainStore) WriteBtcTxHeight(height uint64, txIds []string) error
- func (cs *ChainStore) WriteBtcTxParam(txId string, param interface{}) error
- func (cs *ChainStore) WriteChainFork(chain string, forkInfo *ChainFork) error
- func (cs *ChainStore) WriteCheckpoint(height uint64, hash string) error
- func (cs *ChainStore) WriteDbProof(txes ...DbProof) error
- func (cs *ChainStore) WriteDbTxes(txes ...*DbTx) error
- func (cs *ChainStore) WriteDestHash(key, value string) error
- func (cs *ChainStore) WriteEthTxHeight(height uint64, dbTxIds []string) error
- func (cs *ChainStore) WriteEthereumHeight(height uint64) error
- func (cs *ChainStore) WriteFinalityUpdateSlot(finalizeSlot uint64) error
- func (cs *ChainStore) WriteIcpSignature(height uint64, value DbIcpSignature) error
- func (cs *ChainStore) WriteLatestBeaconSlot(slot uint64) error
- func (cs *ChainStore) WriteLatestCheckpoint(height uint64) error
- func (cs *ChainStore) WriteMaxGasPrice(price uint64) error
- func (cs *ChainStore) WriteMiner(addr string) error
- func (cs *ChainStore) WriteMinerPower(addr string, power, timestamp uint64) error
- func (cs *ChainStore) WriteNonce(network, addr string, nonce uint64) error
- func (cs *ChainStore) WritePendingRequest(proofId string, request *common.ProofRequest) error
- func (cs *ChainStore) WriteProofResponse(resp *common.SubmitProof) error
- func (cs *ChainStore) WriteSubmitMaxValue(value uint64) error
- func (cs *ChainStore) WriteSubmitMinValue(value uint64) error
- func (cs *ChainStore) WriteTxFinalizedSlot(txSlot uint64, tx *DbUnGenProof) error
- func (cs *ChainStore) WriteTxIdsByAddr(addr string, txes []DbTx) error
- func (cs *ChainStore) WriteTxProved(txIds []string, status bool) error
- func (cs *ChainStore) WriteTxSlot(txSlot uint64, tx *DbUnGenProof) error
- func (cs *ChainStore) WriteUnGenProof(chain common.ChainType, list ...*DbUnGenProof) error
- func (cs *ChainStore) WriteUnSubmitTx(txes ...DbUnSubmitTx) error
- func (cs *ChainStore) WriteUpdateUtxoDest(hash, dest string) error
- func (cs *ChainStore) WriteWorkerId(id string) error
- func (cs *ChainStore) WriteZkParamVerify(verify bool) error
- type Config
- type Daemon
- type DbIcpSignature
- type DbMiner
- type DbProof
- type DbTx
- func NewDepositBtcTx(height, txIndex, blockTime uint64, txId, ethAddr string, amount int64, ...) *DbTx
- func NewDepositEthTx(height uint64, txIndex, logIndex uint, txHash, sender, utxoId string, ...) *DbTx
- func NewMigrateBtcTx(height, txIndex, blockTime uint64, txId string, amount int64, proofed bool) *DbTx
- func NewRedeemBtcTx(height, txIndex, blockTime uint64, txId string, amount int64, proofed bool) *DbTx
- func NewRedeemEthTx(height uint64, txIndex, logIndex uint, txHash, sender, btcTxId string, ...) *DbTx
- func NewUpdateUtxoTx(height uint64, txIndex, logIndex uint, txHash, utxoId string, ...) *DbTx
- type DbUnGenProof
- type DbUnSubmitTx
- type DownloadStatus
- type EthFilter
- type Fetch
- func (f *Fetch) Bootstrap()
- func (f *Fetch) CheckFinalityUpdate(period uint64, finalityUpdate *common.LightClientFinalityUpdateEvent) (bool, error)
- func (f *Fetch) CheckLightClientUpdate(period uint64, update *common.LightClientUpdateResponse) (bool, error)
- func (f *Fetch) Close() error
- func (f *Fetch) FinalityUpdate() error
- func (f *Fetch) GetFinalityUpdate() error
- func (f *Fetch) GetLightClientUpdate(period uint64)
- func (f *Fetch) Init() error
- func (f *Fetch) LightClientUpdate() error
- func (f *Fetch) StoreLatestPeriod() error
- type FetchRequest
- type FetchResponse
- type FetchType
- type FileStorage
- func (fs *FileStorage) BtcBaseIndexes(start, height uint64) ([]uint64, error)
- func (fs *FileStorage) BtcChainIndex(height uint64) (uint64, bool, error)
- func (fs *FileStorage) BtcDepthIndex(cpHeight, genesis, height uint64) (uint64, bool, error)
- func (fs *FileStorage) BtcMiddleIndexes(start, height uint64) ([]Index, error)
- func (fs *FileStorage) CheckFinalityUpdate(slot uint64) (bool, error)
- func (fs *FileStorage) CheckObj(table store.Table, key store.FileKey) (bool, error)
- func (fs *FileStorage) CheckProof(key StoreKey) (bool, error)
- func (fs *FileStorage) CheckUpdate(period uint64) (bool, error)
- func (fs *FileStorage) Clear() error
- func (fs *FileStorage) CurrentBtcChainIndex() (*ChainIndex, bool, error)
- func (fs *FileStorage) CurrentBtcCpDepthIndex(cpHeight uint64) (*ChainIndex, bool, error)
- func (fs *FileStorage) DelProof(key StoreKey) error
- func (fs *FileStorage) FileStore(key StoreKey, create ...bool) (store.IFileStore, bool)
- func (fs *FileStorage) FindBtcChainProof(height uint64) (*WrapStorageProof, bool, error)
- func (fs *FileStorage) FindDepthProof(prefix, height uint64) (*WrapStorageProof, bool, error)
- func (fs *FileStorage) GenOuterIndexes() ([]uint64, error)
- func (fs *FileStorage) Get(table store.Table, value interface{}, key ...interface{}) (bool, error)
- func (fs *FileStorage) GetBackendRedeemProof(txHash string) (*StoreProof, bool, error)
- func (fs *FileStorage) GetBeaconHeaderProof(start, end uint64) (*StoreProof, bool, error)
- func (fs *FileStorage) GetBhfProof(period uint64) (*StoreProof, bool, error)
- func (fs *FileStorage) GetBtcBaseProof(start, end uint64) (*StoreProof, bool, error)
- func (fs *FileStorage) GetBtcBulkProof(index, end uint64) (*StoreProof, bool, error)
- func (fs *FileStorage) GetBtcMiddleProof(start, end uint64) (*StoreProof, bool, error)
- func (fs *FileStorage) GetBtcTimestampProof(txHeight, latestHeight uint64) (*StoreProof, bool, error)
- func (fs *FileStorage) GetBtcUpperProof(start, end uint64) (*StoreProof, bool, error)
- func (fs *FileStorage) GetDutyProof(period uint64) (*StoreProof, bool, error)
- func (fs *FileStorage) GetFileStore(table store.Table) (store.IFileStore, bool)
- func (fs *FileStorage) GetFinalityUpdate(slot uint64, value interface{}) (bool, error)
- func (fs *FileStorage) GetGenesisPeriod() uint64
- func (fs *FileStorage) GetLatestFinalizedSlot() (uint64, bool, error)
- func (fs *FileStorage) GetLatestPeriod() (uint64, bool, error)
- func (fs *FileStorage) GetObj(table store.Table, key store.FileKey, value interface{}) (bool, error)
- func (fs *FileStorage) GetOuterProof(period uint64) (*StoreProof, bool, error)
- func (fs *FileStorage) GetProof(key StoreKey) (*StoreProof, bool, error)
- func (fs *FileStorage) GetRecursiveProof(period uint64) (*StoreProof, bool, error)
- func (fs *FileStorage) GetRedeemProof(txHash string) (*StoreProof, bool, error)
- func (fs *FileStorage) GetRootPath() string
- func (fs *FileStorage) GetSgxRedeemProof(hash string) (*StoreProof, bool, error)
- func (fs *FileStorage) GetSubFileStore(table, sub store.Table, create ...bool) (store.IFileStore, bool)
- func (fs *FileStorage) GetSyncInnerProof(period, index uint64) (*StoreProof, bool, error)
- func (fs *FileStorage) GetTxFinalizedSlot(txSlot uint64) (uint64, bool, error)
- func (fs *FileStorage) GetTxProof(txHash string) (*StoreProof, bool, error)
- func (fs *FileStorage) GetUnitProof(period uint64) (*StoreProof, bool, error)
- func (fs *FileStorage) GetUpdate(period uint64, value interface{}) (bool, error)
- func (fs *FileStorage) NeedDutyIndexes() ([]uint64, error)
- func (fs *FileStorage) NeedGenUnitProofIndexes() ([]uint64, error)
- func (fs *FileStorage) NeedUpdateIndexes() ([]uint64, error)
- func (fs *FileStorage) RemoveBtcProof(height uint64) error
- func (fs *FileStorage) StoreErrorFinalityUpdate(key string, data interface{}) error
- func (fs *FileStorage) StoreFinalityUpdate(slot uint64, data interface{}) error
- func (fs *FileStorage) StoreLatestFinalizedSlot(slot uint64) error
- func (fs *FileStorage) StoreLatestPeriod(period uint64) error
- func (fs *FileStorage) StoreObj(table store.Table, key store.FileKey, value interface{}) error
- func (fs *FileStorage) StoreProof(key StoreKey, proof, witness []byte) error
- func (fs *FileStorage) StoreRequest(req *common.ProofRequest, extraIds ...string) error
- func (fs *FileStorage) StoreUpdate(period uint64, value interface{}) error
- func (fs *FileStorage) SyncComInnerIndexes() ([]Index, error)
- type Handler
- func (h *Handler) AddP2pPeer(addr string) (string, error)
- func (h *Handler) AddWorker(endpoint string, max int) (string, error)
- func (h *Handler) AutoSubmitMaxValue(max uint64) (string, error)
- func (h *Handler) AutoSubmitMinValue(min uint64) (string, error)
- func (h *Handler) GetZkProofTask(request common.TaskRequest) (*common.TaskResponse, error)
- func (h *Handler) MinerInfo() ([]*rpc.MinerInfo, error)
- func (h *Handler) PendingTask() ([]*rpc.ProofTask, error)
- func (h *Handler) ProofInfo(txIds []string) ([]rpc.ProofInfo, error)
- func (h *Handler) ReScan(height uint64, chain string) error
- func (h *Handler) RemoveUnGenProof(hash string) (string, error)
- func (h *Handler) RemoveUnSubmitTx(hash string) (string, error)
- func (h *Handler) SetGasPrice(gasPrice uint64) (string, error)
- func (h *Handler) Stop() error
- func (h *Handler) SubmitProof(req *common.SubmitProof) (string, error)
- func (h *Handler) Transaction(txHash string) ([]*rpc.Transaction, error)
- func (h *Handler) Transactions(txIds []string) ([]*rpc.Transaction, error)
- func (h *Handler) TransactionsByHeight(height uint64, network string) ([]string, error)
- func (h *Handler) Version() (rpc.NodeInfo, error)
- type IAgent
- type IFetch
- type IManager
- type IScheduler
- type Index
- type KeyStore
- type LocalWorker
- func (w *LocalWorker) AddReqNum()
- func (w *LocalWorker) BackendRedeemProof(req *rpc.RedeemRequest) (*rpc.RedeemResponse, error)
- func (w *LocalWorker) BlockHeaderFinalityProve(req *rpc.BlockHeaderFinalityRequest) (*rpc.BlockHeaderFinalityResponse, error)
- func (w *LocalWorker) BlockHeaderProve(req *rpc.BlockHeaderRequest) (*rpc.BlockHeaderResponse, error)
- func (w *LocalWorker) BtcBaseProve(req *rpc.BtcBaseRequest) (*rpc.ProofResponse, error)
- func (w *LocalWorker) BtcBulkProve(req *rpc.BtcBulkRequest) (*rpc.BtcBulkResponse, error)
- func (w *LocalWorker) BtcChainProve(req *rpc.BtcChainRequest) (*rpc.ProofResponse, error)
- func (w *LocalWorker) BtcChangeProve(req *rpc.BtcChangeRequest) (*rpc.ProofResponse, error)
- func (w *LocalWorker) BtcDepositProve(req *rpc.BtcDepositRequest) (*rpc.ProofResponse, error)
- func (w *LocalWorker) BtcDepthRecursiveProve(req *rpc.BtcDepthRecursiveRequest) (*rpc.ProofResponse, error)
- func (w *LocalWorker) BtcDuperRecursiveProve(req *rpc.BtcDuperRecursiveRequest) (*rpc.ProofResponse, error)
- func (w *LocalWorker) BtcMiddleProve(req *rpc.BtcMiddleRequest) (*rpc.ProofResponse, error)
- func (w *LocalWorker) BtcTimestamp(req *rpc.BtcTimestampRequest) (*rpc.ProofResponse, error)
- func (w *LocalWorker) BtcUpperProve(req *rpc.BtcUpperRequest) (*rpc.ProofResponse, error)
- func (w *LocalWorker) Close() error
- func (w *LocalWorker) CurrentNums() int
- func (w *LocalWorker) DelReqNum()
- func (w *LocalWorker) Id() string
- func (w *LocalWorker) MaxNums() int
- func (w *LocalWorker) ProofInfo(proofId string) (rpc.ProofInfo, error)
- func (w *LocalWorker) RedeemProof(req *rpc.RedeemRequest) (*rpc.RedeemResponse, error)
- func (w *LocalWorker) SupportProofType() []common.ProofType
- func (w *LocalWorker) SyncCommDutyProve(req rpc.SyncCommDutyRequest) (*rpc.SyncCommDutyResponse, error)
- func (w *LocalWorker) SyncCommInner(req *rpc.SyncCommInnerRequest) (*rpc.ProofResponse, error)
- func (w *LocalWorker) SyncCommOuter(req *rpc.SyncCommOuterRequest) (*rpc.ProofResponse, error)
- func (w *LocalWorker) SyncCommitUnitProve(req rpc.SyncCommUnitsRequest) (*rpc.SyncCommUnitsResponse, error)
- func (w *LocalWorker) TxInEth2Prove(req *rpc.TxInEth2ProveRequest) (*rpc.TxInEth2ProveResponse, error)
- type Memguard
- type MemoryStore
- type MinerPower
- type Mode
- type Notify
- type PendingQueue
- type Prepared
- func (p *Prepared) GetBeaconHeaderId(start, end uint64) ([]byte, []byte, error)
- func (p *Prepared) GetBhfUpdateRequest(finalizedSlot uint64) (*rpc.BlockHeaderFinalityRequest, bool, error)
- func (p *Prepared) GetBlockHeaderRequest(txSlot, finalizedSlot uint64) (*rpc.BlockHeaderRequest, bool, error)
- func (p *Prepared) GetBtcBaseRequest(start, end uint64) (*rpc.BtcBaseRequest, bool, error)
- func (p *Prepared) GetBtcBulkRequest(start, end, prefix uint64) (*rpc.BtcBulkRequest, error)
- func (p *Prepared) GetBtcChangeRequest(hash string) (*rpc.BtcChangeRequest, bool, error)
- func (p *Prepared) GetBtcDepositRequest(hash string) (*rpc.BtcDepositRequest, bool, error)
- func (p *Prepared) GetBtcDepthRecursiveRequest(prefix, start, end uint64, isCp bool) (*rpc.BtcDepthRecursiveRequest, bool, error)
- func (p *Prepared) GetBtcDuperRecursiveRequest(start, end uint64) (*rpc.BtcDuperRecursiveRequest, bool, error)
- func (p *Prepared) GetBtcMiddleRequest(start, end uint64) (*rpc.BtcMiddleRequest, bool, error)
- func (p *Prepared) GetBtcTimestampRequest(fIndex uint64, sIndex uint64) (*rpc.BtcTimestampRequest, bool, error)
- func (p *Prepared) GetBtcUpperRequest(start, end uint64) (*rpc.BtcUpperRequest, bool, error)
- func (p *Prepared) GetDutyRequest(period uint64) (*rpc.SyncCommDutyRequest, bool, error)
- func (p *Prepared) GetRedeemRequest(txHash string, txSlot, finalizedSlot uint64) (*rpc.RedeemRequest, bool, error)
- func (p *Prepared) GetSyncComInnerRequest(period, index uint64) (*rpc.SyncCommInnerRequest, bool, error)
- func (p *Prepared) GetSyncComUnitRequest(period uint64) (*rpc.SyncCommUnitsRequest, bool, error)
- func (p *Prepared) GetSyncCommitRootId(period uint64) ([]byte, bool, error)
- func (p *Prepared) GetSyncCommitUpdate(period uint64) (*rpc.WrapSyncCommitteeUpdate, bool, error)
- func (p *Prepared) GetSyncCommittee(period uint64) (*WrapSyncCommittee, bool, error)
- func (p *Prepared) GetSyncOuterRequest(period uint64) (*rpc.SyncCommOuterRequest, bool, error)
- func (p *Prepared) GetTxInEth2Request(txHash string, txSlot uint64) (*rpc.TxInEth2ProveRequest, bool, error)
- type ProofRespQueue
- type QueueManager
- func (q *QueueManager) AddPending(key string, value *common.ProofRequest)
- func (q *QueueManager) CheckId(proofId string) bool
- func (q *QueueManager) DeleteId(proofId string)
- func (q *QueueManager) DeletePending(key string)
- func (q *QueueManager) FilterPending(fn func(value *common.ProofRequest) bool) []*common.ProofRequest
- func (q *QueueManager) FilterRequest(fn func(value *common.ProofRequest) bool) []*common.ProofRequest
- func (q *QueueManager) GetPending(key string) (*common.ProofRequest, bool)
- func (q *QueueManager) ListRequest() []*common.ProofRequest
- func (q *QueueManager) PopFnRequest(fn func(req *common.ProofRequest) bool) (*common.ProofRequest, bool)
- func (q *QueueManager) PopRequest() (*common.ProofRequest, bool)
- func (q *QueueManager) PushRequest(req *common.ProofRequest)
- func (q *QueueManager) RemoveRequest(fn func(value *common.ProofRequest) bool) []*common.ProofRequest
- func (q *QueueManager) RequestLen() int
- func (q *QueueManager) StoreId(proofId string)
- type ReScnSignal
- type RunConfig
- type Scheduler
- func (s *Scheduler) CheckBeaconState() error
- func (s *Scheduler) CheckBtcState() error
- func (s *Scheduler) CheckEthState() error
- func (s *Scheduler) CheckPreBtcState() error
- func (s *Scheduler) GetPendingRequest(proofId string) (*common.ProofRequest, bool)
- func (s *Scheduler) Locks() func()
- func (s *Scheduler) PendingProofRequest() []*common.ProofRequest
- func (s *Scheduler) PendingRequest() []*common.ProofRequest
- func (s *Scheduler) UpdateProofStatus(req *common.ProofRequest, status common.ProofStatus) error
- type SigRes
- type SignFn
- type StoreKey
- func NewDoubleStoreKey(proofType common.ProofType, fIndex, sIndex uint64) StoreKey
- func NewHashStoreKey(proofType common.ProofType, hash string) StoreKey
- func NewHeightStoreKey(proofType common.ProofType, height uint64) StoreKey
- func NewPrefixStoreKey(proofType common.ProofType, prefix, fIndex, sIndex uint64) StoreKey
- func NewStoreKey(proofType common.ProofType, hash string, prefix, fIndex, sIndex uint64) StoreKey
- type StoreProof
- type SubmitQueue
- type TxManager
- func (t *TxManager) AddTask(resp *common.ProofResponse)
- func (t *TxManager) Check() error
- func (t *TxManager) CheckEthBalance(addr string, gasPrice *big.Int, gasLimit uint64) (bool, error)
- func (t *TxManager) Close() error
- func (t *TxManager) DepositBtc(tx DbUnSubmitTx) (string, error)
- func (t *TxManager) RedeemZkbtc(hash, proof string) (string, error)
- func (t *TxManager) SignerBtc(currentScRoot, ethTxHash, btcTxId, proof string, sigHashes []string, ...) ([][][]byte, error)
- func (t *TxManager) UpdateUtxoChange(tx DbUnSubmitTx) (string, error)
- type UniqueList
- type Worker
- func (w *Worker) AddReqNum()
- func (w *Worker) BackendRedeemProof(req *rpc.RedeemRequest) (*rpc.RedeemResponse, error)
- func (w *Worker) BlockHeaderFinalityProve(req *rpc.BlockHeaderFinalityRequest) (*rpc.BlockHeaderFinalityResponse, error)
- func (w *Worker) BlockHeaderProve(req *rpc.BlockHeaderRequest) (*rpc.BlockHeaderResponse, error)
- func (w *Worker) BtcBaseProve(req *rpc.BtcBaseRequest) (*rpc.ProofResponse, error)
- func (w *Worker) BtcBulkProve(req *rpc.BtcBulkRequest) (*rpc.BtcBulkResponse, error)
- func (w *Worker) BtcChangeProve(req *rpc.BtcChangeRequest) (*rpc.ProofResponse, error)
- func (w *Worker) BtcDepositProve(req *rpc.BtcDepositRequest) (*rpc.ProofResponse, error)
- func (w *Worker) BtcDepthRecursiveProve(req *rpc.BtcDepthRecursiveRequest) (*rpc.ProofResponse, error)
- func (w *Worker) BtcDuperRecursiveProve(req *rpc.BtcDuperRecursiveRequest) (*rpc.ProofResponse, error)
- func (w *Worker) BtcMiddleProve(req *rpc.BtcMiddleRequest) (*rpc.ProofResponse, error)
- func (w *Worker) BtcTimestamp(req *rpc.BtcTimestampRequest) (*rpc.ProofResponse, error)
- func (w *Worker) BtcUpperProve(req *rpc.BtcUpperRequest) (*rpc.ProofResponse, error)
- func (w *Worker) Close() error
- func (w *Worker) CurrentNums() int
- func (w *Worker) DelReqNum()
- func (w *Worker) Id() string
- func (w *Worker) MaxNums() int
- func (w *Worker) ProofInfo(proofId string) (rpc.ProofInfo, error)
- func (w *Worker) RedeemProof(req *rpc.RedeemRequest) (*rpc.RedeemResponse, error)
- func (w *Worker) SupportProofType() []common.ProofType
- func (w *Worker) SyncCommDutyProve(req rpc.SyncCommDutyRequest) (*rpc.SyncCommDutyResponse, error)
- func (w *Worker) SyncCommInner(req *rpc.SyncCommInnerRequest) (*rpc.ProofResponse, error)
- func (w *Worker) SyncCommOuter(req *rpc.SyncCommOuterRequest) (*rpc.ProofResponse, error)
- func (w *Worker) SyncCommitUnitProve(req rpc.SyncCommUnitsRequest) (*rpc.SyncCommUnitsResponse, error)
- func (w *Worker) TxInEth2Prove(req *rpc.TxInEth2ProveRequest) (*rpc.TxInEth2ProveResponse, error)
- type WorkerConfig
- type WrapStorageProof
- type WrapSyncCommittee
- type WrapperAgent
- type WrapperManger
- type ZkParams
Constants ¶
View Source
const ( TestnetLightecNetwork = "testnet" TestnetBtcOperatorAddress = "tb1qmfsjae6yxtt8kc3cre84rkraa5nyw35nzmx87t85z30f8auy0mnqhtuey4" TestnetBtcLockScript = "0020da612ee74432d67b62381e4f51d87ded2647469316cc7f2cf4145e93f7847ee6" TestnetBtcMultiSig = "" /* 210-byte string literal not displayed */ TestnetEthZkBridgeAddress = "0x9C83D62f524d589da2ED538F5F59225880B680D1" TestnetEthZkBtcAddress = "0x71198dD1689eBc01A7664ce7c0d5b1f62DF2b378" TestnetEthUtxoManagerAddress = "0xc5eC55Ba3764c09eD28598465D534e313A0EEe34" TestnetEthBtcTxVerifyAddress = "0xC96685Eb518Df9959E326326d72b5234b78c2d30" TestnetFeePoolAddr = "0xd69aec9e9a434aa6B0a9BCC9B4D01154fc907253" TestnetOasisSignerAddr = "0x78131d6524C04F986e82Cd222a6ABcBf8f9D9Dc1" TestnetIcpPublicKey = "0x02b4ca925faa4e78c292c080254121299a778e990dd52061fb6d5dd01ef9db56f2" TestnetGenesisRoot = "0x603499eb68150e861ef759463fa901add0987d1af340c925e1701a10b9c21165" TestnetBlockSingerId = "xdqo6-dqaaa-aaaal-qsqva-cai" TestnetIcpTxSingerId = "n6pke-yqaaa-aaaah-arona-cai" )
View Source
const ( LightecNetwork = "mainnet" BtcOperatorAddress = "bc1qcwc08898aseahq2e5920m9395py3jjtm2xnt0s90slqra7cry2dq2xv9uq" BtcLockScript = "0020c3b0f39ca7ec33db8159a154fd9625a04919497b51a6b7c0af87c03efb03229a" BtcMultiSig = "" /* 210-byte string literal not displayed */ EthZkBridgeAddress = "0xF90966fd006a5B18Cb0E3A0568226010CED426FD" EthZkBtcAddress = "0x199CC8f0ac008Bdc8cF0B1CCd5187F84E168C4D2" EthUtxoManagerAddress = "0x205a1E85C7d4d0fcd4344335120181aB5e796562" EthBtcTxVerifyAddress = "0x1F0f891fB88287091DFc6225038336207374ec79" FeePoolAddr = "0x7be6F1ECac63c8562Da8fF769347c45fc4590bFb" OasisSignerAddr = "0xA81Fc99DBC654D68513B8C1475aFeC3B5d76496e" IcpPublicKey = "03183007b9afcfa519871885380d4dfd1144269d8050ec2a51992065af2a87d3df" GenesisRoot = "52bbd8287d0e455ce6cd732fa8a5f003e2ad82fd0ed3a59516f9ae1642f1b182" BlockSingerId = "xdqo6-dqaaa-aaaal-qsqva-cai" IcpTxSingerId = "wlkxr-hqaaa-aaaad-aaxaa-cai" DepositTopic = "0xd063609fea0cb9b8a1b53a4fbf0e659c270b3bc99eab08dcc7f4433b4937e074" // the UTXOAdded event from the UTXO Manager contract RedeemTopic = "0x379299efe6911678ce0f23cfce13a7c61a5b2c1723f583f9217b6ee0887b3ef4" // the CreateRedeemUnsignedTx event from the zkBTC bridge contract UpdateUtxoTopic = "0x5d6cc5c33e60ae274f09159956ae8fd20271c63c95b9004445271437b335ed6e" // the ChangeUTXOUpdated event from the UTXO Manager contract )
View Source
const ( BtcScanTime = 5 * time.Minute EthScanTime = 3 * time.Minute // MigrateProto operator migrate address MigrateProto = "6a141234560000000000000000000000000000000000" // MinDepositValue deposit min value MinDepositValue = float64(0.00021000) // 21000 sats // 1: the first production version (2025.7) @gnark v0.12; // 2: Ethereum Fusaka + gnark 0.14 GeneratorVersion = 2 NodeVersion = "1.0.0" RpcRegisterName = "zkbtc" BitcoinNetwork = "bitcoin" EthereumNetwork = "ethereum" BitcoinAgentName = "bitcoinAgent" EthereumAgentName = "ethereumAgent" BeaconAgentName = "beaconAgent" BtcLiteCacheHeight = 24 * 6 * 45 ProofExpired = 5 * time.Hour BtcClientCacheHeight = 100 )
View Source
const (
SecretKeyId = "secretKey"
)
Variables ¶
View Source
var SgxServerUrl []string = []string{""} // todo
Functions ¶
func BeaconBlockHeaderToSlotAndRoot ¶
func BeaconBlockHeaderToSlotAndRoot(header *structs.BeaconBlockHeader) (uint64, []byte, error)
func DbTxMinerReward ¶
func DoTimerTask ¶
func GenRequestData ¶
func LowercaseFirstLetter ¶
func NewCacheState ¶
func NewCacheState() *cache
func NewFetchId ¶
func NewLocalWorker ¶
func PrintPanicStack ¶
func PrintPanicStack(extras ...interface{})
func RsToSignature ¶
func TxHeightKeyToTxId ¶
func TxIdIsEmpty ¶
func WorkerGenProof ¶
func WorkerGenProof(worker rpc.IWorker, req *common.ProofRequest) ([]*common.ProofResponse, error)
Types ¶
type ArrayQueue ¶
type ArrayQueue struct {
// contains filtered or unexported fields
}
todo
func NewArrayQueue ¶
func NewArrayQueue(sortFn func(a, b *common.ProofRequest) bool) *ArrayQueue
func (*ArrayQueue) Filter ¶
func (q *ArrayQueue) Filter(fn func(value *common.ProofRequest) bool) []*common.ProofRequest
func (*ArrayQueue) Len ¶
func (q *ArrayQueue) Len() int
func (*ArrayQueue) List ¶
func (q *ArrayQueue) List() []*common.ProofRequest
func (*ArrayQueue) Pop ¶
func (q *ArrayQueue) Pop() (*common.ProofRequest, bool)
func (*ArrayQueue) PopFn ¶
func (q *ArrayQueue) PopFn(fn func(req *common.ProofRequest) bool) (*common.ProofRequest, bool)
func (*ArrayQueue) Push ¶
func (q *ArrayQueue) Push(value *common.ProofRequest)
func (*ArrayQueue) Remove ¶
func (q *ArrayQueue) Remove(fn func(value *common.ProofRequest) bool) []*common.ProofRequest
type BtcClient ¶
type BtcClient struct {
IClient btcproverClient.IClient
// contains filtered or unexported fields
}
BtcClient why exists this client, because btc_provers use btcproverClient.IClient to get block header,it`s maybe get forked chain data
func NewBtcClient ¶
func (*BtcClient) GetBlock ¶
func (c *BtcClient) GetBlock(hash string) (*btcjson.GetBlockVerboseResult, error)
func (*BtcClient) GetBlockHash ¶
func (*BtcClient) GetHeaderByHash ¶
func (*BtcClient) GetHeaderByHashStr ¶
func (*BtcClient) GetHeaderByHeight ¶
func (*BtcClient) SetInitHeight ¶
type BtcFilter ¶
type BtcFilter struct {
OperatorAddr string
LockScript string
MultiSigScrip string
// contains filtered or unexported fields
}
func NewBtcAddrFilter ¶
func (*BtcFilter) GetMinDepositValue ¶
type ChainIndex ¶
func BlockChainPlan ¶
func BlockChainPlan(start, height uint64, skip ...bool) []ChainIndex
func BlockDepthPlan ¶
func BlockDepthPlan(prefix, start, end uint64, skip ...bool) []ChainIndex
func BlockUpperIndex ¶
func BlockUpperIndex(start, end uint64, skip ...bool) []ChainIndex
BlockUpperIndex one upper round plan
type ChainStore ¶
type ChainStore struct {
// contains filtered or unexported fields
}
func NewChainStore ¶
func NewChainStore(store store.IStore) *ChainStore
func (*ChainStore) BtcDeleteData ¶
func (cs *ChainStore) BtcDeleteData(height uint64) error
func (*ChainStore) BtcSaveData ¶
func (cs *ChainStore) BtcSaveData(height uint64, depositTxs, redeemTxes []*DbTx) error
func (*ChainStore) Compact ¶
func (cs *ChainStore) Compact(start, limit []byte) error
func (*ChainStore) DelBtcClientCache ¶
func (cs *ChainStore) DelBtcClientCache(height uint64) error
func (*ChainStore) DelDbProof ¶
func (cs *ChainStore) DelDbProof(txId string) error
func (*ChainStore) DeleteAddrTxPrefix ¶
func (*ChainStore) DeleteAddrTxesPrefix ¶
func (cs *ChainStore) DeleteAddrTxesPrefix(txIds []string) error
func (*ChainStore) DeleteBtcTxHeight ¶
func (cs *ChainStore) DeleteBtcTxHeight(height uint64, txIds []string) error
func (*ChainStore) DeleteBtcTxParam ¶
func (cs *ChainStore) DeleteBtcTxParam(txId string) error
func (*ChainStore) DeleteDbProof ¶
func (cs *ChainStore) DeleteDbProof(txIds []string) error
func (*ChainStore) DeleteDbTxes ¶
func (cs *ChainStore) DeleteDbTxes(txId []string) error
func (*ChainStore) DeleteDbUnGenProofs ¶
func (cs *ChainStore) DeleteDbUnGenProofs(chainType common.ChainType, txIds []string) error
func (*ChainStore) DeleteDestHash ¶
func (cs *ChainStore) DeleteDestHash(txIds []string) error
func (*ChainStore) DeleteEthTxHeight ¶
func (cs *ChainStore) DeleteEthTxHeight(height uint64, txIds []string) error
func (*ChainStore) DeletePendingRequest ¶
func (cs *ChainStore) DeletePendingRequest(proofId string) error
func (*ChainStore) DeleteProofResponse ¶
func (cs *ChainStore) DeleteProofResponse(requestId string) error
func (*ChainStore) DeleteRedeemSotCache ¶
func (cs *ChainStore) DeleteRedeemSotCache(txSlot, finalizeSlot uint64, hash string) error
func (*ChainStore) DeleteTxProved ¶
func (cs *ChainStore) DeleteTxProved(txIds []string) error
func (*ChainStore) DeleteUnGenProof ¶
func (cs *ChainStore) DeleteUnGenProof(chainType common.ChainType, txIds ...string) error
func (*ChainStore) DeleteUnSubmitTx ¶
func (cs *ChainStore) DeleteUnSubmitTx(hash string) error
func (*ChainStore) EthDeleteData ¶
func (cs *ChainStore) EthDeleteData(height uint64) error
func (*ChainStore) EthSaveData ¶
func (cs *ChainStore) EthSaveData(beginHeight, endHeight uint64, depositTxes, redeemTxes, updateUtxoTxes []*DbTx) error
func (*ChainStore) GetDestHash ¶
func (cs *ChainStore) GetDestHash(key string) (string, bool, error)
func (*ChainStore) ReadAllMiners ¶
func (cs *ChainStore) ReadAllMiners() ([]string, error)
func (*ChainStore) ReadAllPendingRequests ¶
func (cs *ChainStore) ReadAllPendingRequests() ([]*common.ProofRequest, error)
func (*ChainStore) ReadAllProofResponse ¶
func (cs *ChainStore) ReadAllProofResponse() ([]*common.SubmitProof, error)
func (*ChainStore) ReadBitcoinHash ¶
func (cs *ChainStore) ReadBitcoinHash(height uint64) (string, bool, error)
func (*ChainStore) ReadBlockHeader ¶
func (cs *ChainStore) ReadBlockHeader(hash string) (string, bool, error)
func (*ChainStore) ReadBtcBlock ¶
func (cs *ChainStore) ReadBtcBlock(hash string) (string, bool, error)
func (*ChainStore) ReadBtcHeaderHash ¶
func (cs *ChainStore) ReadBtcHeaderHash(start, end uint64) ([]string, error)
func (*ChainStore) ReadBtcHeight ¶
func (cs *ChainStore) ReadBtcHeight() (uint64, bool, error)
func (*ChainStore) ReadBtcTxHeight ¶
func (cs *ChainStore) ReadBtcTxHeight(height uint64) ([]string, error)
func (*ChainStore) ReadBtcTxParam ¶
func (cs *ChainStore) ReadBtcTxParam(txId string) (*common.ProofRequest, bool)
func (*ChainStore) ReadChainForks ¶
func (cs *ChainStore) ReadChainForks(chain string) ([]*ChainFork, error)
func (*ChainStore) ReadCheckpoint ¶
func (cs *ChainStore) ReadCheckpoint(height uint64) (string, bool, error)
func (*ChainStore) ReadCheckpointHash ¶
func (cs *ChainStore) ReadCheckpointHash(txId string) (string, bool, error)
func (*ChainStore) ReadDbProof ¶
func (cs *ChainStore) ReadDbProof(txId string) (DbProof, error)
func (*ChainStore) ReadDbTxes ¶
func (cs *ChainStore) ReadDbTxes(txId string) ([]*DbTx, error)
func (*ChainStore) ReadDbUnGenProof ¶
func (cs *ChainStore) ReadDbUnGenProof(chainType common.ChainType, txId string) (*DbUnGenProof, bool, error)
func (*ChainStore) ReadDestHash ¶
func (cs *ChainStore) ReadDestHash(key string) (string, error)
func (*ChainStore) ReadEthTxHeight ¶
func (cs *ChainStore) ReadEthTxHeight(height uint64) ([]string, error)
func (*ChainStore) ReadEthereumHeight ¶
func (cs *ChainStore) ReadEthereumHeight() (uint64, bool, error)
func (*ChainStore) ReadIcpSignature ¶
func (cs *ChainStore) ReadIcpSignature(height uint64) (DbIcpSignature, bool, error)
func (*ChainStore) ReadLatestBeaconSlot ¶
func (cs *ChainStore) ReadLatestBeaconSlot() (uint64, bool, error)
func (*ChainStore) ReadLatestCheckPoint ¶
func (cs *ChainStore) ReadLatestCheckPoint() (uint64, bool, error)
func (*ChainStore) ReadMaxGasPrice ¶
func (cs *ChainStore) ReadMaxGasPrice() (uint64, bool, error)
func (*ChainStore) ReadMinerPower ¶
func (cs *ChainStore) ReadMinerPower(addr string) (*DbMiner, error)
func (*ChainStore) ReadNonce ¶
func (cs *ChainStore) ReadNonce(network, addr string) (uint64, bool, error)
func (*ChainStore) ReadRedeemTx ¶
func (cs *ChainStore) ReadRedeemTx(txId string) (*DbTx, bool, error)
func (*ChainStore) ReadSlotByHeight ¶
func (cs *ChainStore) ReadSlotByHeight(number uint64) (uint64, bool, error)
func (*ChainStore) ReadSubmitMaxValue ¶
func (cs *ChainStore) ReadSubmitMaxValue() (uint64, bool, error)
func (*ChainStore) ReadSubmitMinValue ¶
func (cs *ChainStore) ReadSubmitMinValue() (uint64, bool, error)
func (*ChainStore) ReadTxIdsByAddr ¶
func (*ChainStore) ReadTxProved ¶
func (cs *ChainStore) ReadTxProved(txId string) (bool, error)
func (*ChainStore) ReadUnGenProofs ¶
func (cs *ChainStore) ReadUnGenProofs(chainType common.ChainType) ([]*DbUnGenProof, error)
func (*ChainStore) ReadUnSubmitTxs ¶
func (cs *ChainStore) ReadUnSubmitTxs() ([]DbUnSubmitTx, error)
func (*ChainStore) ReadUpdateCpTx ¶
func (cs *ChainStore) ReadUpdateCpTx() (*DbTx, bool)
func (*ChainStore) ReadUpdateUtxoDest ¶
func (cs *ChainStore) ReadUpdateUtxoDest(hash string) (string, bool, error)
func (*ChainStore) ReadWorkerId ¶
func (cs *ChainStore) ReadWorkerId() (string, bool, error)
func (*ChainStore) ReadZkParamVerify ¶
func (cs *ChainStore) ReadZkParamVerify() (bool, error)
func (*ChainStore) UpdateProof ¶
func (cs *ChainStore) UpdateProof(txId string, proof string, proofType common.ProofType, status common.ProofStatus) error
func (*ChainStore) UpdateProofStatus ¶
func (cs *ChainStore) UpdateProofStatus(txId string, proofType common.ProofType, status common.ProofStatus) error
func (*ChainStore) WriteAddrPrefixTx ¶
func (cs *ChainStore) WriteAddrPrefixTx(txes []*DbTx) error
func (*ChainStore) WriteBeaconSlot ¶
func (cs *ChainStore) WriteBeaconSlot(number, slot uint64) error
func (*ChainStore) WriteBitcoinHash ¶
func (cs *ChainStore) WriteBitcoinHash(height uint64, hash string) error
func (*ChainStore) WriteBlockHeader ¶
func (cs *ChainStore) WriteBlockHeader(hash string, header string) error
func (*ChainStore) WriteBtcBlock ¶
func (cs *ChainStore) WriteBtcBlock(hash string, block string) error
func (*ChainStore) WriteBtcHeight ¶
func (cs *ChainStore) WriteBtcHeight(height uint64) error
func (*ChainStore) WriteBtcTxHeight ¶
func (cs *ChainStore) WriteBtcTxHeight(height uint64, txIds []string) error
func (*ChainStore) WriteBtcTxParam ¶
func (cs *ChainStore) WriteBtcTxParam(txId string, param interface{}) error
func (*ChainStore) WriteChainFork ¶
func (cs *ChainStore) WriteChainFork(chain string, forkInfo *ChainFork) error
func (*ChainStore) WriteCheckpoint ¶
func (cs *ChainStore) WriteCheckpoint(height uint64, hash string) error
func (*ChainStore) WriteDbProof ¶
func (cs *ChainStore) WriteDbProof(txes ...DbProof) error
func (*ChainStore) WriteDbTxes ¶
func (cs *ChainStore) WriteDbTxes(txes ...*DbTx) error
func (*ChainStore) WriteDestHash ¶
func (cs *ChainStore) WriteDestHash(key, value string) error
func (*ChainStore) WriteEthTxHeight ¶
func (cs *ChainStore) WriteEthTxHeight(height uint64, dbTxIds []string) error
func (*ChainStore) WriteEthereumHeight ¶
func (cs *ChainStore) WriteEthereumHeight(height uint64) error
func (*ChainStore) WriteFinalityUpdateSlot ¶
func (cs *ChainStore) WriteFinalityUpdateSlot(finalizeSlot uint64) error
func (*ChainStore) WriteIcpSignature ¶
func (cs *ChainStore) WriteIcpSignature(height uint64, value DbIcpSignature) error
func (*ChainStore) WriteLatestBeaconSlot ¶
func (cs *ChainStore) WriteLatestBeaconSlot(slot uint64) error
func (*ChainStore) WriteLatestCheckpoint ¶
func (cs *ChainStore) WriteLatestCheckpoint(height uint64) error
func (*ChainStore) WriteMaxGasPrice ¶
func (cs *ChainStore) WriteMaxGasPrice(price uint64) error
func (*ChainStore) WriteMiner ¶
func (cs *ChainStore) WriteMiner(addr string) error
func (*ChainStore) WriteMinerPower ¶
func (cs *ChainStore) WriteMinerPower(addr string, power, timestamp uint64) error
func (*ChainStore) WriteNonce ¶
func (cs *ChainStore) WriteNonce(network, addr string, nonce uint64) error
func (*ChainStore) WritePendingRequest ¶
func (cs *ChainStore) WritePendingRequest(proofId string, request *common.ProofRequest) error
func (*ChainStore) WriteProofResponse ¶
func (cs *ChainStore) WriteProofResponse(resp *common.SubmitProof) error
func (*ChainStore) WriteSubmitMaxValue ¶
func (cs *ChainStore) WriteSubmitMaxValue(value uint64) error
func (*ChainStore) WriteSubmitMinValue ¶
func (cs *ChainStore) WriteSubmitMinValue(value uint64) error
func (*ChainStore) WriteTxFinalizedSlot ¶
func (cs *ChainStore) WriteTxFinalizedSlot(txSlot uint64, tx *DbUnGenProof) error
func (*ChainStore) WriteTxIdsByAddr ¶
func (cs *ChainStore) WriteTxIdsByAddr(addr string, txes []DbTx) error
func (*ChainStore) WriteTxProved ¶
func (cs *ChainStore) WriteTxProved(txIds []string, status bool) error
func (*ChainStore) WriteTxSlot ¶
func (cs *ChainStore) WriteTxSlot(txSlot uint64, tx *DbUnGenProof) error
func (*ChainStore) WriteUnGenProof ¶
func (cs *ChainStore) WriteUnGenProof(chain common.ChainType, list ...*DbUnGenProof) error
func (*ChainStore) WriteUnSubmitTx ¶
func (cs *ChainStore) WriteUnSubmitTx(txes ...DbUnSubmitTx) error
func (*ChainStore) WriteUpdateUtxoDest ¶
func (cs *ChainStore) WriteUpdateUtxoDest(hash, dest string) error
func (*ChainStore) WriteWorkerId ¶
func (cs *ChainStore) WriteWorkerId(id string) error
func (*ChainStore) WriteZkParamVerify ¶
func (cs *ChainStore) WriteZkParamVerify(verify bool) error
type Config ¶
type Config struct {
RunConfig
BtcOperatorAddr string `json:"btcOperatorAddr"`
BtcLockScript string `json:"btcLockScript"`
GenesisSyncPeriod uint64 `json:"genesisPeriod"`
ZkBridgeAddr string `json:"zkBridgeAddr"`
ZkBtcAddr string `json:"zkBtcAddr"`
UtxoManagerAddr string `json:"utxoManagerAddr"`
OasisSignerAddress string `json:"oasisSignerAddress"`
IcpTxSingerAddress string `json:"icpTxSingerAddress"`
IcpBlockSignerAddress string `json:"icpBlockSignerAddress"`
BtcTxVerifyAddr string `json:"txVerifyAddr"`
EthAddrFilter *EthFilter `json:"ethAddrFilter"`
BtcFilter *BtcFilter `json:"btcFilter"`
EthScanTime time.Duration `json:"ethScanTime"`
BtcScanTime time.Duration `json:"btcScanTime"`
Debug bool
}
type DbIcpSignature ¶
type DbTx ¶
type DbTx struct {
Height uint64
TxIndex uint
Hash string
BlockHash string
BlockTime uint64
TxType common.TxType
ChainType common.ChainType
ProofType common.ProofType
Proved bool
Amount int64
GenProofNums int
// bitcoin chain
EthAddr string
// ethereum chain
LogIndex uint
UtxoId string
UtxoIndex int64
Sender string
Receiver string
TxSlot uint64 `cbor:"omitzero"`
FinalizedSlot uint64 `cbor:"omitzero"`
// for btc
CheckPointHeight uint64
LatestHeight uint64
CpMinDepth uint64
SigSigned bool // this flag is NOT read any where for now, turn its semantic to "SigNeeded"
}
func NewDepositBtcTx ¶
func NewDepositEthTx ¶
func NewMigrateBtcTx ¶
func NewRedeemBtcTx ¶
func NewRedeemEthTx ¶
func NewUpdateUtxoTx ¶
type DbUnGenProof ¶
type DbUnSubmitTx ¶
type DbUnSubmitTx struct {
Hash string
ProofType common.ProofType
Proof string
Timestamp int64
ConfirmHash string //
Status int
}
func NewDbUnSubmitTx ¶
func NewDbUnSubmitTx(hash, proof string, proofType common.ProofType) DbUnSubmitTx
type DownloadStatus ¶
type DownloadStatus int
type EthFilter ¶
type EthFilter struct {
UtxoManagerAddr string `json:"depositAddr"`
ZkbtcBridgeAddr string `json:"redeemAddr"`
DepositTxTopic string `json:"depositTxTopic"`
RedeemTxTopic string `json:"redeemTxTopic"`
UpdateUtxoTopic string `json:"updateUtxoTopic"`
BtcLockScript string `json:"btcLockScript"`
// contains filtered or unexported fields
}
func NewEthAddrFilter ¶
func (*EthFilter) FilterLogs ¶
func (*EthFilter) UpdateUtxo ¶
type Fetch ¶
type Fetch struct {
// contains filtered or unexported fields
}
func NewFetch ¶
func NewFetch(client beacon.IMultiBeacon, store store.IStore, fileStore *FileStorage, genesisSlot uint64, update, finalityUpate chan *Notify) (*Fetch, error)
func (*Fetch) CheckFinalityUpdate ¶
func (*Fetch) CheckLightClientUpdate ¶
func (*Fetch) FinalityUpdate ¶
func (*Fetch) GetFinalityUpdate ¶
func (*Fetch) GetLightClientUpdate ¶
func (*Fetch) LightClientUpdate ¶
func (*Fetch) StoreLatestPeriod ¶
type FetchRequest ¶
type FetchRequest struct {
UpdateType FetchType
Status DownloadStatus
// contains filtered or unexported fields
}
type FetchResponse ¶
type FetchResponse struct {
FetchId string
Index uint64
UpdateType FetchType
// contains filtered or unexported fields
}
func NewFetchResponse ¶
func NewFetchResponse(updateType FetchType, index uint64, data interface{}) *FetchResponse
func (*FetchResponse) Id ¶
func (f *FetchResponse) Id() string
type FileStorage ¶
type FileStorage struct {
RootPath string
FileMaps *sync.Map // store.Table -> store.IFileStore
// contains filtered or unexported fields
}
func NewFileStorage ¶
func (*FileStorage) BtcBaseIndexes ¶
func (fs *FileStorage) BtcBaseIndexes(start, height uint64) ([]uint64, error)
func (*FileStorage) BtcChainIndex ¶
func (fs *FileStorage) BtcChainIndex(height uint64) (uint64, bool, error)
func (*FileStorage) BtcDepthIndex ¶
func (fs *FileStorage) BtcDepthIndex(cpHeight, genesis, height uint64) (uint64, bool, error)
func (*FileStorage) BtcMiddleIndexes ¶
func (fs *FileStorage) BtcMiddleIndexes(start, height uint64) ([]Index, error)
func (*FileStorage) CheckFinalityUpdate ¶
func (fs *FileStorage) CheckFinalityUpdate(slot uint64) (bool, error)
func (*FileStorage) CheckProof ¶
func (fs *FileStorage) CheckProof(key StoreKey) (bool, error)
func (*FileStorage) CheckUpdate ¶
func (fs *FileStorage) CheckUpdate(period uint64) (bool, error)
func (*FileStorage) Clear ¶
func (fs *FileStorage) Clear() error
func (*FileStorage) CurrentBtcChainIndex ¶
func (fs *FileStorage) CurrentBtcChainIndex() (*ChainIndex, bool, error)
func (*FileStorage) CurrentBtcCpDepthIndex ¶
func (fs *FileStorage) CurrentBtcCpDepthIndex(cpHeight uint64) (*ChainIndex, bool, error)
func (*FileStorage) DelProof ¶
func (fs *FileStorage) DelProof(key StoreKey) error
func (*FileStorage) FileStore ¶
func (fs *FileStorage) FileStore(key StoreKey, create ...bool) (store.IFileStore, bool)
func (*FileStorage) FindBtcChainProof ¶
func (fs *FileStorage) FindBtcChainProof(height uint64) (*WrapStorageProof, bool, error)
func (*FileStorage) FindDepthProof ¶
func (fs *FileStorage) FindDepthProof(prefix, height uint64) (*WrapStorageProof, bool, error)
func (*FileStorage) GenOuterIndexes ¶
func (fs *FileStorage) GenOuterIndexes() ([]uint64, error)
func (*FileStorage) Get ¶
func (fs *FileStorage) Get(table store.Table, value interface{}, key ...interface{}) (bool, error)
func (*FileStorage) GetBackendRedeemProof ¶
func (fs *FileStorage) GetBackendRedeemProof(txHash string) (*StoreProof, bool, error)
func (*FileStorage) GetBeaconHeaderProof ¶
func (fs *FileStorage) GetBeaconHeaderProof(start, end uint64) (*StoreProof, bool, error)
func (*FileStorage) GetBhfProof ¶
func (fs *FileStorage) GetBhfProof(period uint64) (*StoreProof, bool, error)
func (*FileStorage) GetBtcBaseProof ¶
func (fs *FileStorage) GetBtcBaseProof(start, end uint64) (*StoreProof, bool, error)
func (*FileStorage) GetBtcBulkProof ¶
func (fs *FileStorage) GetBtcBulkProof(index, end uint64) (*StoreProof, bool, error)
func (*FileStorage) GetBtcMiddleProof ¶
func (fs *FileStorage) GetBtcMiddleProof(start, end uint64) (*StoreProof, bool, error)
func (*FileStorage) GetBtcTimestampProof ¶
func (fs *FileStorage) GetBtcTimestampProof(txHeight, latestHeight uint64) (*StoreProof, bool, error)
func (*FileStorage) GetBtcUpperProof ¶
func (fs *FileStorage) GetBtcUpperProof(start, end uint64) (*StoreProof, bool, error)
func (*FileStorage) GetDutyProof ¶
func (fs *FileStorage) GetDutyProof(period uint64) (*StoreProof, bool, error)
func (*FileStorage) GetFileStore ¶
func (fs *FileStorage) GetFileStore(table store.Table) (store.IFileStore, bool)
func (*FileStorage) GetFinalityUpdate ¶
func (fs *FileStorage) GetFinalityUpdate(slot uint64, value interface{}) (bool, error)
func (*FileStorage) GetGenesisPeriod ¶
func (fs *FileStorage) GetGenesisPeriod() uint64
func (*FileStorage) GetLatestFinalizedSlot ¶
func (fs *FileStorage) GetLatestFinalizedSlot() (uint64, bool, error)
func (*FileStorage) GetLatestPeriod ¶
func (fs *FileStorage) GetLatestPeriod() (uint64, bool, error)
func (*FileStorage) GetOuterProof ¶
func (fs *FileStorage) GetOuterProof(period uint64) (*StoreProof, bool, error)
func (*FileStorage) GetProof ¶
func (fs *FileStorage) GetProof(key StoreKey) (*StoreProof, bool, error)
func (*FileStorage) GetRecursiveProof ¶
func (fs *FileStorage) GetRecursiveProof(period uint64) (*StoreProof, bool, error)
func (*FileStorage) GetRedeemProof ¶
func (fs *FileStorage) GetRedeemProof(txHash string) (*StoreProof, bool, error)
func (*FileStorage) GetRootPath ¶
func (fs *FileStorage) GetRootPath() string
func (*FileStorage) GetSgxRedeemProof ¶
func (fs *FileStorage) GetSgxRedeemProof(hash string) (*StoreProof, bool, error)
func (*FileStorage) GetSubFileStore ¶
func (fs *FileStorage) GetSubFileStore(table, sub store.Table, create ...bool) (store.IFileStore, bool)
func (*FileStorage) GetSyncInnerProof ¶
func (fs *FileStorage) GetSyncInnerProof(period, index uint64) (*StoreProof, bool, error)
func (*FileStorage) GetTxFinalizedSlot ¶
func (fs *FileStorage) GetTxFinalizedSlot(txSlot uint64) (uint64, bool, error)
func (*FileStorage) GetTxProof ¶
func (fs *FileStorage) GetTxProof(txHash string) (*StoreProof, bool, error)
func (*FileStorage) GetUnitProof ¶
func (fs *FileStorage) GetUnitProof(period uint64) (*StoreProof, bool, error)
func (*FileStorage) GetUpdate ¶
func (fs *FileStorage) GetUpdate(period uint64, value interface{}) (bool, error)
func (*FileStorage) NeedDutyIndexes ¶
func (fs *FileStorage) NeedDutyIndexes() ([]uint64, error)
func (*FileStorage) NeedGenUnitProofIndexes ¶
func (fs *FileStorage) NeedGenUnitProofIndexes() ([]uint64, error)
func (*FileStorage) NeedUpdateIndexes ¶
func (fs *FileStorage) NeedUpdateIndexes() ([]uint64, error)
func (*FileStorage) RemoveBtcProof ¶
func (fs *FileStorage) RemoveBtcProof(height uint64) error
func (*FileStorage) StoreErrorFinalityUpdate ¶
func (fs *FileStorage) StoreErrorFinalityUpdate(key string, data interface{}) error
func (*FileStorage) StoreFinalityUpdate ¶
func (fs *FileStorage) StoreFinalityUpdate(slot uint64, data interface{}) error
func (*FileStorage) StoreLatestFinalizedSlot ¶
func (fs *FileStorage) StoreLatestFinalizedSlot(slot uint64) error
func (*FileStorage) StoreLatestPeriod ¶
func (fs *FileStorage) StoreLatestPeriod(period uint64) error
func (*FileStorage) StoreProof ¶
func (fs *FileStorage) StoreProof(key StoreKey, proof, witness []byte) error
func (*FileStorage) StoreRequest ¶
func (fs *FileStorage) StoreRequest(req *common.ProofRequest, extraIds ...string) error
func (*FileStorage) StoreUpdate ¶
func (fs *FileStorage) StoreUpdate(period uint64, value interface{}) error
func (*FileStorage) SyncComInnerIndexes ¶
func (fs *FileStorage) SyncComInnerIndexes() ([]Index, error)
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler(txManager *TxManager, manager IManager, ethReScan, btcReScan chan *ReScnSignal, store store.IStore, fileStore *FileStorage, exitCh chan os.Signal, btcClient *bitcoin.Client, proverClient btcproverClient.IClient, miner, network string) *Handler
func (*Handler) AutoSubmitMaxValue ¶
func (*Handler) AutoSubmitMinValue ¶
func (*Handler) GetZkProofTask ¶
func (h *Handler) GetZkProofTask(request common.TaskRequest) (*common.TaskResponse, error)
func (*Handler) SubmitProof ¶
func (h *Handler) SubmitProof(req *common.SubmitProof) (string, error)
func (*Handler) Transaction ¶
func (h *Handler) Transaction(txHash string) ([]*rpc.Transaction, error)
func (*Handler) Transactions ¶
func (h *Handler) Transactions(txIds []string) ([]*rpc.Transaction, error)
func (*Handler) TransactionsByHeight ¶
type IAgent ¶
type IAgent interface {
ScanBlock() error
ReScan(height uint64) error
ProofResponse(resp *common.ProofResponse) error
Init() error
CheckState() error
Close() error
Name() string
}
func NewBitcoinAgent ¶
type IManager ¶
type IManager interface {
IScheduler
Init() error
PendingProofRequest() []*common.ProofRequest
CheckState() error
GetProofRequest(proofTypes []common.ProofType) (*common.ProofRequest, bool, error)
ReceiveProofs(submitProof *common.SubmitProof) error
LibP2pMessage(msg *p2p.Msg) error
MinerPower() error
AddP2pPeer(addr string) error
ChainFork(signal *ChainFork) error
EthNotify() chan *Notify
BtcNotify() chan *Notify
BeaconNotify() chan *Notify
Close() error
}
func NewManager ¶
func NewManager(minerAddr string, libP2p *p2p.LibP2p, icpClient *dfinity.Client, btcClient *bitcoin.Client, ethClient *ethereum.Client, beaconClient *beacon.Client, prep *Prepared, btcProofResp, ethProofResp, syncCommitteeProofResp chan *common.ProofResponse, store store.IStore, fileStore *FileStorage, btcNotify, ethNotify, beaconNotify chan *Notify) (IManager, error)
type IScheduler ¶
type KeyStore ¶
type KeyStore struct {
// contains filtered or unexported fields
}
func NewKeyStore ¶
func (*KeyStore) CheckPermission ¶
func (k *KeyStore) CheckPermission(method string) (rpc.Permission, error)
func (*KeyStore) EthAddress ¶
func (*KeyStore) GetPrivateKey ¶
type LocalWorker ¶
type LocalWorker struct {
// contains filtered or unexported fields
}
func (*LocalWorker) AddReqNum ¶
func (w *LocalWorker) AddReqNum()
func (*LocalWorker) BackendRedeemProof ¶
func (w *LocalWorker) BackendRedeemProof(req *rpc.RedeemRequest) (*rpc.RedeemResponse, error)
func (*LocalWorker) BlockHeaderFinalityProve ¶
func (w *LocalWorker) BlockHeaderFinalityProve(req *rpc.BlockHeaderFinalityRequest) (*rpc.BlockHeaderFinalityResponse, error)
func (*LocalWorker) BlockHeaderProve ¶
func (w *LocalWorker) BlockHeaderProve(req *rpc.BlockHeaderRequest) (*rpc.BlockHeaderResponse, error)
func (*LocalWorker) BtcBaseProve ¶
func (w *LocalWorker) BtcBaseProve(req *rpc.BtcBaseRequest) (*rpc.ProofResponse, error)
func (*LocalWorker) BtcBulkProve ¶
func (w *LocalWorker) BtcBulkProve(req *rpc.BtcBulkRequest) (*rpc.BtcBulkResponse, error)
func (*LocalWorker) BtcChainProve ¶
func (w *LocalWorker) BtcChainProve(req *rpc.BtcChainRequest) (*rpc.ProofResponse, error)
func (*LocalWorker) BtcChangeProve ¶
func (w *LocalWorker) BtcChangeProve(req *rpc.BtcChangeRequest) (*rpc.ProofResponse, error)
func (*LocalWorker) BtcDepositProve ¶
func (w *LocalWorker) BtcDepositProve(req *rpc.BtcDepositRequest) (*rpc.ProofResponse, error)
func (*LocalWorker) BtcDepthRecursiveProve ¶
func (w *LocalWorker) BtcDepthRecursiveProve(req *rpc.BtcDepthRecursiveRequest) (*rpc.ProofResponse, error)
func (*LocalWorker) BtcDuperRecursiveProve ¶
func (w *LocalWorker) BtcDuperRecursiveProve(req *rpc.BtcDuperRecursiveRequest) (*rpc.ProofResponse, error)
func (*LocalWorker) BtcMiddleProve ¶
func (w *LocalWorker) BtcMiddleProve(req *rpc.BtcMiddleRequest) (*rpc.ProofResponse, error)
func (*LocalWorker) BtcTimestamp ¶
func (w *LocalWorker) BtcTimestamp(req *rpc.BtcTimestampRequest) (*rpc.ProofResponse, error)
func (*LocalWorker) BtcUpperProve ¶
func (w *LocalWorker) BtcUpperProve(req *rpc.BtcUpperRequest) (*rpc.ProofResponse, error)
func (*LocalWorker) Close ¶
func (w *LocalWorker) Close() error
func (*LocalWorker) CurrentNums ¶
func (w *LocalWorker) CurrentNums() int
func (*LocalWorker) DelReqNum ¶
func (w *LocalWorker) DelReqNum()
func (*LocalWorker) Id ¶
func (w *LocalWorker) Id() string
func (*LocalWorker) MaxNums ¶
func (w *LocalWorker) MaxNums() int
func (*LocalWorker) ProofInfo ¶
func (w *LocalWorker) ProofInfo(proofId string) (rpc.ProofInfo, error)
func (*LocalWorker) RedeemProof ¶
func (w *LocalWorker) RedeemProof(req *rpc.RedeemRequest) (*rpc.RedeemResponse, error)
func (*LocalWorker) SupportProofType ¶
func (w *LocalWorker) SupportProofType() []common.ProofType
func (*LocalWorker) SyncCommDutyProve ¶
func (w *LocalWorker) SyncCommDutyProve(req rpc.SyncCommDutyRequest) (*rpc.SyncCommDutyResponse, error)
func (*LocalWorker) SyncCommInner ¶
func (w *LocalWorker) SyncCommInner(req *rpc.SyncCommInnerRequest) (*rpc.ProofResponse, error)
func (*LocalWorker) SyncCommOuter ¶
func (w *LocalWorker) SyncCommOuter(req *rpc.SyncCommOuterRequest) (*rpc.ProofResponse, error)
func (*LocalWorker) SyncCommitUnitProve ¶
func (w *LocalWorker) SyncCommitUnitProve(req rpc.SyncCommUnitsRequest) (*rpc.SyncCommUnitsResponse, error)
func (*LocalWorker) TxInEth2Prove ¶
func (w *LocalWorker) TxInEth2Prove(req *rpc.TxInEth2ProveRequest) (*rpc.TxInEth2ProveResponse, error)
type Memguard ¶
type Memguard struct {
// contains filtered or unexported fields
}
func NewMemguard ¶
func NewMemguard() *Memguard
type MemoryStore ¶
type MemoryStore struct {
// contains filtered or unexported fields
}
func NewMemoryStore ¶
func NewMemoryStore(store store.IStore) *MemoryStore
func (*MemoryStore) FindFinalityUpdateNearestSlot ¶
func (s *MemoryStore) FindFinalityUpdateNearestSlot(txSlot uint64) (uint64, bool, error)
func (*MemoryStore) WriteFinalityUpdateSlot ¶
func (s *MemoryStore) WriteFinalityUpdateSlot(slot uint64) error
type MinerPower ¶
func NewMinerPower ¶
func NewMinerPower(address string, power uint64, createTime time.Time) *MinerPower
func (*MinerPower) AddConstant ¶
func (m *MinerPower) AddConstant(constant uint64)
func (*MinerPower) AvgConstantPerHour ¶
func (m *MinerPower) AvgConstantPerHour() float64
type PendingQueue ¶
type PendingQueue struct {
// contains filtered or unexported fields
}
func NewPendingQueue ¶
func NewPendingQueue() *PendingQueue
func (*PendingQueue) Add ¶
func (q *PendingQueue) Add(key string, value *common.ProofRequest)
func (*PendingQueue) Delete ¶
func (q *PendingQueue) Delete(key string)
func (*PendingQueue) Get ¶
func (q *PendingQueue) Get(key string) (*common.ProofRequest, bool)
func (*PendingQueue) Iterator ¶
func (q *PendingQueue) Iterator(fn func(value *common.ProofRequest) bool) []*common.ProofRequest
type Prepared ¶
type Prepared struct {
// contains filtered or unexported fields
}
func NewPreparedData ¶
func NewPreparedData(filestore *FileStorage, store store.IStore, genesisSlot, btcGenesisHeight uint64, proverClient *BtcClient, btcClient *btcrpc.Client, ethClient *ethrpc.Client, apiClient *apiclient.Client, beaconClient *beacon.Client, minerAddr, network string, scNewRecursive bool) (*Prepared, error)
func (*Prepared) GetBeaconHeaderId ¶
func (*Prepared) GetBhfUpdateRequest ¶
func (*Prepared) GetBlockHeaderRequest ¶
func (*Prepared) GetBtcBaseRequest ¶
func (*Prepared) GetBtcBulkRequest ¶
func (p *Prepared) GetBtcBulkRequest(start, end, prefix uint64) (*rpc.BtcBulkRequest, error)
func (*Prepared) GetBtcChangeRequest ¶
func (*Prepared) GetBtcDepositRequest ¶
func (*Prepared) GetBtcDepthRecursiveRequest ¶
func (*Prepared) GetBtcDuperRecursiveRequest ¶
func (*Prepared) GetBtcMiddleRequest ¶
func (*Prepared) GetBtcTimestampRequest ¶
func (*Prepared) GetBtcUpperRequest ¶
func (*Prepared) GetDutyRequest ¶
func (*Prepared) GetRedeemRequest ¶
func (*Prepared) GetSyncComInnerRequest ¶
func (*Prepared) GetSyncComUnitRequest ¶
func (*Prepared) GetSyncCommitRootId ¶
func (*Prepared) GetSyncCommitUpdate ¶
func (*Prepared) GetSyncCommittee ¶
func (p *Prepared) GetSyncCommittee(period uint64) (*WrapSyncCommittee, bool, error)
func (*Prepared) GetSyncOuterRequest ¶
func (*Prepared) GetTxInEth2Request ¶
type ProofRespQueue ¶
type ProofRespQueue struct {
// contains filtered or unexported fields
}
func NewProofRespQueue ¶
func NewProofRespQueue() *ProofRespQueue
func (*ProofRespQueue) Delete ¶
func (q *ProofRespQueue) Delete(key string)
func (*ProofRespQueue) Get ¶
func (q *ProofRespQueue) Get(key string) (*common.SubmitProof, error)
func (*ProofRespQueue) Iterator ¶
func (q *ProofRespQueue) Iterator(fn func(value *common.SubmitProof) error)
func (*ProofRespQueue) Push ¶
func (q *ProofRespQueue) Push(value *common.SubmitProof)
type QueueManager ¶
type QueueManager struct {
// contains filtered or unexported fields
}
func NewQueueManager ¶
func NewQueueManager() *QueueManager
func (*QueueManager) AddPending ¶
func (q *QueueManager) AddPending(key string, value *common.ProofRequest)
func (*QueueManager) CheckId ¶
func (q *QueueManager) CheckId(proofId string) bool
func (*QueueManager) DeleteId ¶
func (q *QueueManager) DeleteId(proofId string)
func (*QueueManager) DeletePending ¶
func (q *QueueManager) DeletePending(key string)
func (*QueueManager) FilterPending ¶
func (q *QueueManager) FilterPending(fn func(value *common.ProofRequest) bool) []*common.ProofRequest
func (*QueueManager) FilterRequest ¶
func (q *QueueManager) FilterRequest(fn func(value *common.ProofRequest) bool) []*common.ProofRequest
func (*QueueManager) GetPending ¶
func (q *QueueManager) GetPending(key string) (*common.ProofRequest, bool)
func (*QueueManager) ListRequest ¶
func (q *QueueManager) ListRequest() []*common.ProofRequest
func (*QueueManager) PopFnRequest ¶
func (q *QueueManager) PopFnRequest(fn func(req *common.ProofRequest) bool) (*common.ProofRequest, bool)
func (*QueueManager) PopRequest ¶
func (q *QueueManager) PopRequest() (*common.ProofRequest, bool)
func (*QueueManager) PushRequest ¶
func (q *QueueManager) PushRequest(req *common.ProofRequest)
func (*QueueManager) RemoveRequest ¶
func (q *QueueManager) RemoveRequest(fn func(value *common.ProofRequest) bool) []*common.ProofRequest
func (*QueueManager) RequestLen ¶
func (q *QueueManager) RequestLen() int
func (*QueueManager) StoreId ¶
func (q *QueueManager) StoreId(proofId string)
type ReScnSignal ¶
type ReScnSignal struct {
Height uint64
}
type RunConfig ¶
type RunConfig struct {
Datadir string `json:"datadir"`
Rpcbind string `json:"rpcbind"`
Rpcport string `json:"rpcport"`
WsPort string `json:"wsport"`
Network string `json:"network"`
BtcUser string `json:"btcUser"`
BtcPwd string `json:"btcPwd"`
BtcUrl []string `json:"btcUrl"`
EthUrl string `json:"ethUrl"`
BeaconUrl []string `json:"beaconUrl"`
OasisUrl string `json:"oasisUrl"`
SgxUrl []string `json:"sgxUrl"`
DiscordHookUrl string `json:"discordHookUrl"`
ScNewRecursive bool `json:"scNewRecursive"`
IcpWalletAddress string `json:"icpWalletAddress"`
IcpPrivateKey string `json:"icpPrivateKey"`
Mode Mode `json:"mode"`
MinerAddr string `json:"minerAddr"`
BtcReScan bool `json:"btcReScan"`
EthReScan bool `json:"ethReScan"`
TxMode common.TxMode `json:"txMode"`
BeaconReScan bool `json:"beaconReScan"`
EthPrivateKey string `json:"ethPrivateKey"`
EnableLocalWorker bool `json:"enableLocalWorker"`
BtcInitHeight uint64 `json:"btcInitHeight"`
EthInitHeight uint64 `json:"ethInitHeight"`
BeaconInitSlot uint64 `json:"beaconInitSlot"`
GenesisBeaconSlot uint64 `json:"genesisBeaconSlot"`
BtcGenesisHeight uint64 `json:"btcGenesisHeight"`
BtcCpBlockHeight int64 `json:"btcCpBlockHeight"`
DisableBtcAgent bool `json:"disableBtcAgent"`
DisableEthAgent bool `json:"disableEthAgent"`
DisableBeaconAgent bool `json:"disableBeaconAgent"`
BtcMainnetPath string `json:"btcMainnetPath"`
DisableLipP2p bool `json:"disableLipP2p"`
BtcSetupDir string `json:"btcSetupDir"`
EthSetupDir string `json:"ethSetupDir"`
DisableFetch bool `json:"disableFetch"`
P2pPort int `json:"p2pPort"`
P2pBootstraps []string `json:"p2pBootstraps"`
}
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
func NewScheduler ¶
func (*Scheduler) CheckBeaconState ¶
func (*Scheduler) CheckBtcState ¶
func (*Scheduler) CheckEthState ¶
func (*Scheduler) CheckPreBtcState ¶
func (*Scheduler) GetPendingRequest ¶
func (s *Scheduler) GetPendingRequest(proofId string) (*common.ProofRequest, bool)
func (*Scheduler) PendingProofRequest ¶
func (s *Scheduler) PendingProofRequest() []*common.ProofRequest
func (*Scheduler) PendingRequest ¶
func (s *Scheduler) PendingRequest() []*common.ProofRequest
func (*Scheduler) UpdateProofStatus ¶
func (s *Scheduler) UpdateProofStatus(req *common.ProofRequest, status common.ProofStatus) error
type StoreKey ¶
type StoreKey struct {
PType common.ProofType
Hash string
FIndex, SIndex uint64
Prefix uint64
BlockTime uint64
TxIndex uint32
// contains filtered or unexported fields
}
func NewDoubleStoreKey ¶
func NewPrefixStoreKey ¶
func NewStoreKey ¶
type StoreProof ¶
type SubmitQueue ¶
type SubmitQueue struct {
// contains filtered or unexported fields
}
func NewSubmitQueue ¶
func NewSubmitQueue() *SubmitQueue
func (*SubmitQueue) Delete ¶
func (q *SubmitQueue) Delete(key string)
func (*SubmitQueue) Get ¶
func (q *SubmitQueue) Get(key string) (*common.ProofResponse, error)
func (*SubmitQueue) Iterator ¶
func (q *SubmitQueue) Iterator(fn func(value *common.ProofResponse) error)
func (*SubmitQueue) Push ¶
func (q *SubmitQueue) Push(value *common.ProofResponse)
type TxManager ¶
type TxManager struct {
// contains filtered or unexported fields
}
func NewTxManager ¶
func NewTxManager(store store.IStore, fileStore *FileStorage, prepared *Prepared, keyStore *KeyStore, ethClient *ethrpc.Client, btcClient *bitcoin.Client, oasisClient *oasis.Client, dfinityClient *dfinity.Client, sgxClient sgx.ISgx, proverClient btcproverClient.IClient, minerAddr, network string) (*TxManager, error)
func (*TxManager) AddTask ¶
func (t *TxManager) AddTask(resp *common.ProofResponse)
func (*TxManager) CheckEthBalance ¶
func (*TxManager) DepositBtc ¶
func (t *TxManager) DepositBtc(tx DbUnSubmitTx) (string, error)
func (*TxManager) UpdateUtxoChange ¶
func (t *TxManager) UpdateUtxoChange(tx DbUnSubmitTx) (string, error)
type UniqueList ¶
func NewUniqueList ¶
func NewUniqueList() *UniqueList
func (*UniqueList) Add ¶
func (ul *UniqueList) Add(value string)
func (*UniqueList) List ¶
func (ul *UniqueList) List() []string
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) BackendRedeemProof ¶
func (w *Worker) BackendRedeemProof(req *rpc.RedeemRequest) (*rpc.RedeemResponse, error)
func (*Worker) BlockHeaderFinalityProve ¶
func (w *Worker) BlockHeaderFinalityProve(req *rpc.BlockHeaderFinalityRequest) (*rpc.BlockHeaderFinalityResponse, error)
func (*Worker) BlockHeaderProve ¶
func (w *Worker) BlockHeaderProve(req *rpc.BlockHeaderRequest) (*rpc.BlockHeaderResponse, error)
func (*Worker) BtcBaseProve ¶
func (w *Worker) BtcBaseProve(req *rpc.BtcBaseRequest) (*rpc.ProofResponse, error)
func (*Worker) BtcBulkProve ¶
func (w *Worker) BtcBulkProve(req *rpc.BtcBulkRequest) (*rpc.BtcBulkResponse, error)
func (*Worker) BtcChangeProve ¶
func (w *Worker) BtcChangeProve(req *rpc.BtcChangeRequest) (*rpc.ProofResponse, error)
func (*Worker) BtcDepositProve ¶
func (w *Worker) BtcDepositProve(req *rpc.BtcDepositRequest) (*rpc.ProofResponse, error)
func (*Worker) BtcDepthRecursiveProve ¶
func (w *Worker) BtcDepthRecursiveProve(req *rpc.BtcDepthRecursiveRequest) (*rpc.ProofResponse, error)
func (*Worker) BtcDuperRecursiveProve ¶
func (w *Worker) BtcDuperRecursiveProve(req *rpc.BtcDuperRecursiveRequest) (*rpc.ProofResponse, error)
func (*Worker) BtcMiddleProve ¶
func (w *Worker) BtcMiddleProve(req *rpc.BtcMiddleRequest) (*rpc.ProofResponse, error)
func (*Worker) BtcTimestamp ¶
func (w *Worker) BtcTimestamp(req *rpc.BtcTimestampRequest) (*rpc.ProofResponse, error)
func (*Worker) BtcUpperProve ¶
func (w *Worker) BtcUpperProve(req *rpc.BtcUpperRequest) (*rpc.ProofResponse, error)
func (*Worker) CurrentNums ¶
func (*Worker) RedeemProof ¶
func (w *Worker) RedeemProof(req *rpc.RedeemRequest) (*rpc.RedeemResponse, error)
func (*Worker) SupportProofType ¶
func (*Worker) SyncCommDutyProve ¶
func (w *Worker) SyncCommDutyProve(req rpc.SyncCommDutyRequest) (*rpc.SyncCommDutyResponse, error)
func (*Worker) SyncCommInner ¶
func (w *Worker) SyncCommInner(req *rpc.SyncCommInnerRequest) (*rpc.ProofResponse, error)
func (*Worker) SyncCommOuter ¶
func (w *Worker) SyncCommOuter(req *rpc.SyncCommOuterRequest) (*rpc.ProofResponse, error)
func (*Worker) SyncCommitUnitProve ¶
func (w *Worker) SyncCommitUnitProve(req rpc.SyncCommUnitsRequest) (*rpc.SyncCommUnitsResponse, error)
func (*Worker) TxInEth2Prove ¶
func (w *Worker) TxInEth2Prove(req *rpc.TxInEth2ProveRequest) (*rpc.TxInEth2ProveResponse, error)
type WorkerConfig ¶
type WrapStorageProof ¶
type WrapStorageProof struct {
StoreProof
ChainIndex
}
type WrapSyncCommittee ¶
type WrapSyncCommittee struct {
*proverType.SyncCommittee
Version string
}
type WrapperAgent ¶
type WrapperAgent struct {
IAgent
// contains filtered or unexported fields
}
func NewWrapperAgent ¶
func NewWrapperAgent(agent IAgent, scanTime time.Duration, reScan chan *ReScnSignal, proofResp chan *common.ProofResponse) *WrapperAgent
type WrapperManger ¶
type WrapperManger struct {
IManager
// contains filtered or unexported fields
}
func NewWrapperManger ¶
func NewWrapperManger(manager IManager, request chan *ChainFork) *WrapperManger
type ZkParams ¶
type ZkParams struct {
*zkbridge.IBtcTxVerifierPublicWitnessParams
// contains filtered or unexported fields
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.