Skip to content

Conversation

@g1nt0ki
Copy link
Member

@g1nt0ki g1nt0ki commented Oct 13, 2025

No description provided.

const filteredAddresses: { [chain: Chain]: Address[] } = {};

const tokenAddresses = async (): Promise<{ [chain: Chain]: Address[] }> => {
//QUESTION: how are the errors here handled?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right now theyre handled down stream

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unless you are checking for error objects in promisePool, they get ignored

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is something I hate about promisePool, if you use our sdk one, it throws error: https://github.com/DefiLlama/defillama-sdk/blob/more-chainApi-methods/src/util/promisePool.ts#L5

// isnt this a lot of writes?
prices = await getR2JSONString(`prices/${chain}.json`);
} catch (e) {
// QUESTION: hmm, what does happen if the price is already cached? are you deleting old prices somewhere else in the code?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just for debug while the works in dev

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same with the other R2s below, theyre cached for ages but it speeds up the process significantly for debug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants