Skip to content

feat: enable mainnet TRUF + USDC bridges across order book#1361

Merged
MicBun merged 1 commit into
mainfrom
ultimeMigration
Apr 23, 2026
Merged

feat: enable mainnet TRUF + USDC bridges across order book#1361
MicBun merged 1 commit into
mainfrom
ultimeMigration

Conversation

@MicBun
Copy link
Copy Markdown
Contributor

@MicBun MicBun commented Apr 23, 2026

resolves: https://github.com/truflation/website/issues/3464
resolves: https://github.com/truflation/website/issues/3492

Already migrated

Summary by CodeRabbit

  • New Features

    • Added stream creation with metadata and sequential ID generation
    • Added primitive event record insertion with flexible batch sizing
    • Added taxonomy composition system for hierarchical stream organization
    • Added attestation request capability for action validation
    • Added order book functionality: market creation, buy/split limit orders, bid adjustments
    • Added TRUF and USDC token operations: balance queries, peer-to-peer transfers, collateral management
    • Added market collateral validation and vault balance diagnostics
    • Added transaction history and withdrawal proof retrieval for token operations
  • Improvements

    • Removed hard batch size limit on record insertion operations

@MicBun MicBun requested a review from pr-time-tracker April 23, 2026 16:06
@MicBun MicBun self-assigned this Apr 23, 2026
@MicBun MicBun added the type: feat New feature or request label Apr 23, 2026
@holdex
Copy link
Copy Markdown

holdex Bot commented Apr 23, 2026

Time Submission Status

Member Status Time Action Last Update
MicBun ✅ Submitted 4h Update time Apr 23, 2026, 4:07 PM

You can submit time with the command. Example:

@holdex pr submit-time 15m

See available commands to help comply with our Guidelines.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR introduces production-ready SQL migrations and a Python generation script supporting streams, order-book markets, attestations, and ERC20 bridge operations on mainnet. It includes deterministic migration overrides with environment-specific token substitutions, bridge alias registrations, and a generator that produces .prod.sql variants from embedded test migrations. The shell migration script is updated to exclude .prod.sql files during standard execution.

Changes

Cohort / File(s) Summary
Stream & Data Management
internal/migrations/001-common-actions.prod.sql, internal/migrations/003-primitive-insertion.prod.sql, internal/migrations/003-primitive-insertion.sql, internal/migrations/004-composed-taxonomy.prod.sql
Adds production variants and removes hardcoded 10-record insertion limit for create_streams, insert_records, and insert_taxonomy actions with fee charging, balance verification, array validation, and bulk inserts.
Attestation Framework
internal/migrations/024-attestation-actions.prod.sql
Implements request_attestation action with fee exemption for network writers, action allowlisting, deterministic hash computation, and attestation queueing.
Order-Book Vault & Settlement
internal/migrations/031-order-book-vault.prod.sql, internal/migrations/033-order-book-settlement.prod.sql, internal/migrations/037-order-book-validation.prod.sql
Adds private collateral lock/unlock actions, multi-step fee distribution across LPs and validators, and comprehensive market collateral validation with vault balance reconciliation.
Order-Book Market Operations
internal/migrations/032-order-book-actions.prod.sql, internal/migrations/032-order-book-actions.sql
Implements market creation, buy/split-limit order placement, and bid changes with collateral management and matching triggers; removes testnet bridge comment.
ERC20 Bridge Mainnet Integration
internal/migrations/erc20-bridge/000-extension.prod.sql, internal/migrations/erc20-bridge/001-actions.prod.sql, internal/migrations/erc20-bridge/002-public-transfer-actions.prod.sql, internal/migrations/erc20-bridge/004-withdrawal-proof-action.prod.sql, internal/migrations/erc20-bridge/005-history-actions.prod.sql
Registers eth_truf and eth_usdc bridge aliases with escrow addresses; provides public/view actions for balance, transfers, withdrawal proofs, and transaction history; validates recipient addresses and enforces fixed token-denominated fees.
Migration Generation & Filtering
scripts/generate_prod_migrations.py, scripts/migrate.sh
Adds Python script to deterministically generate .prod.sql overrides from test migrations via action extraction, bridge token substitution, and selective action filtering; updates shell script to exclude .prod.sql files from standard execution.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~65 minutes

Possibly related PRs

Suggested reviewers

  • outerlook

🐰 Hops with glee through mainnet gates,
Streams and orders, all collate!
Bridges dance in TRUF and USDC,
Fees flow smooth, attestations free—
A production hop through block-height spree! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and accurately summarizes the main objective: enabling mainnet TRUF and USDC bridges for the order book infrastructure.
Docstring Coverage ✅ Passed Docstring coverage is 91.67% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ultimeMigration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MicBun MicBun merged commit 581c62f into main Apr 23, 2026
7 of 8 checks passed
@MicBun MicBun deleted the ultimeMigration branch April 23, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feat New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant