Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed indexing for holesky wrong app #136

Merged
merged 6 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions src/LidoDAO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AppVersion } from '../generated/schema'
import {
KERNEL_APP_BASES_NAMESPACE,
APP_REPOS,
ZERO_ADDRESS,
ZERO_ADDRESS, HOLESKY_BROKEN_APP_ADDRESSES,
} from './constants'

export function handleSetApp(event: SetAppEvent): void {
Expand All @@ -22,12 +22,20 @@ export function handleSetApp(event: SetAppEvent): void {
// updating only in case of a new contract address
if (entity.impl != event.params.app) {
const repo = AppRepo.bind(Address.fromString(repoAddr))
const latest = repo.getLatestForContractAddress(event.params.app)
const semVer = latest.getSemanticVersion()
// fix failing indexing, for wrong app set for Holesky
if (HOLESKY_BROKEN_APP_ADDRESSES.includes(event.params.app.toHexString())) {
Jeday marked this conversation as resolved.
Show resolved Hide resolved
entity.major = 0;
entity.minor = 0;
entity.patch = 0;
} else {
const latest = repo.getLatestForContractAddress(event.params.app)
const semVer = latest.getSemanticVersion()

entity.major = semVer[0]
entity.minor = semVer[1]
entity.patch = semVer[2]
}

entity.major = semVer[0]
entity.minor = semVer[1]
entity.patch = semVer[2]
entity.impl = event.params.app

entity.block = event.block.number
Expand Down
5 changes: 5 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,8 @@ PROTOCOL_UPG_APP_VERS.set(ORACLE_APP_ID_HOLESKY, [])
PROTOCOL_UPG_APP_VERS.set(VOTING_APP_ID_MAINNET, [])
PROTOCOL_UPG_APP_VERS.set(VOTING_APP_ID_GOERLI, [])
PROTOCOL_UPG_APP_VERS.set(VOTING_APP_ID_HOLESKY, [])


// these addresses on Holesky returns error for method getLatestForContractAddress
// this can happen with Holesky when someone add incorrect app address we have to exclude them
export const HOLESKY_BROKEN_APP_ADDRESSES = ['0x87BF3bB78ee5a326c49EF73b9715A5109cc58922']
Loading