Skip to content

Key lastblockNumber by chainName#3

Open
soulofmischief wants to merge 1 commit intomainfrom
fix-lastblock
Open

Key lastblockNumber by chainName#3
soulofmischief wants to merge 1 commit intomainfrom
fix-lastblock

Conversation

@soulofmischief
Copy link

No description provided.

Copy link
Contributor

@avaer avaer left a comment

Choose a reason for hiding this comment

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

What is this accomplishing? Are there multiple chains that we are caching? As far as I know that's not the case.

@soulofmischief
Copy link
Author

What is this accomplishing? Are there multiple chains that we are caching? As far as I know that's not the case.

I noticed while working on redis-server that the same code was being used for multiple chains and thus lastBlockNumber was being set for mainnetsidechain in all cases, including when processing other chains. If we don't want to save the last block number for other chains, then the solution would be to only put the last block number when the chain name is 'mainnetsidechain'

@avaer
Copy link
Contributor

avaer commented May 17, 2021

What does "processing other chains" mean? Which chains? What is being processed? As far as I know there is one chain we run through, mainnetsidechain, for setting up our cache.

Though there are multiple contracts on that chain (3: NFT + Land + Account).

@soulofmischief
Copy link
Author

processEventsNft in particular, gets called on both mainnet and polygon on each boot, since the block number is always zero for these chains.

await putRedisItem(ids.lastCachedBlockNft, {

In this instance ids.lastCachedBlockNft @ redisPrefixes.mainnetsidechainNft is incorrectly being set when each of these chains are processed.

@avaer
Copy link
Contributor

avaer commented May 18, 2021

The question is, do we need to cache polygon network at all? Is that ever needed?

@soulofmischief
Copy link
Author

soulofmischief commented May 20, 2021

The question is, do we need to cache polygon network at all? Is that ever needed?

I would consider that a case of premature optimization, I'll look into why this method is being called on polygon.

@soulofmischief soulofmischief changed the title Key lastblockNumber by chainNmae Key lastblockNumber by chainName May 20, 2021
@avaer
Copy link
Contributor

avaer commented May 20, 2021

My best guess is I had plans to do separate caching but there is no actual polygon caching needed right now.

The mainnetsidechain cache gets what it needs by querying polygon network, but I don't know what the purpose of doing a caching pass over polygon would be. I don't even think the signing server needs that.

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.

2 participants

Comments