Skip to content

Commit

Permalink
fix: sepolia and blast integ-tests (#708)
Browse files Browse the repository at this point in the history
routing-api pipeline failed. 

Sepolia failed because health state DB has ALCHEMY_11155111 unhealthy in the DB record, but the code doesn't update the DB state back to healthy for some reason. I removed the code reads from health state DB, so that the provider health state transition doesn't happen at runtime.

Blast failed because of wrong weth address that impacts v3 gas model. Fixed in Uniswap/smart-order-router#588
  • Loading branch information
jsy1218 committed May 23, 2024
1 parent fa55a81 commit 6b43be9
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 115 deletions.
13 changes: 7 additions & 6 deletions lib/rpc/SingleJsonRpcProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ import Logger from 'bunyan'
import { Network } from '@ethersproject/networks'
import { getProviderId } from './utils'
import { ProviderHealthiness } from './ProviderHealthState'
import { ProviderHealthStateRepository } from './ProviderHealthStateRepository'
import { ProviderHealthStateDynamoDbRepository } from './ProviderHealthStateDynamoDbRepository'

export const MAJOR_METHOD_NAMES: string[] = ['getBlockNumber', 'call', 'send']

Expand Down Expand Up @@ -57,7 +55,6 @@ export class SingleJsonRpcProvider extends StaticJsonRpcProvider {
private enableDbSync: boolean
private syncingDb: boolean = false
private dbSyncSampleProb: number
private healthStateRepository: ProviderHealthStateRepository
private lastDbSyncTimestampInMs: number = 0

constructor(
Expand All @@ -83,10 +80,9 @@ export class SingleJsonRpcProvider extends StaticJsonRpcProvider {
if (dbTableName === undefined) {
throw new Error('Environment variable RPC_PROVIDER_HEALTH_TABLE_NAME is missing!')
}
this.healthStateRepository = new ProviderHealthStateDynamoDbRepository(dbTableName, log)
// Fire and forget. Won't check the sync result. But usually the sync will finish before the end of initialization
// of the current lambda, so it should already know the latest provider health states before serving requests.
this.syncAndUpdateProviderHealthiness()
// this.syncAndUpdateProviderHealthiness()
}
}

Expand Down Expand Up @@ -288,13 +284,17 @@ export class SingleJsonRpcProvider extends StaticJsonRpcProvider {
this.logDbSyncSampled()
this.syncingDb = true
// Fire and forget. Won't check the sync result.
this.syncAndUpdateProviderHealthiness()
// HealthState DB Sync and auto-failover didn't work during the incident.
// We are commenting out the DB sync to unblock integ-test in Sepolia,
// because HealthState DB has a record for 11155111_ALCHEMY with UNHEALTHY
// this.syncAndUpdateProviderHealthiness()
}
}
}
}
}

/*
private async syncAndUpdateProviderHealthiness() {
try {
const healthStateFromDb = await this.healthStateRepository.read(this.providerId)
Expand Down Expand Up @@ -322,6 +322,7 @@ export class SingleJsonRpcProvider extends StaticJsonRpcProvider {
this.syncingDb = false
}
}
*/

///////////////////// Begin of override functions /////////////////////

Expand Down
164 changes: 80 additions & 84 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@
"@types/stats-lite": "^2.2.0",
"@uniswap/default-token-list": "^11.13.0",
"@uniswap/permit2-sdk": "^1.2.0",
"@uniswap/router-sdk": "^1.9.0",
"@uniswap/router-sdk": "^1.9.2",
"@uniswap/sdk-core": "^4.2.0",
"@types/semver": "^7.5.8",
"@uniswap/smart-order-router": "3.32.0",
"@uniswap/smart-order-router": "3.33.1",
"@uniswap/token-lists": "^1.0.0-beta.33",
"@uniswap/universal-router-sdk": "^1.8.1",
"@uniswap/v2-sdk": "^4.3.0",
"@uniswap/universal-router-sdk": "^2.1.0",
"@uniswap/v2-sdk": "^4.3.2",
"@uniswap/v3-periphery": "^1.4.4",
"@uniswap/v3-sdk": "^3.11.0",
"@uniswap/v3-sdk": "^3.11.2",
"async-retry": "^1.3.1",
"aws-cdk-lib": "^2.137.0",
"aws-embedded-metrics": "^2.0.6",
Expand Down
Loading

0 comments on commit 6b43be9

Please sign in to comment.