Change relayer version validating to save backwards compatibility with on Ethereum Mainnet with old Tornado versions
This commit is contained in:
parent
7db929cc8c
commit
d9ae37ebb2
@ -240,21 +240,19 @@ export const actions = {
|
|||||||
throw new Error(this.app.i18n.t('canNotFetchStatusFromTheRelayer'))
|
throw new Error(this.app.i18n.t('canNotFetchStatusFromTheRelayer'))
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasEnabledLightProxy = rootGetters['application/hasEnabledLightProxy']
|
const isRelayerUpdated = () => {
|
||||||
|
|
||||||
const getIsUpdated = () => {
|
|
||||||
const relayerVersion = response.data.version
|
const relayerVersion = response.data.version
|
||||||
|
|
||||||
const { major, prerelease } = parseSemanticVersion(relayerVersion)
|
const { major, patch, prerelease } = parseSemanticVersion(relayerVersion)
|
||||||
|
// Save backwards compatibility with V4 relayers for Ethereum Mainnet
|
||||||
|
const requiredMajor = netId === 1 ? '4' : '5'
|
||||||
|
const isUpdatedMajor = major === requiredMajor
|
||||||
|
|
||||||
const minimalMajorVersion = 5
|
if (prerelease) return false
|
||||||
const isMajorVersionUpdated = Number(major) >= minimalMajorVersion
|
return isUpdatedMajor && Number(patch) >= 4 // Patch checking - also backwards compatibility
|
||||||
if (prerelease && Number(major) === 5 && hasEnabledLightProxy) return false
|
|
||||||
|
|
||||||
return isMajorVersionUpdated
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!getIsUpdated()) {
|
if (!isRelayerUpdated()) {
|
||||||
throw new Error('Outdated version.')
|
throw new Error('Outdated version.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user