Fix sync, update dependencies, fix org creation#1492
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
- Use default-mysql-server/client packages instead of mysql-server/client (the latter are not available in Debian Bookworm used by node:20.16 image) - Add retry logic for 503 coin_management startup phase errors in organization creation tests (addresses intermittent test failures) - Add isStartupPhaseError and isRetryableError helpers to centralize retry logic Co-authored-by: Cursor <cursoragent@cursor.com>
The unified config stores MIRROR_DB under V2 section for V2 API. Both CI workflow and test helper now use the correct path. Co-authored-by: Cursor <cursoragent@cursor.com>
- Fix V2 mirror models to use sequelizeV2Mirror instead of sequelizeV2 - Add safeMirrorDbHandlerV2 calls to main V2 models for data sync - Fix mirror table names (remove _mirror suffix to match migrations) - Update config loading to use getConfigV2() for V2 mirror database - Update test helper table name mappings Co-authored-by: Cursor <cursoragent@cursor.com>
The mirror database config selection was based on NODE_ENV, which meant MySQL mirror was only used in "local" mode. This fix checks if MySQL is actually configured (has host, username, password, database) and uses it when available, regardless of NODE_ENV. This allows MySQL mirror to work in CI and production environments. Co-authored-by: Cursor <cursoragent@cursor.com>
…ble logic - Add missing safeMirrorDbHandlerV2 and EstimationV2Mirror imports - Add mirror calls to create and bulkCreate methods - Fix mirrorDBEnabledV2() to only return true when MySQL is configured - In test mode without MySQL, mirror operations are now no-ops Co-authored-by: Cursor <cursoragent@cursor.com>
…data The V2 upgrade was failing because it could start before the V1 org singleton store had the v1 key written to the blockchain. Changes: - waitForV1OrganizationReady now checks orgHash and dataModelVersionStoreHash are populated (non-null/non-zero) before returning - V2 upgrade endpoint validates orgHash is populated and singleton store actually contains the v1 key before accepting upgrade request - Upgrade test now retries on transient singleton validation errors This ensures the V1 org is fully complete before upgrade can proceed.
- Fix MySQL mirror verification to handle DECIMAL precision - Add orgHash to integration test V1 org creation - Fix getStoreDataPromise to use raw persistance.getStoreData (syncService version decoded data, breaking keys_values checks)
Org creation data pushes now call pushChangeListToDataLayer directly, bypassing the legacy hasUnconfirmedTransactions gate that assumed a single coin. With coin splitting we maintain multiple coins so back-to-back transactions work fine. Pushes are staggered by 2s to avoid wallet coin-selection races. When a push fails, a fire-and-forget retry is scheduled every 30s but the caller is notified immediately via throw, preventing false 2/2 stores updated when the data model version push actually failed. The Already have a pending root error from Chia is now handled inline with wait-and-retry instead of bouncing to a 30s retry loop. Null hashes are no longer persisted as dataModelVersionStoreHash; getLocalRoot is used as fallback. Coin split target increased from 12 to 15.
Add timing instrumentation around organization creation in all three live API test files (V1, V2, and V1-to-V2 upgrade). Each prints a clear boxed report showing the org UID and total elapsed time including retries and wait-for-ready polling.
Coin size increased from 10,000 to 100,000,000 mojos to exceed the default xch_spam_amount (1,000,000 mojos). Split fee now reads from DEFAULT_FEE in CADT config instead of being hardcoded. Added MIN_COIN_SIZE guard to prevent creating remainder coins below the spam threshold.
The sync-default-organizations-v2 task was using GOVERNANCE_SYNC_TASK_INTERVAL (86400s/24h) instead of ORGANIZATION_META_SYNC_TASK_INTERVAL (300s/5min), causing new organizations from the governance orgList to not be discovered for 24 hours after a governance change. Additionally, importOrganization checked datalayer sync status before subscribing to the org store, creating a chicken-and-egg problem where new orgs could never be imported because unsubscribed stores can never report as synced. The fix subscribes to the store first, then checks sync status. Also fixes coin management to use config-derived MIN_USABLE_COIN_SIZE (DEFAULT_COIN_AMOUNT + DEFAULT_FEE) instead of hardcoded 100000000 mojos for usable coin filtering.
No description provided.