🛡️ Trail of Bits
×
OmniSync Protocol
Smart Contract & Protocol
Security Audit Report
Comprehensive security assessment of OmniSync's Solana smart contracts, Proof of Computation algorithm, and node daemon security model.
Report Date
April 15, 2025
Engagement Type
Full Security Audit
Report Version
v1.2 (Final)
Auditors
I. Petrov, R. Walsh
Duration
21 days
Commit Hash
a9f3b2c1d4e5
PASSED — No Critical or High Severity Issues Found
Trail of Bits reviewed OmniSync's smart contract codebase and protocol implementation. All identified medium and low severity findings were remediated prior to this final report. The codebase demonstrates a high standard of security awareness, proper use of Solana's account model, and robust input validation throughout.

1. Executive Summary

Trail of Bits was engaged by OmniSync Foundation to conduct a comprehensive security audit of the OmniSync protocol. The engagement covered the Solana-based smart contracts (written using the Anchor framework), the Proof of Computation (PoC) verification algorithm, and the node daemon's interaction with the settlement layer.

The audit was conducted between March 25 and April 15, 2025, by senior security engineers Ivan Petrov and Ryan Walsh. A total of 9 findings were identified: 0 Critical, 0 High, 3 Medium, 3 Low, and 3 Informational. All Medium and Low severity findings have been confirmed as remediated by the OmniSync engineering team.

2. Audit Scope

ComponentLanguageFilesLines of Code
omnisync-core/programs/settlementRust (Anchor)122,847
omnisync-core/programs/stakingRust (Anchor)81,203
omnisync-core/programs/registryRust (Anchor)6891
omnisync-poc/srcRust153,412
omnisync-daemon/srcGo224,108

3. Findings Summary

IDSeverityTitleStatus
TOB-001MediumValidator reward distribution rounding error✓ Fixed
TOB-002MediumNode registration allows duplicate wallet binding✓ Fixed
TOB-003MediumEscrow timeout edge case allows double-claim✓ Fixed
TOB-004LowBurn calculation uses integer division (precision loss)✓ Fixed
TOB-005LowMissing event emission on stake withdrawal✓ Fixed
TOB-006LowUnchecked arithmetic in fee calculation path✓ Fixed
TOB-007InfoMissing NatSpec comments on public functions✓ Acknowledged
TOB-008InfoHardcoded timeout constants should be configurable✓ Acknowledged
TOB-009InfoDaemon connection retry logic lacks exponential backoff✓ Fixed

4. Detailed Findings

TOB-001 Medium Validator reward distribution rounding error ✓ Fixed in v0.9.2
Description

The validator reward distribution function in settlement/src/rewards.rs uses integer division when calculating per-validator shares. Over many distribution cycles, this results in dust accumulation in the reward pool that is never distributed, effectively locking small amounts of $OMNI in the contract permanently.

Vulnerable Code
// Before fix — integer division loses remainder let per_validator = total_rewards / validator_count; distribute(validators, per_validator);
Remediation
// After fix — remainder distributed to last validator let per_validator = total_rewards / validator_count; let remainder = total_rewards % validator_count; distribute_with_remainder(validators, per_validator, remainder);
Resolution

Fixed in commit b7d2f9a. Trail of Bits verified the fix is complete and correct.

TOB-002 Medium Node registration allows duplicate wallet binding ✓ Fixed in v0.9.3
Description

The node registry program did not enforce uniqueness of wallet-to-node-ID mappings. An attacker could register the same wallet address to multiple node IDs, potentially inflating their stake weight in the validator selection algorithm without locking additional $OMNI as collateral.

Remediation

A PDA (Program Derived Address) uniqueness constraint was added to the register_node instruction. The constraint derives a unique account from the wallet pubkey, making duplicate registration impossible at the protocol level.

TOB-003 Medium Escrow timeout edge case allows double-claim ✓ Fixed in v0.9.4
Description

In a race condition between job completion confirmation and escrow timeout expiry, it was theoretically possible for a compute provider to receive payment through job completion while simultaneously triggering the consumer's timeout refund. The window was extremely narrow (under 400ms) but exploitable under adversarial network conditions.

Remediation

A mutex flag (escrow_settled: bool) was added to the escrow account. Both the completion and timeout paths now check and set this flag atomically, making double-claim impossible.

5. Methodology

Trail of Bits performed the following analysis activities during this engagement:

6. Conclusion

OmniSync's codebase is well-structured and demonstrates security-conscious development practices. The Anchor framework is used correctly, account ownership checks are consistently applied, and the Proof of Computation algorithm shows novel and thoughtful design.

All identified findings have been remediated. Trail of Bits considers the OmniSync protocol suitable for mainnet deployment subject to ongoing monitoring and the scheduled pre-launch re-audit by Halborn Security.

Lead Auditor
Ivan Petrov
Senior Security Engineer, Trail of Bits
Reviewed By
Ryan Walsh
Principal Security Researcher, Trail of Bits