Module constants

Source
Expand description

This module contains all the constant values used in the system

Re-exports§

pub use transactions::*;

Modules§

transactions
Transaction-related constants

Structs§

ID_REGEX

Constants§

ARBITRUM_BASED_TAG
ARBITRUM_GAS_LIMIT
ARBITRUM_TIME_TO_RESUBMIT
Time to resubmit for Arbitrum networks
AUTHORIZATION_HEADER_NAME
AUTHORIZATION_HEADER_VALUE_PREFIX
COMPLEX_GAS_LIMIT
CONCURRENT_TASKS_HEADROOM_MULTIPLIER
Headroom multiplier for calculating concurrent tasks per worker. Applied to base task calculation to provide buffer for:
DEFAULT_CLIENT_DISCONNECT_TIMEOUT_SECONDS
Default client disconnect timeout in seconds. This is the time the server waits for cleanup after a client disconnects.
DEFAULT_CONCURRENCY
DEFAULT_CONCURRENCY_STATUS_CHECKER
DEFAULT_CONCURRENCY_STATUS_CHECKER_EVM
DEFAULT_CONVERSION_SLIPPAGE_PERCENTAGE
DEFAULT_EVM_EIP1559_ENABLED
Default EIP-1559 pricing enabled
DEFAULT_EVM_GAS_LIMIT_ESTIMATION
Default gas limit estimation enabled
DEFAULT_EVM_GAS_PRICE_CAP
Default gas price cap: 100 gwei in wei
DEFAULT_EVM_MIN_BALANCE
DEFAULT_GAS_LIMIT
DEFAULT_HTTP_CLIENT_CONNECT_TIMEOUT_SECONDS
Default HTTP client connection timeout in seconds. Maximum time to wait for establishing a connection.
DEFAULT_HTTP_CLIENT_HTTP2_KEEP_ALIVE_INTERVAL_SECONDS
Default HTTP/2 keep-alive interval in seconds.
DEFAULT_HTTP_CLIENT_HTTP2_KEEP_ALIVE_TIMEOUT_SECONDS
Default HTTP/2 keep-alive timeout in seconds.
DEFAULT_HTTP_CLIENT_POOL_IDLE_TIMEOUT_SECONDS
Default HTTP client pool idle timeout in seconds. Time after which idle connections are closed.
DEFAULT_HTTP_CLIENT_POOL_MAX_IDLE_PER_HOST
Default maximum number of idle connections per host in the connection pool.
DEFAULT_HTTP_CLIENT_TCP_KEEPALIVE_SECONDS
Default TCP keepalive interval in seconds.
DEFAULT_HTTP_CLIENT_TIMEOUT_SECONDS
Default HTTP client timeout in seconds for CDP service. Overall timeout for HTTP requests in CDP service.
DEFAULT_LOG_DIR
Default log directory for file logging
DEFAULT_LOG_FORMAT
Default log format when not specified
DEFAULT_LOG_LEVEL
Default log level when not specified
DEFAULT_LOG_MODE
Default log mode when not specified
DEFAULT_MAX_LOG_FILE_SIZE
Default maximum log file size in bytes (1GB)
DEFAULT_PLUGIN_TIMEOUT_SECONDS
Default plugin execution timeout in seconds. Override in config.json per-plugin: "timeout": 60
DEFAULT_POOL_CONCURRENT_TASKS_PER_WORKER
Concurrent tasks per worker thread in Node.js pool. Internal constant, not user-configurable.
DEFAULT_POOL_CONNECT_RETRIES
Retry attempts when connecting to pool server. Env: PLUGIN_POOL_CONNECT_RETRIES Increase for high concurrency scenarios.
DEFAULT_POOL_EXECUTION_TIMEOUT_MS
Plugin execution timeout within the pool (milliseconds). Internal constant - use per-plugin timeout in config.json instead.
DEFAULT_POOL_HEALTH_CHECK_INTERVAL_SECS
Minimum seconds between health checks. Env: PLUGIN_POOL_HEALTH_CHECK_INTERVAL_SECS Prevents health check storms under high load.
DEFAULT_POOL_IDLE_TIMEOUT_MS
Worker idle timeout in milliseconds. Internal constant, not user-configurable.
DEFAULT_POOL_MAX_CONNECTIONS
Maximum concurrent connections from Rust to the Node.js pool server. Env: PLUGIN_POOL_MAX_CONNECTIONS Increase for high concurrency (3000+ VUs).
DEFAULT_POOL_MAX_QUEUE_SIZE
Maximum queued requests before rejection. Env: PLUGIN_POOL_MAX_QUEUE_SIZE Increase for high concurrency (3000+ VUs).
DEFAULT_POOL_MAX_THREADS_FLOOR
Maximum worker threads floor (minimum threads even on small machines). Internal constant, not user-configurable.
DEFAULT_POOL_MIN_THREADS
Minimum worker threads in Node.js pool (floor). Internal constant, not user-configurable.
DEFAULT_POOL_QUEUE_SEND_TIMEOUT_MS
Wait time (ms) when queue is full before rejecting. Env: PLUGIN_POOL_QUEUE_SEND_TIMEOUT_MS Increase for bursty traffic patterns.
DEFAULT_POOL_REQUEST_TIMEOUT_SECS
Timeout for individual pool requests (seconds). Env: PLUGIN_POOL_REQUEST_TIMEOUT_SECS
DEFAULT_POOL_SOCKET_BACKLOG
Socket connection backlog for the pool server. Env: PLUGIN_POOL_SOCKET_BACKLOG (internal, rarely needs tuning)
DEFAULT_PROVIDER_FAILURE_EXPIRATION_SECS
Duration in seconds after which failures are considered stale and reset. This allows providers to naturally recover over time even without explicit success calls.
DEFAULT_PROVIDER_FAILURE_THRESHOLD
DEFAULT_PROVIDER_PAUSE_DURATION_SECS
DEFAULT_RPC_WEIGHT
DEFAULT_SOCKET_IDLE_TIMEOUT_SECS
Idle timeout for plugin connections (seconds). Env: PLUGIN_SOCKET_IDLE_TIMEOUT_SECS Connections idle longer than this are closed.
DEFAULT_SOCKET_MAX_CONCURRENT_CONNECTIONS
Maximum concurrent plugin connections to the relayer. Env: PLUGIN_SOCKET_MAX_CONCURRENT_CONNECTIONS Should be >= PLUGIN_POOL_MAX_CONNECTIONS.
DEFAULT_SOCKET_READ_TIMEOUT_SECS
Read timeout per line from plugins (seconds). Env: PLUGIN_SOCKET_READ_TIMEOUT_SECS Time to wait for a complete message from a plugin.
DEFAULT_SOLANA_MAX_TX_DATA_SIZE
Default maximum transaction data size for Solana
DEFAULT_SOLANA_MIN_BALANCE
DEFAULT_STELLAR_CONCURRENT_TRANSACTIONS
Default concurrent transactions enabled setting for Stellar
DEFAULT_STELLAR_MIN_BALANCE
DEFAULT_TRACE_TIMEOUT_MS
Trace collection timeout (milliseconds). Env: PLUGIN_TRACE_TIMEOUT_MS Short timeout since traces arrive immediately after plugin execution.
DEFAULT_TRANSACTION_SPEED
DEFAULT_TX_VALID_TIMESPAN
DOCKER_LOG_DIR
Default log directory when running in Docker
ERC20_TRANSFER_GAS_LIMIT
ERC721_TRANSFER_GAS_LIMIT
EVM_MAX_CONSECUTIVE_STATUS_FAILURES
Maximum consecutive status check failures before forcing finalization for EVM networks.
EVM_MAX_TOTAL_STATUS_FAILURES
Maximum total status check failures before forcing finalization for EVM networks.
EVM_MIN_AGE_FOR_HASH_RECOVERY_MINUTES
Minimum age before attempting hash recovery for transactions (in minutes)
EVM_MIN_AGE_FOR_RESUBMIT_SECONDS
Minimum age of transaction before allowing resubmission and timeout checks (in seconds) Transactions younger than this will still get status updates from blockchain, but resubmission logic and timeout checks are deferred to prevent premature actions.
EVM_MIN_HASHES_FOR_RECOVERY
Minimum number of hashes required before attempting hash recovery
EVM_PENDING_RECOVERY_TRIGGER_SECONDS
Trigger recovery for stuck Pending transactions (in seconds)
EVM_PREPARE_TIMEOUT_MINUTES
Timeout for preparation phase: Pending → Sent (in minutes) Increased from 1 to 2 minutes to provide wider recovery window
EVM_RESEND_TIMEOUT_SECONDS
Timeout for resend phase: Sent → Submitted (in seconds)
EVM_SMALLEST_UNIT_NAME
EVM_STATUS_CHECK_INITIAL_DELAY_SECONDS
Initial delay before first status check (in seconds)
EVM_SUBMIT_TIMEOUT_MINUTES
Timeout for submission phase: Sent → Submitted (in minutes)
GAS_LIMIT_BUFFER_MULTIPLIER
Gas limit buffer multiplier for automatic gas limit estimation, 10% increase
GAS_PRICE_CACHE_REFRESH_TIMEOUT_SECS
Gas price cache refresh timeout in seconds (5 minutes) Used to cleanup stuck refresh operations that may have failed to complete
GAS_TX_CREATE_CONTRACT
GAS_TX_DATA_NONZERO
GAS_TX_DATA_ZERO
HISTORICAL_BLOCKS
Number of historical blocks to fetch for fee history analysis
JUPITER_BASE_API_URL
LACKS_MEMPOOL_TAGS
LOG_FILE_NAME
Log file name
MAXIMUM_NOOP_RETRY_ATTEMPTS
MAXIMUM_SOLANA_TX_ATTEMPTS
Maximum number of transaction resubmission attempts before marking as Failed Each attempt creates a new signature (when blockhash expires and tx is resubmitted) Similar to EVM’s MAXIMUM_TX_ATTEMPTS but tailored for Solana’s resubmission behavior
MAXIMUM_TX_ATTEMPTS
MAX_CONCURRENT_TASKS_PER_WORKER
Maximum concurrent tasks per worker thread (hard cap). This cap prevents excessive memory usage and GC pressure per worker. Validated through load testing as a stable upper bound. Internal constant, not user-configurable.
MAX_SOLANA_TX_DATA_SIZE
MINIMUM_SECRET_VALUE_LENGTH
MIN_BUMP_FACTOR
Minimum gas price bump factor for transaction replacements (10% increase)
NATIVE_SOL
NO_MEMPOOL_TAG
Network tag constants for EVM networks
OPTIMISM_BASED_TAG
OPTIMISM_GAS_PRICE_ORACLE_ADDRESS
OPTIMISM_TAG
@deprecated Use OPTIMISM_BASED_TAG instead. Will be removed in a future version.
POLYGON_ZKEVM_TAG
PUBLIC_ENDPOINTS
REQUEST_MAX_ACCOUNTS_PER_INSTRUCTION
Maximum number of accounts allowed per instruction in a request
REQUEST_MAX_INSTRUCTIONS
Maximum number of instructions allowed in a transaction request
REQUEST_MAX_INSTRUCTION_DATA_SIZE
Maximum instruction data size in bytes allowed in a request
REQUEST_MAX_TOTAL_ACCOUNTS
Maximum total unique accounts allowed in a transaction request
RETRY_JITTER_PERCENT
The percentage (0.0 to 1.0) for jitter in retry delays
ROLLUP_TAG
SOLANA_DECIMALS
SOLANA_DEFAULT_TX_VALID_TIMESPAN
Default transaction valid timespan for Solana when no explicit valid_until is provided (in milliseconds) Set to 30 minutes to balance between:
SOLANA_MAX_CONSECUTIVE_STATUS_FAILURES
Maximum consecutive status check failures before forcing finalization for Solana.
SOLANA_MAX_TOTAL_STATUS_FAILURES
Maximum total status check failures before forcing finalization for Solana.
SOLANA_MIN_AGE_FOR_RESUBMIT_CHECK_SECONDS
Minimum age before checking for resubmit/expiration (in seconds) If transaction is younger than this, we don’t check blockhash expiration yet
SOLANA_PENDING_RECOVERY_TRIGGER_SECONDS
Minimum age before triggering Pending status recovery (in seconds) Only schedule a recovery job if Pending transaction exceeds this age
SOLANA_PENDING_TIMEOUT_MINUTES
Timeout for Pending status: transaction preparation phase (in minutes) If a transaction stays in Pending for longer than this, mark as Failed
SOLANA_SENT_TIMEOUT_MINUTES
Timeout for Sent status: waiting for submission (in minutes) If a transaction stays in Sent for longer than this, mark as Failed
SOLANA_SMALLEST_UNIT_NAME
SOLANA_STATUS_CHECK_INITIAL_DELAY_SECONDS
Initial delay before first status check (in seconds)
STELLAR_DEFAULT_MAX_FEE
Default maximum fee for fee-bump transactions (0.1 XLM = 1,000,000 stroops)
STELLAR_DEFAULT_TRANSACTION_FEE
STELLAR_FEE_FORWARDER_MAINNET
FeeForwarder contract address on Stellar mainnet Set to empty string until mainnet deployment is available
STELLAR_HORIZON_MAINNET_URL
Horizon API base URL for Stellar mainnet
STELLAR_HORIZON_TESTNET_URL
Horizon API base URL for Stellar testnet
STELLAR_LEDGER_TIME_SECONDS
Approximate Stellar ledger close time in seconds (used for ledger-based expiration)
STELLAR_MAX_CONSECUTIVE_STATUS_FAILURES
Maximum consecutive status check failures before forcing finalization for Stellar.
STELLAR_MAX_OPERATIONS
Maximum number of operations allowed in a Stellar transaction
STELLAR_MAX_STUCK_TRANSACTION_LIFETIME_MINUTES
Maximum lifetime for stuck transactions (Sent, Pending, Submitted) before marking as Failed (15 minutes) Safety net for transactions without time bounds - prevents infinite retries.
STELLAR_MAX_TOTAL_STATUS_FAILURES
Maximum total status check failures before forcing finalization for Stellar.
STELLAR_PENDING_RECOVERY_TRIGGER_SECONDS
Minimum age before triggering Pending status recovery (in seconds) Only schedule a recovery job if Pending transaction without hash exceeds this age This prevents scheduling a job on every status check
STELLAR_RESEND_TIMEOUT_SECONDS
Minimum time before re-queuing submit job for stuck Sent transactions (30 seconds) Gives the original submit job time to complete before attempting recovery.
STELLAR_RESUBMIT_BASE_INTERVAL_SECONDS
Base interval (seconds) for resubmitting a Submitted transaction. Stellar Core retries internally for ~3 ledgers (~15s). We start resubmitting at 10s to ensure the transaction is back in the mempool before Core’s window closes.
STELLAR_RESUBMIT_MAX_INTERVAL_SECONDS
Maximum resubmit interval (seconds) to cap exponential backoff. Prevents excessively long gaps between resubmissions.
STELLAR_SMALLEST_UNIT_NAME
STELLAR_SOROSWAP_MAINNET_FACTORY
Soroswap factory contract address on Stellar mainnet
STELLAR_SOROSWAP_MAINNET_NATIVE_WRAPPER
Native XLM wrapper token contract address on Stellar mainnet This is the Soroban token contract that wraps native XLM for use in Soroswap
STELLAR_SOROSWAP_MAINNET_ROUTER
Soroswap router contract address on Stellar mainnet
STELLAR_SPONSORED_TRANSACTION_VALIDITY_MINUTES
Default transaction validity duration (in minutes) for sponsored transactions Provides reasonable time for users to review and submit while ensuring transaction doesn’t expire too quickly
STELLAR_SPONSORED_TRANSACTION_VALIDITY_SECONDS
Sponsored transaction validity in seconds (2 minutes). Used for gas abstraction authorization validity so it aligns with the transaction submission window.
STELLAR_STATUS_CHECK_INITIAL_DELAY_SECONDS
Initial delay before first status check (in seconds) Set to 2s for faster detection of transaction state changes
SYSTEM_CLEANUP_CRON_SCHEDULE
Cron expression for system cleanup: runs every 15 minutes
SYSTEM_CLEANUP_LOCK_TTL_SECS
TTL for the system cleanup distributed lock (14 minutes).
SYSTEM_PROGRAM_ID
TOKEN_SWAP_CRON_LOCK_TTL_SECS
Fallback TTL for token-swap cron distributed locks (4 minutes).
TRANSACTION_CLEANUP_CRON_SCHEDULE
Cron expression for transaction cleanup: runs every 10 minutes
TRANSACTION_CLEANUP_LOCK_TTL_SECS
TTL for the transaction cleanup distributed lock (9 minutes).
WORKER_DEFAULT_MAXIMUM_RETRIES
WORKER_NOTIFICATION_SENDER_RETRIES
WORKER_RELAYER_HEALTH_CHECK_RETRIES
WORKER_SYSTEM_CLEANUP_RETRIES
WORKER_TOKEN_SWAP_REQUEST_RETRIES
WORKER_TRANSACTION_CANCEL_RETRIES
WORKER_TRANSACTION_CLEANUP_RETRIES
WORKER_TRANSACTION_REQUEST_RETRIES
WORKER_TRANSACTION_RESEND_RETRIES
WORKER_TRANSACTION_RESUBMIT_RETRIES
WORKER_TRANSACTION_STATUS_CHECKER_RETRIES
WORKER_TRANSACTION_SUBMIT_RETRIES
WRAPPED_SOL_MINT
ZERO_ADDRESS

Functions§

get_evm_min_age_for_hash_recovery
Get minimum age for hash recovery duration
get_evm_pending_recovery_trigger_timeout
Get pending recovery trigger duration
get_evm_prepare_timeout
Get preparation timeout duration
get_evm_resend_timeout
Get resend timeout duration
get_evm_status_check_initial_delay
Get status check initial delay duration
get_evm_submit_timeout
Get submission timeout duration
get_max_consecutive_status_failures
Returns the maximum consecutive status check failures allowed for a given network type.
get_max_total_status_failures
Returns the maximum total status check failures allowed for a given network type.
get_solana_status_check_initial_delay
Get status check initial delay duration
get_stellar_max_stuck_transaction_lifetime
Get max lifetime duration for stuck transactions (Sent, Pending, Submitted)
get_stellar_resend_timeout
Get resend timeout duration for stuck Sent transactions
get_stellar_resubmit_base_interval
Get base resubmit interval for Submitted transactions
get_stellar_resubmit_max_interval
Get maximum resubmit interval (backoff cap) for Submitted transactions
get_stellar_sponsored_transaction_validity_duration
Get sponsored transaction validity duration
get_stellar_status_check_initial_delay
Get status check initial delay duration