import { CycleRecord } from '@shardeum-foundation/lib-types/build/src/p2p/CycleCreatorTypes'; import { Logger as log4jLogger } from 'log4js'; import StateManager from '.'; import Crypto from '../crypto'; import Logger from '../logger'; import { P2PModuleContext as P2P } from '../p2p/Context'; import * as Shardus from '../shardus/shardus-types'; import { TimestampReceipt } from '../shardus/shardus-types'; import Storage from '../storage'; import { Ordering } from '../utils'; import Profiler from '../utils/profiler'; import { AppliedVote, AppliedVoteHash, ConfirmOrChallengeMessage, ConfirmOrChallengeQueryResponse, QueueEntry, Proposal, SignedReceipt } from './state-manager-types'; declare class TransactionConsenus { app: Shardus.App; crypto: Crypto; config: Shardus.StrictServerConfiguration; profiler: Profiler; logger: Logger; p2p: P2P; storage: Storage; stateManager: StateManager; mainLogger: log4jLogger; seqLogger: log4jLogger; fatalLogger: log4jLogger; shardLogger: log4jLogger; statsLogger: log4jLogger; statemanager_fatal: (key: string, log: string) => void; txTimestampCache: Map>; txTimestampCacheByTxId: Map; seenTimestampRequests: Set; produceBadVote: boolean; produceBadChallenge: boolean; debugFailPOQo: number; constructor(stateManager: StateManager, profiler: Profiler, app: Shardus.App, logger: Logger, storage: Storage, p2p: P2P, crypto: Crypto, config: Shardus.StrictServerConfiguration); /*** * ######## ## ## ######## ######## ####### #### ## ## ######## ###### * ## ### ## ## ## ## ## ## ## ## ### ## ## ## ## * ## #### ## ## ## ## ## ## ## ## #### ## ## ## * ###### ## ## ## ## ## ######## ## ## ## ## ## ## ## ###### * ## ## #### ## ## ## ## ## ## ## #### ## ## * ## ## ### ## ## ## ## ## ## ## ### ## ## ## * ######## ## ## ######## ## ####### #### ## ## ## ###### */ setupHandlers(): void; verifyAppliedReceipt(receipt: SignedReceipt, executionGroupNodes: Set): boolean; poqoVoteSendLoop(queueEntry: QueueEntry, appliedVoteHash: AppliedVoteHash): Promise; getOrGenerateTimestampReceiptFromCache(txId: string, cycleMarker: string, cycleCounter: CycleRecord['counter']): TimestampReceipt; pruneTxTimestampCache(): void; askTxnTimestampFromNode(txId: string): Promise; private getTxTimestampGeneratingNode; /** * shareAppliedReceipt * gossip the appliedReceipt to the transaction group * @param queueEntry */ /** * hasAppliedReceiptMatchingPreApply * check if our data matches our vote * If the vote was for an appliable, on failed result then check if our local data * that is ready to be committed will match the receipt * * @param queueEntry */ hasAppliedReceiptMatchingPreApply(queueEntry: QueueEntry, signedReceipt: SignedReceipt): boolean; /** * tryProduceReceipt * try to produce an AppliedReceipt * if we can't do that yet return null * * @param queueEntry */ tryProduceReceipt(queueEntry: QueueEntry): Promise; robustQueryBestVote(queueEntry: QueueEntry): Promise; robustQueryConfirmOrChallenge(queueEntry: QueueEntry): Promise; robustQueryAccountData(consensNodes: Shardus.Node[], accountId: string, txId: string): Promise; sortByAccountId(first: Shardus.WrappedResponse, second: Shardus.WrappedResponse): Ordering; checkAccountIntegrity(queueEntry: QueueEntry): Promise; /** * createAndShareVote * create an AppliedVote * gossip the AppliedVote * @param queueEntry */ createAndShareVote(queueEntry: QueueEntry): Promise; calculateVoteHash(vote: Proposal): string; addPendingConfirmOrChallenge(queueEntry: QueueEntry, confirmOrChallenge: ConfirmOrChallengeMessage): void; /** * tryAppendVote * if we have not seen this vote yet search our list of votes and append it in * the correct spot sorted by signer's id * @param queueEntry * @param vote */ tryAppendVote(queueEntry: QueueEntry, vote: AppliedVote): boolean; tryAppendVoteHash(queueEntry: QueueEntry, voteHash: AppliedVoteHash): boolean; } export default TransactionConsenus;