Skip to content

sgns::TransactionManager

Coordinates transaction creation, CRDT propagation, verification, and status tracking.

#include <TransactionManager.hpp>

Inherits from std::enable_shared_from_this< TransactionManager >

Public Classes

Name
struct TransactionCompletion
Value delivered when an asynchronous outgoing-transaction wait completes.

Public Types

Name
enum class uint8_t Error
enum class uint8_t State { CREATING = 0, INITIALIZING, SYNCING, READY}
State of the Transaction Manager.
enum class uint8_t TransactionStatus { CREATED, SENDING, CONFIRMED, VERIFYING, UNCONFIRMED, FAILED, INVALID}
Status of a transaction.
using std::pair< std::shared_ptr< GeniusTransaction >, std::optional< std::vector< uint8_t > > > TransactionPair
using std::vector< TransactionPair > TransactionBatch
using std::pair< TransactionBatch, std::optional< std::shared_ptr< crdt::AtomicTransaction > > > TransactionItem
using std::function< void(const State &previous, const State &current)> StateChangeCallback
using std::function< void(TransactionCompletion)> TransactionCompletionCallback
using TransactionConsensusHandler::WitnessValidationResult WitnessValidationResult
Consensus witness verdicts, evaluated by TransactionConsensusHandler.
using TransactionConsensusHandler::ReplayProtectionResult ReplayProtectionResult
Replay-protection evaluation outcome, produced by TransactionConsensusHandler.

Public Functions

Name
std::shared_ptr< TransactionManager > New(std::shared_ptr< crdt::GlobalDB > processing_db, std::shared_ptr< boost::asio::io_context > ctx, std::shared_ptr< GeniusAccount > account, std::shared_ptr< Blockchain > blockchain, NodeType node_type =NodeType::Light, uint16_t subnet_id =0, std::chrono::milliseconds timestamp_tolerance =std::chrono::milliseconds(300000), std::chrono::milliseconds mutability_window =std::chrono::milliseconds(0), uint64_t initial_burn_basis_points =BURN_BASIS_POINTS_DEFAULT, std::shared_ptr< const sgns::account::ConfirmedBurnValueProvider > confirmed_burn_provider =nullptr)
Factory constructor of the TransactionManager.
std::string GetTransactionPath(uint16_t base, const std::string & tx_hash)
std::string GetTransactionPath(const GeniusTransaction & element)
std::string GetTransactionPath(const std::string & tx_hash)
std::string GetTransactionProofPath(const GeniusTransaction & element)
outcome::result< std::shared_ptr< GeniusTransaction > > FetchTransaction(crdt::GlobalDB & db, std::string_view transaction_key)
Fetches and deserializes a transaction from the CRDT by key.
outcome::result< std::shared_ptr< GeniusTransaction > > DeSerializeTransaction(const base::Buffer & tx_data)
std::string StateToString(State state)
std::string GetBlockChainBase(uint16_t network_id)
Builds the blockchain key prefix "/bc-/" for the given network.
std::string GetBlockChainBase()
Overload using the current network ID.
outcome::result< std::shared_ptr< GeniusTransaction > > DeSerializeTransaction(std::string tx_data)
outcome::result< std::shared_ptr< GeniusTransaction > > DeSerializeEmbeddedTransaction(const EmbeddedTransaction & embedded)
Deserializes from EmbeddedTransaction proto oneof field. Dispatches on the oneof case instead of manual type string lookup.
bool CertificateMatchesTransaction(const ConsensusCertificate & certificate, const GeniusTransaction & transaction)
Verifies that an already validated certificate certifies transaction itself.
~TransactionManager()
void Start()
void RegisterTopicNames()
void StartListeningTopics()
void StartCore()
std::vector< std::vector< uint8_t > > GetOutTransactions() const
std::vector< std::vector< uint8_t > > GetInTransactions() const
size_t CountTransactions(std::optional< TransactionStatus > tx_status =std::nullopt) const
outcome::result< std::string > TransferFunds(uint64_t amount, std::string destination, TokenID token_id)
Creates and enqueues a transfer transaction.
outcome::result< std::string > RegisterChild(std::string main_address, SGTransaction::RegistrationMetadata metadata, uint64_t sequence)
Creates and enqueues a child-wallet registration transaction (caller-supplied sequence).
outcome::result< std::string > RegisterChild(std::string main_address, SGTransaction::RegistrationMetadata metadata)
Creates and enqueues a child-wallet registration transaction with auto-derived sequence.
outcome::result< std::string > RecoverFromChild(std::string child_address, uint64_t amount, TokenID token_id)
Recovers funds from a registered child wallet back to this account (D-60/D-62/CONS-02).
outcome::result< std::string > DetachChild(SGTransaction::RegistrationMetadata metadata, uint64_t sequence, uint64_t supersedes_sequence)
Creates and enqueues a child-initiated Detach transaction (D-35, caller-supplied sequence).
outcome::result< std::string > DetachChild(SGTransaction::RegistrationMetadata metadata)
Creates and enqueues a child-initiated Detach transaction with auto-derived sequence.
outcome::result< std::string > ReplaceMain(std::string new_main_address, SGTransaction::RegistrationMetadata metadata, uint64_t sequence, uint64_t supersedes_sequence)
Creates and enqueues a child-initiated Replace-Main transaction (D-37, caller-supplied sequence).
outcome::result< std::string > ReplaceMain(std::string new_main_address, SGTransaction::RegistrationMetadata metadata)
Creates and enqueues a child-initiated Replace-Main transaction with auto-derived sequence.
outcome::result< std::string > RevokeChild(std::string child_address)
Creates and enqueues a main-initiated Revoke transaction (D-36).
outcome::result< std::string > MintFunds(uint64_t amount, std::string transaction_hash, std::string chainid, TokenID tokenid, std::string destination)
Creates and enqueues a mint transaction.
outcome::result< std::string > MigrationFunds(uint64_t amount, std::string from_version, TokenID tokenid, std::string destination ="")
Creates and enqueues a one-time migration mint transaction.
outcome::result< std::pair< std::string, EscrowDataPair > > HoldEscrow(uint64_t amount, const std::string & job_id, std::string network_scope ="")
Creates and enqueues an escrow-hold transaction.
outcome::result< std::string > PayEscrow(const std::string & escrow_path, const SGProcessing::TaskResult & task_result, std::shared_ptr< crdt::AtomicTransaction > crdt_transaction)
void AsyncPayEscrow(std::string escrow_path, SGProcessing::TaskResult task_result, std::shared_ptr< crdt::AtomicTransaction > crdt_transaction, std::chrono::milliseconds timeout, TransactionCompletionCallback callback)
Submits an escrow payout and observes it without blocking for confirmation.
void AsyncWaitForTransactionOutgoing(std::string tx_id, std::chrono::milliseconds timeout, TransactionCompletionCallback callback)
Asynchronously observes an already-tracked outgoing transaction.
TransactionStatus WaitForTransactionIncoming(const std::string & txId, std::chrono::milliseconds timeout) const
TransactionStatus WaitForTransactionOutgoing(const std::string & txId, std::chrono::milliseconds timeout) const
TransactionStatus WaitForEscrowRelease(const std::string & originalEscrowId, std::chrono::milliseconds timeout) const
Polls until an EscrowReleaseTransaction referencing originalEscrowId reaches a terminal state or timeout expires.
State GetState() const
TransactionStatus GetTransactionStatusByTxId(const std::string & txId) const
TransactionStatus GetOutgoingStatusByTxId(const std::string & txId) const
std::vector< std::shared_ptr< GeniusTransaction > > GetConflictingTransactions(const GeniusTransaction & element) const
Finds every tracked transaction in element's nonce slot except element itself.
outcome::result< std::shared_ptr< GeniusTransaction > > GetConflictingTransaction(const GeniusTransaction & element) const
Finds one tracked transaction in element's nonce slot (first by map iteration) other than element itself.
bool ShouldReplaceTransaction(const GeniusTransaction & existing_tx, const GeniusTransaction & new_tx) const
BestHash tie-break: true when new_tx outranks existing_tx.
void Stop()
Idempotent stop. Sets the stopped flag and wakes the tick loop.
void RegisterStateChangeCallback(StateChangeCallback callback)
void UnregisterStateChangeCallback()
void QueryTransactions()
Queries all transaction keys from the CRDT across monitored networks and processes each one via FetchAndProcessTransaction.
outcome::result< void > FetchAndProcessTransaction(const std::string & tx_key, std::optional< base::Buffer > tx_data =std::nullopt)
Deserializes, parses, and adds a single transaction to the processed map.
outcome::result< std::string > GetTransactionCID(const std::string & tx_hash) const
Looks up the CID associated with a transaction hash in RocksDB, searching across all monitored networks.
outcome::result< void > ChangeTransactionState(const std::shared_ptr< GeniusTransaction > & tx, TransactionStatus new_status)
bool HasConfirmedInputConflict(const GeniusTransaction & candidate_tx) const
bool KeyExistsInDB(const std::string & key) const
outcome::result< ConsensusCertificate > GetTransactionCertificate(const GeniusTransaction & transaction) const
Loads the transaction's validated certificate from the canonical-slot record.
PublicChainInputValidator & GetPublicChainInputValidator()
Obtains the public-chain input validator for RPC endpoint wiring.
const PublicChainInputValidator & GetPublicChainInputValidator() const
Obtains the public-chain input validator for RPC endpoint wiring (const).
outcome::result< std::vector< RegistrationDiscoveryEntry > > GetRegistrationsForMain(const std::string & main_address)
Enumerates the child-wallet registrations recorded under a main wallet.
std::optional< UTXOTransitionCommitment > BuildUTXOTransitionCommitment(const GeniusTransaction & tx) const
Builds the consumed/produced Merkle commitment a nonce subject carries.
WitnessValidationResult ValidateWitnessForConsensus(const ConsensusSubject & subject, const GeniusTransaction & tx) const
Validates the UTXO witness carried by a nonce consensus subject.
ReplayProtectionResult EvaluateTransactionReplayProtection(const GeniusTransaction & tx) const
Evaluates previous-hash/nonce replay protection for a transaction.
bool CheckTransactionAuthorization(const GeniusTransaction & tx) const
Whole-transaction signature / authorization check.
bool CheckParentChildAuthority(const GeniusTransaction & tx) const
Parent-child registration authority check (transfers from certified children, revokes).
bool CheckTransactionReplayProtection(const GeniusTransaction & tx) const
Replay-protection check expressed as a plain boolean.
void SetBridgeExecutedMarkerWriteFailureForTest(bool fail)
void SetFetchAndProcessBeforeStateChangeHookForTest(std::function< void()> hook)

Protected Functions

Name
void EnqueueTransaction(TransactionPair element)
void EnqueueTransaction(TransactionItem element)
void SetTimeFrameToleranceMs(uint64_t timeframe_tolerance)
void SetMutabilityWindowMs(uint64_t mutability_window)

Public Attributes

Name
constexpr std::string_view GNUS_FULL_NODES_TOPIC
constexpr std::string_view GNUS_FULL_NODES_TOPIC_LEGACY
constexpr std::chrono::milliseconds NONCE_REQUEST_TIMEOUT
Unified timeout for all nonce requests.
constexpr uint64_t BURN_BASIS_POINTS_DEFAULT
constexpr uint64_t BASIS_POINTS_TOTAL

Friends

Name
class PayoutOutputsTestAccess

Public Types Documentation

enum Error

Enumerator Value Description
TRUST_POLICY_NOT_READY 1

enum State

Enumerator Value Description
CREATING 0 Creating the object.
INITIALIZING Initializing the object.
SYNCING Syncing the transactions.
READY Ready to process transactions.

State of the Transaction Manager.

enum TransactionStatus

Enumerator Value Description
CREATED Transaction created but not yet sent.
SENDING Transaction is being sent.
CONFIRMED Transaction confirmed.
VERIFYING Transaction being verified.
UNCONFIRMED Local outgoing transaction expired inconclusively.
FAILED Transaction failed.
INVALID Invalid transaction.

Status of a transaction.

using TransactionPair

using sgns::TransactionManager::TransactionPair =  std::pair<std::shared_ptr<GeniusTransaction>, std::optional<std::vector<uint8_t> >>;

using TransactionBatch

using sgns::TransactionManager::TransactionBatch =  std::vector<TransactionPair>;

using TransactionItem

using sgns::TransactionManager::TransactionItem =  std::pair<TransactionBatch, std::optional<std::shared_ptr<crdt::AtomicTransaction> >>;

using StateChangeCallback

using sgns::TransactionManager::StateChangeCallback =  std::function<void( const State &previous, const State &current )>;

using TransactionCompletionCallback

using sgns::TransactionManager::TransactionCompletionCallback =  std::function<void( TransactionCompletion )>;

using WitnessValidationResult

using sgns::TransactionManager::WitnessValidationResult =  TransactionConsensusHandler::WitnessValidationResult;

Consensus witness verdicts, evaluated by TransactionConsensusHandler.

using ReplayProtectionResult

using sgns::TransactionManager::ReplayProtectionResult =  TransactionConsensusHandler::ReplayProtectionResult;

Replay-protection evaluation outcome, produced by TransactionConsensusHandler.

Public Functions Documentation

function New

static std::shared_ptr< TransactionManager > New(
    std::shared_ptr< crdt::GlobalDB > processing_db,
    std::shared_ptr< boost::asio::io_context > ctx,
    std::shared_ptr< GeniusAccount > account,
    std::shared_ptr< Blockchain > blockchain,
    NodeType node_type =NodeType::Light,
    uint16_t subnet_id =0,
    std::chrono::milliseconds timestamp_tolerance =std::chrono::milliseconds(300000),
    std::chrono::milliseconds mutability_window =std::chrono::milliseconds(0),
    uint64_t initial_burn_basis_points =BURN_BASIS_POINTS_DEFAULT,
    std::shared_ptr< const sgns::account::ConfirmedBurnValueProvider > confirmed_burn_provider =nullptr
)

Factory constructor of the TransactionManager.

Parameters:

  • processing_db Database of the CRDT
  • ctx The io context used to run its inner methods
  • account Genius account to be used
  • node_type Deployment role of this node (Full / Light / Archive)
  • timestamp_tolerance Time to analyze a transaction with the same nonce/key
  • mutability_window Window of time where a transaction can be modified

Return: shared_ptr to the fully-wired TransactionManager instance

Note:

  • Default timestamp_tolerance is 5 minutes (300000 ms)
  • Default mutability_window is 10 minutes (600000 ms)
  • timestamp_tolerance must be smaller than mutability_window

function GetTransactionPath

static std::string GetTransactionPath(
    uint16_t base,
    const std::string & tx_hash
)

function GetTransactionPath

static std::string GetTransactionPath(
    const GeniusTransaction & element
)

function GetTransactionPath

static std::string GetTransactionPath(
    const std::string & tx_hash
)

function GetTransactionProofPath

static std::string GetTransactionProofPath(
    const GeniusTransaction & element
)

function FetchTransaction

static outcome::result< std::shared_ptr< GeniusTransaction > > FetchTransaction(
    crdt::GlobalDB & db,
    std::string_view transaction_key
)

Fetches and deserializes a transaction from the CRDT by key.

function DeSerializeTransaction

static outcome::result< std::shared_ptr< GeniusTransaction > > DeSerializeTransaction(
    const base::Buffer & tx_data
)

function StateToString

static inline std::string StateToString(
    State state
)

function GetBlockChainBase

static std::string GetBlockChainBase(
    uint16_t network_id
)

Builds the blockchain key prefix "/bc-/" for the given network.

function GetBlockChainBase

static std::string GetBlockChainBase()

Overload using the current network ID.

function DeSerializeTransaction

static outcome::result< std::shared_ptr< GeniusTransaction > > DeSerializeTransaction(
    std::string tx_data
)

function DeSerializeEmbeddedTransaction

static outcome::result< std::shared_ptr< GeniusTransaction > > DeSerializeEmbeddedTransaction(
    const EmbeddedTransaction & embedded
)

Deserializes from EmbeddedTransaction proto oneof field. Dispatches on the oneof case instead of manual type string lookup.

function CertificateMatchesTransaction

static bool CertificateMatchesTransaction(
    const ConsensusCertificate & certificate,
    const GeniusTransaction & transaction
)

Verifies that an already validated certificate certifies transaction itself.

Callers must locate the record through the transaction-derived canonical slot first. This supplies the second, exact-subject check required for shared slots, so a competing transaction cannot inherit finality.

function ~TransactionManager

~TransactionManager()

function Start

void Start()

function RegisterTopicNames

void RegisterTopicNames()

function StartListeningTopics

void StartListeningTopics()

function StartCore

void StartCore()

function GetOutTransactions

std::vector< std::vector< uint8_t > > GetOutTransactions() const

function GetInTransactions

std::vector< std::vector< uint8_t > > GetInTransactions() const

function CountTransactions

size_t CountTransactions(
    std::optional< TransactionStatus > tx_status =std::nullopt
) const

function TransferFunds

outcome::result< std::string > TransferFunds(
    uint64_t amount,
    std::string destination,
    TokenID token_id
)

Creates and enqueues a transfer transaction.

Parameters:

  • amount Amount to transfer.
  • destination Recipient address.
  • token_id Token being transferred.

Return: Transaction hash on success.

function RegisterChild

outcome::result< std::string > RegisterChild(
    std::string main_address,
    SGTransaction::RegistrationMetadata metadata,
    uint64_t sequence
)

Creates and enqueues a child-wallet registration transaction (caller-supplied sequence).

function RegisterChild

outcome::result< std::string > RegisterChild(
    std::string main_address,
    SGTransaction::RegistrationMetadata metadata
)

Creates and enqueues a child-wallet registration transaction with auto-derived sequence.

function RecoverFromChild

outcome::result< std::string > RecoverFromChild(
    std::string child_address,
    uint64_t amount,
    TokenID token_id
)

Recovers funds from a registered child wallet back to this account (D-60/D-62/CONS-02).

function DetachChild

outcome::result< std::string > DetachChild(
    SGTransaction::RegistrationMetadata metadata,
    uint64_t sequence,
    uint64_t supersedes_sequence
)

Creates and enqueues a child-initiated Detach transaction (D-35, caller-supplied sequence).

function DetachChild

outcome::result< std::string > DetachChild(
    SGTransaction::RegistrationMetadata metadata
)

Creates and enqueues a child-initiated Detach transaction with auto-derived sequence.

function ReplaceMain

outcome::result< std::string > ReplaceMain(
    std::string new_main_address,
    SGTransaction::RegistrationMetadata metadata,
    uint64_t sequence,
    uint64_t supersedes_sequence
)

Creates and enqueues a child-initiated Replace-Main transaction (D-37, caller-supplied sequence).

function ReplaceMain

outcome::result< std::string > ReplaceMain(
    std::string new_main_address,
    SGTransaction::RegistrationMetadata metadata
)

Creates and enqueues a child-initiated Replace-Main transaction with auto-derived sequence.

function RevokeChild

outcome::result< std::string > RevokeChild(
    std::string child_address
)

Creates and enqueues a main-initiated Revoke transaction (D-36).

function MintFunds

outcome::result< std::string > MintFunds(
    uint64_t amount,
    std::string transaction_hash,
    std::string chainid,
    TokenID tokenid,
    std::string destination
)

Creates and enqueues a mint transaction.

Parameters:

  • amount Amount to mint.
  • transaction_hash Source-chain transaction hash used as the previous hash in the DAG.
  • chainid Originating chain identifier.
  • tokenid Token to mint.
  • destination Recipient address; defaults to the local account address when empty.

Return: Transaction hash on success.

function MigrationFunds

outcome::result< std::string > MigrationFunds(
    uint64_t amount,
    std::string from_version,
    TokenID tokenid,
    std::string destination =""
)

Creates and enqueues a one-time migration mint transaction.

Parameters:

  • amount Amount to migrate.
  • from_version Legacy version namespace for the migration source key.
  • tokenid Token to mint.
  • destination Recipient address; defaults to the local account address when empty.

Return: Transaction hash on success.

function HoldEscrow

outcome::result< std::pair< std::string, EscrowDataPair > > HoldEscrow(
    uint64_t amount,
    const std::string & job_id,
    std::string network_scope =""
)

Creates and enqueues an escrow-hold transaction.

Parameters:

  • amount Total amount to lock in escrow.
  • job_id Job identifier whose blake2b-256 hash becomes the escrow destination address.
  • network_scope Private-network identity scoping the escrow chain id (empty = public scope; the chain id stays at the genius default).

Return: Pair of (transaction hash, (escrow address, serialized transaction)) on success.

Note: The escrow hold carries no payout metadata. The developer address and cut are reported per subtask by the processing peer that ran the work, since peers of a single job may be running apps from different developers.

Hashes job_id with blake2b-256 to derive the escrow destination address, selects UTXOs, reserves them, and signs the transaction.

function PayEscrow

outcome::result< std::string > PayEscrow(
    const std::string & escrow_path,
    const SGProcessing::TaskResult & task_result,
    std::shared_ptr< crdt::AtomicTransaction > crdt_transaction
)

function AsyncPayEscrow

void AsyncPayEscrow(
    std::string escrow_path,
    SGProcessing::TaskResult task_result,
    std::shared_ptr< crdt::AtomicTransaction > crdt_transaction,
    std::chrono::milliseconds timeout,
    TransactionCompletionCallback callback
)

Submits an escrow payout and observes it without blocking for confirmation.

Transaction construction is performed during initiation; confirmation is event-driven on the manager io_context. Pending observations are cancelled by Stop. The callback must not own the GeniusNode; capture immutable context or a weak observer instead.

function AsyncWaitForTransactionOutgoing

void AsyncWaitForTransactionOutgoing(
    std::string tx_id,
    std::chrono::milliseconds timeout,
    TransactionCompletionCallback callback
)

Asynchronously observes an already-tracked outgoing transaction.

function WaitForTransactionIncoming

TransactionStatus WaitForTransactionIncoming(
    const std::string & txId,
    std::chrono::milliseconds timeout
) const

function WaitForTransactionOutgoing

TransactionStatus WaitForTransactionOutgoing(
    const std::string & txId,
    std::chrono::milliseconds timeout
) const

function WaitForEscrowRelease

TransactionStatus WaitForEscrowRelease(
    const std::string & originalEscrowId,
    std::chrono::milliseconds timeout
) const

Polls until an EscrowReleaseTransaction referencing originalEscrowId reaches a terminal state or timeout expires.

Return: TransactionStatus of the release tx, or INVALID if not found within timeout.

function GetState

inline State GetState() const

function GetTransactionStatusByTxId

TransactionStatus GetTransactionStatusByTxId(
    const std::string & txId
) const

function GetOutgoingStatusByTxId

TransactionStatus GetOutgoingStatusByTxId(
    const std::string & txId
) const

function GetConflictingTransactions

std::vector< std::shared_ptr< GeniusTransaction > > GetConflictingTransactions(
    const GeniusTransaction & element
) const

Finds every tracked transaction in element's nonce slot except element itself.

function GetConflictingTransaction

outcome::result< std::shared_ptr< GeniusTransaction > > GetConflictingTransaction(
    const GeniusTransaction & element
) const

Finds one tracked transaction in element's nonce slot (first by map iteration) other than element itself.

Return: The conflicting transaction, or an error when none is tracked.

function ShouldReplaceTransaction

bool ShouldReplaceTransaction(
    const GeniusTransaction & existing_tx,
    const GeniusTransaction & new_tx
) const

BestHash tie-break: true when new_tx outranks existing_tx.

function Stop

void Stop()

Idempotent stop. Sets the stopped flag and wakes the tick loop.

function RegisterStateChangeCallback

void RegisterStateChangeCallback(
    StateChangeCallback callback
)

function UnregisterStateChangeCallback

void UnregisterStateChangeCallback()

function QueryTransactions

void QueryTransactions()

Queries all transaction keys from the CRDT across monitored networks and processes each one via FetchAndProcessTransaction.

function FetchAndProcessTransaction

outcome::result< void > FetchAndProcessTransaction(
    const std::string & tx_key,
    std::optional< base::Buffer > tx_data =std::nullopt
)

Deserializes, parses, and adds a single transaction to the processed map.

Parameters:

  • tx_key Full CRDT key of the transaction.
  • tx_data Optional pre-fetched serialized data (avoids a CRDT read).

Skips transactions that are already tracked. When tx_data is provided it is deserialized directly; otherwise the transaction is fetched from the CRDT by tx_key. On success the peer nonce is updated and the transaction is recorded as CONFIRMED.

function GetTransactionCID

outcome::result< std::string > GetTransactionCID(
    const std::string & tx_hash
) const

Looks up the CID associated with a transaction hash in RocksDB, searching across all monitored networks.

function ChangeTransactionState

outcome::result< void > ChangeTransactionState(
    const std::shared_ptr< GeniusTransaction > & tx,
    TransactionStatus new_status
)

function HasConfirmedInputConflict

bool HasConfirmedInputConflict(
    const GeniusTransaction & candidate_tx
) const

function KeyExistsInDB

bool KeyExistsInDB(
    const std::string & key
) const

function GetTransactionCertificate

outcome::result< ConsensusCertificate > GetTransactionCertificate(
    const GeniusTransaction & transaction
) const

Loads the transaction's validated certificate from the canonical-slot record.

Callers must still pass the result through CertificateMatchesTransaction.

function GetPublicChainInputValidator

inline PublicChainInputValidator & GetPublicChainInputValidator()

Obtains the public-chain input validator for RPC endpoint wiring.

Return: Mutable reference to the PublicChainInputValidator.

function GetPublicChainInputValidator

inline const PublicChainInputValidator & GetPublicChainInputValidator() const

Obtains the public-chain input validator for RPC endpoint wiring (const).

Return: Const reference to the PublicChainInputValidator.

function GetRegistrationsForMain

outcome::result< std::vector< RegistrationDiscoveryEntry > > GetRegistrationsForMain(
    const std::string & main_address
)

Enumerates the child-wallet registrations recorded under a main wallet.

Parameters:

  • main_address Main wallet public address (128-hex).

Return: Vector of RegistrationDiscoveryEntry on success.

Scans the per-network reg subtrees of the monitored networks and collects the registration transactions whose main address matches main_address.

function BuildUTXOTransitionCommitment

std::optional< UTXOTransitionCommitment > BuildUTXOTransitionCommitment(
    const GeniusTransaction & tx
) const

Builds the consumed/produced Merkle commitment a nonce subject carries.

function ValidateWitnessForConsensus

WitnessValidationResult ValidateWitnessForConsensus(
    const ConsensusSubject & subject,
    const GeniusTransaction & tx
) const

Validates the UTXO witness carried by a nonce consensus subject.

function EvaluateTransactionReplayProtection

ReplayProtectionResult EvaluateTransactionReplayProtection(
    const GeniusTransaction & tx
) const

Evaluates previous-hash/nonce replay protection for a transaction.

function CheckTransactionAuthorization

bool CheckTransactionAuthorization(
    const GeniusTransaction & tx
) const

Whole-transaction signature / authorization check.

function CheckParentChildAuthority

bool CheckParentChildAuthority(
    const GeniusTransaction & tx
) const

Parent-child registration authority check (transfers from certified children, revokes).

function CheckTransactionReplayProtection

bool CheckTransactionReplayProtection(
    const GeniusTransaction & tx
) const

Replay-protection check expressed as a plain boolean.

function SetBridgeExecutedMarkerWriteFailureForTest

void SetBridgeExecutedMarkerWriteFailureForTest(
    bool fail
)

function SetFetchAndProcessBeforeStateChangeHookForTest

void SetFetchAndProcessBeforeStateChangeHookForTest(
    std::function< void()> hook
)

Protected Functions Documentation

function EnqueueTransaction

void EnqueueTransaction(
    TransactionPair element
)

function EnqueueTransaction

void EnqueueTransaction(
    TransactionItem element
)

function SetTimeFrameToleranceMs

void SetTimeFrameToleranceMs(
    uint64_t timeframe_tolerance
)

function SetMutabilityWindowMs

void SetMutabilityWindowMs(
    uint64_t mutability_window
)

Public Attributes Documentation

variable GNUS_FULL_NODES_TOPIC

static constexpr std::string_view GNUS_FULL_NODES_TOPIC = "SuperGNUSNode.TestNet.FullNode";

variable GNUS_FULL_NODES_TOPIC_LEGACY

static constexpr std::string_view GNUS_FULL_NODES_TOPIC_LEGACY = "SuperGNUSNode.TestNet.FullNode.963";

variable NONCE_REQUEST_TIMEOUT

static constexpr std::chrono::milliseconds NONCE_REQUEST_TIMEOUT = std::chrono::seconds(
            5 );

Unified timeout for all nonce requests.

variable BURN_BASIS_POINTS_DEFAULT

static constexpr uint64_t BURN_BASIS_POINTS_DEFAULT = 100;

Fraction of an escrow payout burned to the zero address during PayEscrow, in basis points. Pre-quorum/genesis-absent fallback only – the live value is cached in burn_basis_points_ and refreshed via BurnConfig's quorum-signed CRDT value (BURN-02, BURN-03).

variable BASIS_POINTS_TOTAL

static constexpr uint64_t BASIS_POINTS_TOTAL = 10000;

Friends

friend PayoutOutputsTestAccess

friend class PayoutOutputsTestAccess(
    PayoutOutputsTestAccess 
);

Updated on 2026-10-07 at 18:58:58 +0000