From 85b570f4081dab6fd253a04c98f91e8900380adb Mon Sep 17 00:00:00 2001 From: Justin <328965+justinbarry@users.noreply.github.com> Date: Thu, 13 Aug 2020 20:37:18 -0700 Subject: [PATCH] Revert the magic (#9023) * Revert "Set concurrentDBOperationsLimit to 1 for Safari" This reverts commit ebf4f35e * Revert "add clears to the retry/timeout queue (#8960)" This reverts commit 38a3d42c * Revert "add clears to the retry/timeout queue" This reverts commit 720c3902 * Revert "Increase DB operation timeout (#8958)" This reverts commit 501df4a5 * Revert "Serialize writes (#8935)" This reverts commit f1eead8f --- package.json | 2 +- .../src/environments/default.json | 3 +- .../src/environments/mainnet.json | 5 +- .../augur-artifacts/src/environments/v2.json | 3 +- packages/augur-sdk-lite/package.json | 2 +- packages/augur-sdk/package.json | 4 +- packages/augur-sdk/src/state/create-api.ts | 6 +- .../augur-sdk/src/state/db/AbstractTable.ts | 119 ++---------------- .../augur-sdk/src/state/db/BaseSyncableDB.ts | 5 - packages/augur-sdk/src/state/db/DB.ts | 75 +++++------ .../src/state/db/DBCollectionProxy.ts | 45 ------- packages/augur-sdk/src/state/db/DerivedDB.ts | 4 - .../augur-sdk/src/state/db/GetterCache.ts | 4 - .../augur-sdk/src/state/db/RollbackTable.ts | 4 +- .../augur-sdk/src/state/db/ZeroXOrders.ts | 4 - packages/augur-sdk/src/warp/WarpController.ts | 3 +- .../src/modules/app/actions/init-augur.ts | 1 - packages/augur-ui/src/services/augursdk.ts | 4 - packages/augur-utils/src/configuration.ts | 6 +- yarn.lock | 16 +-- 20 files changed, 59 insertions(+), 256 deletions(-) diff --git a/package.json b/package.json index f1a2e37aa86..d1d62eb14d7 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "fix": "gts fix" }, "devDependencies": { - "@types/async": "3.2.3", + "@types/async": "3.0.1", "@types/bn.js": "4.11.5", "@types/chai": "4.2.3", "@types/chai-as-promised": "7.1.2", diff --git a/packages/augur-artifacts/src/environments/default.json b/packages/augur-artifacts/src/environments/default.json index f783f0c78d0..88d1903891a 100644 --- a/packages/augur-artifacts/src/environments/default.json +++ b/packages/augur-artifacts/src/environments/default.json @@ -72,6 +72,5 @@ "trackMarketInvalidBids": true, "fallbackProvider": "torus", "primaryProvider" : "wallet" - }, - "concurrentDBOperationsLimit": 10 + } } diff --git a/packages/augur-artifacts/src/environments/mainnet.json b/packages/augur-artifacts/src/environments/mainnet.json index d5044d7a6e2..1dc7c974911 100644 --- a/packages/augur-artifacts/src/environments/mainnet.json +++ b/packages/augur-artifacts/src/environments/mainnet.json @@ -123,6 +123,7 @@ "enabled": true, "autoReport": false, "createCheckpoints": true + }, "syncing": { "enabled": true @@ -131,6 +132,7 @@ "sdk": { "enabled": false, "ws": "ws://localhost:60557" + }, "server": { "httpPort": 9003, @@ -141,8 +143,9 @@ "startWS": true, "wssPort": 9002, "startWSS": true + }, - "logLevel": 0, + "logLevel": 2, "showReloadModal": false, "averageBlocktime": 15000, "ui": { diff --git a/packages/augur-artifacts/src/environments/v2.json b/packages/augur-artifacts/src/environments/v2.json index d182c93beac..a56dcccae8c 100644 --- a/packages/augur-artifacts/src/environments/v2.json +++ b/packages/augur-artifacts/src/environments/v2.json @@ -145,6 +145,5 @@ "fallbackProvider": "torus", "primaryProvider": "wallet" }, - "averageBlocktime": 2000, - "concurrentDBOperationsLimit": 10 + "averageBlocktime": 2000 } diff --git a/packages/augur-sdk-lite/package.json b/packages/augur-sdk-lite/package.json index d91be092925..caa05e7dc5d 100644 --- a/packages/augur-sdk-lite/package.json +++ b/packages/augur-sdk-lite/package.json @@ -32,7 +32,7 @@ "lz-string": "1.4.4" }, "devDependencies": { - "@types/async": "3.2.3", + "@types/async": "3.0.1", "@types/cors": "2.8.6", "@types/node": "10.14.18", "@types/node-fetch": "2.5.1", diff --git a/packages/augur-sdk/package.json b/packages/augur-sdk/package.json index 2b85378ae42..d8c2772c6b9 100644 --- a/packages/augur-sdk/package.json +++ b/packages/augur-sdk/package.json @@ -55,7 +55,7 @@ "comlink": "^4.3.0", "cors": "2.8.5", "cross-fetch": "3.0.4", - "dexie": "3.0.2", + "dexie": "3.0.0-rc.4", "ethereum-types": "2.1.6", "ethereumjs-blockstream": "7.0.0", "ethereumjs-tx": "2.1.2", @@ -77,7 +77,7 @@ "devDependencies": { "@0x/mesh-browser": "9.3.0", "@augurproject/types": "^2.1.1", - "@types/async": "3.2.3", + "@types/async": "3.0.1", "@types/cors": "2.8.6", "@types/dexie": "1.3.1", "@types/express": "4.17.1", diff --git a/packages/augur-sdk/src/state/create-api.ts b/packages/augur-sdk/src/state/create-api.ts index 7792b25c8f2..302a6c2b497 100644 --- a/packages/augur-sdk/src/state/create-api.ts +++ b/packages/augur-sdk/src/state/create-api.ts @@ -189,18 +189,14 @@ export async function createServer(config: SDKConfiguration, client?: Augur): Pr contractEvents.getEventTopics, contractEvents.parseLogs, ); - const db = DB.createAndInitializeDB( Number(config.networkId), config.uploadBlockNumber, logFilterAggregator, client, - config.zeroX?.mesh?.enabled || config.zeroX?.rpc?.enabled, - client.config.concurrentDBOperationsLimit + config.zeroX?.mesh?.enabled || config.zeroX?.rpc?.enabled ); - await db; - if(config.warpSync?.createCheckpoints && config.warpSync?.autoReport) { client.events.on(SubscriptionEventName.WarpSyncHashUpdated, async ({ hash }) => { diff --git a/packages/augur-sdk/src/state/db/AbstractTable.ts b/packages/augur-sdk/src/state/db/AbstractTable.ts index d0a8cfd0576..7a4f0efce83 100644 --- a/packages/augur-sdk/src/state/db/AbstractTable.ts +++ b/packages/augur-sdk/src/state/db/AbstractTable.ts @@ -1,7 +1,5 @@ -import { logger } from '@augurproject/utils'; import Dexie from 'dexie'; import * as _ from 'lodash'; -import { AsyncQueue, queue, timeout, retry } from 'async'; export type PrimitiveID = string | number | Date; @@ -9,24 +7,10 @@ export type ID = PrimitiveID | Array; export const ALL_DOCS_BATCH_SIZE = 200; -export enum WriteTaskType { - ADD, - PUT, - UPSERT, - CLEAR, -} - -interface WriteQueueTask { - type: WriteTaskType; - documents?: BaseDocument[]; - table: AbstractTable; -} - export interface BaseDocument { [key: string]: any; } -export const DEFAULT_CONCURRENCY = 10; export abstract class AbstractTable { table: Dexie.Table; protected networkId: number; @@ -34,38 +18,6 @@ export abstract class AbstractTable { protected idFields: string[]; protected syncing: boolean; - static setConcurrency = (limit = DEFAULT_CONCURRENCY) => { - if(limit !== DEFAULT_CONCURRENCY) logger.info(`Setting concurrent DB write limit to ${limit}`); - AbstractTable.writeQueue = queue( - (task: WriteQueueTask, callback) => { - return retry( - { - times: 2, - interval: function (retryCount) { - return 100; - }, - errorFilter: function (err) { - return err['code'] === "ETIMEDOUT"; - } - }, timeout(async function WriteOperation() { - if (task.type === WriteTaskType.ADD) { - return task.table.bulkAddDocumentsInternal(task.documents); - } else if (task.type === WriteTaskType.PUT) { - return task.table.bulkPutDocumentsInternal(task.documents); - } else if (task.type === WriteTaskType.CLEAR) { - return task.table.clearInternal(); - } else { - return task.table.bulkUpsertDocumentsInternal(task.documents); - } - }, 10000), callback); - }, - limit - ); - return AbstractTable.writeQueue; - } - - private static writeQueue: AsyncQueue = AbstractTable.setConcurrency(); - protected constructor(networkId: number, dbName: string, db: Dexie) { this.networkId = networkId; this.dbName = dbName; @@ -76,14 +28,11 @@ export abstract class AbstractTable { } async clearDB(): Promise { - console.log(`AbstractTable: clearDB request for ${this.dbName} started`); await this.table.clear(); - console.log(`AbstractTable: clearDB request for ${this.dbName} finished`); } // We pull all docs in batches to avoid maximum IPC message errors async allDocs(): Promise { - console.log(`AbstractTable: allDocs request for ${this.dbName} started`); const results: any[] = []; const documentCount = await this.getDocumentCount(); for (let batchIdx = 0; batchIdx * ALL_DOCS_BATCH_SIZE <= documentCount; batchIdx++) { @@ -93,90 +42,37 @@ export abstract class AbstractTable { .toArray(); results.push(...batchResults); } - console.log(`AbstractTable: allDocs request for ${this.dbName} finished`); return results; } async delete() { - return this.addWriteTask(WriteTaskType.CLEAR); - } - - async clear() { - return this.addWriteTask(WriteTaskType.CLEAR); + await this.table.clear(); + return Dexie.delete(this.dbName); } async getDocumentCount(): Promise { - console.log(`AbstractTable: getDocumentCount request for ${this.dbName} started`); - const count = await this.table.count(); - console.log(`AbstractTable: getDocumentCount request for ${this.dbName} finished`); - return count; + return this.table.count(); } protected async getDocument(id: string): Promise { return this.table.get(id); } - private async addWriteTask(type: WriteTaskType, documents?: BaseDocument[]): Promise { - return new Promise((resolve, reject) => { - AbstractTable.writeQueue.push({ table: this, documents, type }, (err) => { - if (err) { - console.log(`WriteOperationDied: ${JSON.stringify(err)}`); - reject(err); - } - resolve(); - }); - }); - } - protected async bulkAddDocuments(documents: BaseDocument[]): Promise { - return this.addWriteTask(WriteTaskType.ADD, documents); - } - - protected async bulkPutDocuments(documents: BaseDocument[], documentIds?: any[]): Promise { - return this.addWriteTask(WriteTaskType.PUT, documents); - } - - protected async bulkUpsertDocuments(documents: BaseDocument[]): Promise { - return this.addWriteTask(WriteTaskType.UPSERT, documents); - } - - protected async clearInternal(): Promise { - console.log(`AbstractTable: clear request for ${this.dbName} started`); - await this.table.clear(); - console.log(`AbstractTable: clear request for ${this.dbName} finished`); - } - - protected async bulkAddDocumentsInternal(documents: BaseDocument[]): Promise { - console.log(`AbstractTable: bulkAddDocuments request for ${this.dbName} started. ${documents.length} docs`); for (const document of documents) { delete document.constructor; } - try { - await this.table.bulkAdd(documents); - } catch(e) { - console.warn(`AbstractTable: bulkAddDocuments request for ${this.dbName} failed.`, e); - // We intentionally do not throw here so that retries on timeouts that actually succeed do not halt syncing - } - console.log(`AbstractTable: bulkAddDocuments request for ${this.dbName} finished. ${documents.length} docs`); + await this.table.bulkAdd(documents); } - protected async bulkPutDocumentsInternal(documents: BaseDocument[], documentIds?: any[]): Promise { - console.log(`AbstractTable: bulkPutDocuments request for ${this.dbName} started. ${documents.length} docs`); + protected async bulkPutDocuments(documents: BaseDocument[], documentIds?: any[]): Promise { for (const document of documents) { delete document.constructor; } - try { - await this.table.bulkPut(documents); - } catch(e) { - console.warn(`AbstractTable: bulkPutDocuments request for ${this.dbName} failed.`, e); - throw e; - } await this.table.bulkPut(documents); - console.log(`AbstractTable: bulkPutDocuments request for ${this.dbName} finished. ${documents.length} docs`); } - protected async bulkUpsertDocumentsInternal(documents: BaseDocument[]): Promise { - console.log(`AbstractTable: bulkUpsertDocuments request for ${this.dbName} started. ${documents.length} docs`); + protected async bulkUpsertDocuments(documents: BaseDocument[]): Promise { const documentIds = _.map(documents, this.getIDValue.bind(this)); const existingDocuments = await this.table.bulkGet(documentIds); let docIndex = 0; @@ -184,8 +80,7 @@ export abstract class AbstractTable { existingDocuments[docIndex] = Object.assign({}, existingDocument || {}, documents[docIndex]); docIndex++; } - await this.bulkPutDocumentsInternal(existingDocuments, documentIds); - console.log(`AbstractTable: bulkUpsertDocuments request for ${this.dbName} finished. ${documents.length} docs`); + await this.bulkPutDocuments(existingDocuments, documentIds); } protected async saveDocuments(documents: BaseDocument[]): Promise { diff --git a/packages/augur-sdk/src/state/db/BaseSyncableDB.ts b/packages/augur-sdk/src/state/db/BaseSyncableDB.ts index 2a00f70d0ce..cb90d130016 100644 --- a/packages/augur-sdk/src/state/db/BaseSyncableDB.ts +++ b/packages/augur-sdk/src/state/db/BaseSyncableDB.ts @@ -35,11 +35,6 @@ export class BaseSyncableDB extends RollbackTable { return super.delete(); } - async clear() { - this.db.unregisterEventListener(this.eventName, this.addNewBlock); - return super.clear(); - } - protected async saveDocuments(documents: BaseDocument[]): Promise { return this.bulkAddDocuments(documents); } diff --git a/packages/augur-sdk/src/state/db/DB.ts b/packages/augur-sdk/src/state/db/DB.ts index 45b6db2f471..4e163922649 100644 --- a/packages/augur-sdk/src/state/db/DB.ts +++ b/packages/augur-sdk/src/state/db/DB.ts @@ -46,7 +46,6 @@ import { LogCallbackType, LogFilterAggregatorInterface, } from '../logs/LogFilterAggregator'; -import { AbstractTable, DEFAULT_CONCURRENCY } from './AbstractTable'; import { BaseSyncableDB } from './BaseSyncableDB'; import { DelayedSyncableDB } from './DelayedSyncableDB'; import { DisputeDatabase } from './DisputeDB'; @@ -62,11 +61,6 @@ interface Schemas { [table: string]: string; } -import './DBCollectionProxy'; - -// @ts-ignore -Dexie.debug = "dexie"; - // Prune horizon is 60 days. const PRUNE_HORIZON = SECONDS_IN_A_DAY.multipliedBy(60).toNumber(); @@ -80,7 +74,6 @@ export class DB { getterCache: GetterCache; syncStatus: SyncStatus; warpCheckpoints: WarpSyncCheckpointsDB; - private dbOpened: boolean = false; readonly genericEventDBDescriptions: GenericEventDBDescription[] = [ { EventName: 'CompleteSetsPurchased', indexes: ['timestamp', 'market'] }, @@ -194,8 +187,7 @@ export class DB { uploadBlockNumber: number, logFilterAggregator: LogFilterAggregatorInterface, augur: Augur, - enableZeroX = false, - concurrencyLimit = DEFAULT_CONCURRENCY + enableZeroX = false ): Promise { const dbName = `augur-${networkId}`; const dbController = new DB( @@ -207,10 +199,6 @@ export class DB { enableZeroX ); - if(concurrencyLimit !== DEFAULT_CONCURRENCY) { - AbstractTable.setConcurrency(concurrencyLimit); - } - return dbController.initializeDB(); } @@ -222,19 +210,12 @@ export class DB { * @return {Promise} */ async initializeDB(): Promise { - if (!this.dbOpened) { - const schemas = this.generateSchemas(); - - console.log(`DB: Dexie schema store`); - this.dexieDB.version(1).stores(schemas); + const schemas = this.generateSchemas(); - console.log(`DB: Dexie open DB`); - await this.dexieDB.open(); + this.dexieDB.version(1).stores(schemas); - this.dbOpened = true; - } + await this.dexieDB.open(); - console.log(`DB: Creating DB Objects`); this.syncStatus = new SyncStatus(this.networkId, this.uploadBlockNumber, this); this.warpCheckpoints = new WarpSyncCheckpointsDB(this.networkId, this); this.getterCache = GetterCache.create(this, this.networkId, this.augur); @@ -304,7 +285,6 @@ export class DB { // Always start syncing from 10 blocks behind the lowest // last-synced block (in case of restarting after a crash) - console.log(`DB: Checking rollback requirements`); const startSyncBlockNumber = await this.getSyncStartingBlock() - 1; if (startSyncBlockNumber > this.syncStatus.defaultStartSyncBlockNumber) { console.log( @@ -315,34 +295,30 @@ export class DB { console.log() } - if (!this.augur.config.deploy.isProduction) { - console.log(`DB: Checking stale dev universe`); - const universeCreatedLogCount = await this.UniverseCreated.count(); - if (universeCreatedLogCount > 0) { - const currentUniverseCreateLogCount = await this.UniverseCreated.where( - 'childUniverse' - ) - .equalsIgnoreCase(this.augur.contracts.universe.address) - .count(); - - if (currentUniverseCreateLogCount === 0) { - console.log(`DB: Deleting Database due to stale universe`); - // Need to reset the db if we have universe created logs from a previous deployment. - await this.clear(); - await this.initializeDB(); - } + const universeCreatedLogCount = await this.UniverseCreated.count(); + if (universeCreatedLogCount > 0) { + const currentUniverseCreateLogCount = await this.UniverseCreated.where( + 'childUniverse' + ) + .equalsIgnoreCase(this.augur.contracts.universe.address) + .count(); + + if (currentUniverseCreateLogCount === 0) { + // Need to reset the db if we have universe created logs from a previous deployment. + await this.delete(); + await this.initializeDB(); } } return this; } - // Clear tables and unregister event handlers. - async clear() { + // Remove databases and unregister event handlers. + async delete() { for (const db of Object.values(this.syncableDatabases)) { - await db.clear(); + await db.delete(); } - await this.getterCache.clear(); + this.getterCache.delete(); this.syncableDatabases = {}; @@ -351,6 +327,8 @@ export class DB { this.marketDatabase = undefined; this.parsedOrderEventDatabase = undefined; this.getterCache = undefined; + + this.dexieDB.close(); } generateSchemas(): Schemas { @@ -441,13 +419,16 @@ export class DB { for (const { EventName: dbName, primaryKey } of this .genericEventDBDescriptions) { if (primaryKey) { - console.log(`Syncing derived db ${dbName}Rollup`); - await this.syncableDatabases[`${dbName}Rollup`].sync( - highestAvailableBlockNumber + dbSyncPromises.push( + this.syncableDatabases[`${dbName}Rollup`].sync( + highestAvailableBlockNumber + ) ); } } + await Promise.all(dbSyncPromises); + // Derived DBs are synced after generic log DBs complete console.log('Syncing derived DBs'); diff --git a/packages/augur-sdk/src/state/db/DBCollectionProxy.ts b/packages/augur-sdk/src/state/db/DBCollectionProxy.ts index 090440a806f..e69de29bb2d 100644 --- a/packages/augur-sdk/src/state/db/DBCollectionProxy.ts +++ b/packages/augur-sdk/src/state/db/DBCollectionProxy.ts @@ -1,45 +0,0 @@ -import Dexie, { - Collection, IndexableType, - PromiseExtended, - ThenShortcut, -} from 'dexie'; -import { queue, timeout, retry } from 'async'; - -interface ToArrayQueueTask { - cb?: ThenShortcut; - collection: Collection; -}; - -export function CollectionQueueAddOn (db: Dexie) { - const originalToArray = db.Collection.prototype.toArray; - const toArrayQueue = queue>(({collection, cb}, callback) => { - return retry( - { - times: 5, - interval: function (retryCount) { - return 100; - }, - errorFilter: function (err) { - return err['code'] === "ETIMEDOUT"; - } - }, timeout(async function ReadOperation() { - console.log('Reading Query'); - return originalToArray.call(collection, cb); - }, 10000), callback); - }, 10); - - db.Collection.prototype.toArray = function toArray(cb?): PromiseExtended { - return new Dexie.Promise((resolve, reject) => { - toArrayQueue.push({ collection: this, cb }, (err, result:any[]) => { - if (err) { - console.log('ReadOperationDied') - reject(err); - } - resolve(result); - }); - }); - } -} - -// Register the addon to be included by default (optional) -Dexie.addons.push(CollectionQueueAddOn); diff --git a/packages/augur-sdk/src/state/db/DerivedDB.ts b/packages/augur-sdk/src/state/db/DerivedDB.ts index 87247b96067..583b1059b44 100644 --- a/packages/augur-sdk/src/state/db/DerivedDB.ts +++ b/packages/augur-sdk/src/state/db/DerivedDB.ts @@ -49,10 +49,6 @@ export class DerivedDB extends RollbackTable { ); } - async clear() { - this.delete(); - } - async onBulkSyncComplete() { this.stateDB.registerEventListener( this.mergeEventNames, diff --git a/packages/augur-sdk/src/state/db/GetterCache.ts b/packages/augur-sdk/src/state/db/GetterCache.ts index fd42bcc215b..770889ce0fe 100644 --- a/packages/augur-sdk/src/state/db/GetterCache.ts +++ b/packages/augur-sdk/src/state/db/GetterCache.ts @@ -154,8 +154,4 @@ export class GetterCache extends AbstractTable { this.augur.off(eventName); }) } - - async clear() { - return this.delete(); - } } diff --git a/packages/augur-sdk/src/state/db/RollbackTable.ts b/packages/augur-sdk/src/state/db/RollbackTable.ts index 8f464ad9d52..33e4419c3e9 100644 --- a/packages/augur-sdk/src/state/db/RollbackTable.ts +++ b/packages/augur-sdk/src/state/db/RollbackTable.ts @@ -29,7 +29,7 @@ export class RollbackTable extends AbstractTable { this.augur = augur; } - protected async bulkPutDocumentsInternal(documents: BaseDocument[], documentIds?: any[]): Promise { + protected async bulkPutDocuments(documents: BaseDocument[], documentIds?: any[]): Promise { if (!this.isStandardRollback && !this.syncing && documentIds) { const rollbackDocuments = []; const rollbackIds = []; @@ -55,7 +55,7 @@ export class RollbackTable extends AbstractTable { const maxBlock =_.get(_.maxBy(documents, 'blockNumber'), 'blockNumber'); await this.prune(maxBlock); } - await super.bulkPutDocumentsInternal(documents); + await super.bulkPutDocuments(documents); } async rollback(blockNumber: number): Promise { diff --git a/packages/augur-sdk/src/state/db/ZeroXOrders.ts b/packages/augur-sdk/src/state/db/ZeroXOrders.ts index 498f17901ea..cd0c6f26808 100644 --- a/packages/augur-sdk/src/state/db/ZeroXOrders.ts +++ b/packages/augur-sdk/src/state/db/ZeroXOrders.ts @@ -119,10 +119,6 @@ export class ZeroXOrders extends AbstractTable { this.augur.events.off(SubscriptionEventName.ZeroXRPCOrderEvent, this.handleOrderEvent); } - async clear() { - return this.delete(); -} - async handleOrderEvent(orderEvents: OrderEvent[]): Promise { if (orderEvents.length < 1) return; const bulkOrderEvents = []; diff --git a/packages/augur-sdk/src/warp/WarpController.ts b/packages/augur-sdk/src/warp/WarpController.ts index 5038243845e..154176c32fa 100644 --- a/packages/augur-sdk/src/warp/WarpController.ts +++ b/packages/augur-sdk/src/warp/WarpController.ts @@ -248,8 +248,7 @@ export class WarpController { } async destroyAndRecreateDB() { - console.log(`WarpController: Clearing and re-initializing DB`); - await this.db.clear(); + await this.db.delete(); await this.db.initializeDB(); } diff --git a/packages/augur-ui/src/modules/app/actions/init-augur.ts b/packages/augur-ui/src/modules/app/actions/init-augur.ts index b0432605164..b0661bbfadb 100644 --- a/packages/augur-ui/src/modules/app/actions/init-augur.ts +++ b/packages/augur-ui/src/modules/app/actions/init-augur.ts @@ -343,7 +343,6 @@ export function connectAugur( // wire up start up events for sdk dispatch(listenForStartUpEvents(Augur)); - console.log("AUGURSDK: connect"); try { await augurSdk.connect(); } catch(e) { diff --git a/packages/augur-ui/src/services/augursdk.ts b/packages/augur-ui/src/services/augursdk.ts index 92a9a249c29..df68f098798 100644 --- a/packages/augur-ui/src/services/augursdk.ts +++ b/packages/augur-ui/src/services/augursdk.ts @@ -49,10 +49,6 @@ export class SDK { this.config.zeroX.delayTillSDKReady = true; } - if (isSafari() || isMobileSafari()) { - this.config.concurrentDBOperationsLimit = 1; - } - const ethersProvider = new EthersProvider( provider, this.config.ethereum.rpcRetryCount, diff --git a/packages/augur-utils/src/configuration.ts b/packages/augur-utils/src/configuration.ts index 062e28bf456..4002dd2eff0 100644 --- a/packages/augur-utils/src/configuration.ts +++ b/packages/augur-utils/src/configuration.ts @@ -110,8 +110,7 @@ export interface SDKConfiguration { fallbackProvider?: 'jsonrpc' | 'torus', liteProvider?: 'jsonrpc' | 'default', primaryProvider?: 'jsonrpc' | 'wallet' - }, - concurrentDBOperationsLimit?: number + } }; export interface ContractAddresses { @@ -267,8 +266,7 @@ export const DEFAULT_SDK_CONFIGURATION: SDKConfiguration = { fallbackProvider: 'torus', liteProvider: 'jsonrpc', primaryProvider: 'wallet' - }, - concurrentDBOperationsLimit: 10 + } }; export function sanitizeConfig(config: RecursivePartial): RecursivePartial { diff --git a/yarn.lock b/yarn.lock index c5e5bd49301..e4caf9b992f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3902,10 +3902,10 @@ resolved "https://registry.yarnpkg.com/@types/argparse/-/argparse-1.0.36.tgz#9720632ec67f4e48f75c5956107c07f899765842" integrity sha512-3+i1qzPwyNjbJeiZuJQuETdAe7kWsbI+Vrpj8kbdqAEsXaBDxHPEPg6tXGeDEP0DDPrOnvyFJjm6XNOoK6685w== -"@types/async@3.2.3": - version "3.2.3" - resolved "https://registry.yarnpkg.com/@types/async/-/async-3.2.3.tgz#c56f5e0fc02f8b37196f79239cc857e789b97bb4" - integrity sha512-deXFjLZc1h6SOh3hicVgD+S2EAkhSBGX/vdlD4nTzCjjOFQ+bfNiXocQ21xJjFAUwqaCeyvOQMgrnbg4QEV63A== +"@types/async@3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/async/-/async-3.0.1.tgz#eb33247ffc23d904f9069a292c260c6324cb652c" + integrity sha512-fBq+1+btw/4CPGCpp3B05vUsslyikLUSUoZmFEjjHrUEPOisIVxUzGJFg1k43iWq9y0lC2UDqWAlg5ynUCwwSA== "@types/babel__core@^7.1.0": version "7.1.8" @@ -9820,10 +9820,10 @@ dexie@*, dexie@^3.0.1: resolved "https://registry.yarnpkg.com/dexie/-/dexie-3.0.1.tgz#faafeb94be0d5e18b25d700546a2c05725511cfc" integrity sha512-/s4KzlaerQnCad/uY1ZNdFckTrbdMVhLlziYQzz62Ff9Ick1lHGomvTXNfwh4ApEZATyXRyVk5F6/y8UU84B0w== -dexie@3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/dexie/-/dexie-3.0.2.tgz#4b979904d739e0530b68352005f175a82633a075" - integrity sha512-go4FnIoAhcUiCdxutfIZRxnSaSyDgfEq+GH7N0I8nTCJbC2FmeBj+0FrETa3ln5ix+VQMOPsFeYHlgE/8SZWwQ== +dexie@3.0.0-rc.4: + version "3.0.0-rc.4" + resolved "https://registry.yarnpkg.com/dexie/-/dexie-3.0.0-rc.4.tgz#86d52b58a3a4ffc2d01c8f8d41114ab02bbb4ea1" + integrity sha512-zsttc+pYSSBPhwYlfQcPfB9n3jdyye0WubtDtO9lJ0r051V67W+BGDGsodNwYb/NmyTYG3jxN9M0z4FbFtYqtg== dezalgo@^1.0.0: version "1.0.3"