Skip to content

Conversation

@barraguda
Copy link
Contributor

Problem

Re-indexing of both app_store and kns kimap logs is becoming bulky enough to soon warrant better indexing.

Solution

Save old verified logs in state, looking for new ones.

Also, save state in extendable versioned enum way, so we can easily add/migrate in backwards compatible ways.

Notes

  • need to figure out HashMap key serializing (non strings x json not good)
  • re-index button settings for kns [ ]
  • re-index advanced settings button for app_store [ ]

@dr-frmr
Copy link
Contributor

dr-frmr commented Dec 2, 2024

app_store:sys: error saving state: key must be a string

#[cfg(feature = "simulation-mode")]
add_temp_hardcoded_tlzs(&mut state);

let contract_address = KIMAP_ADDRESS.parse::<eth::Address>().unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a reason contract address was a field inside state. If the contract address changes, state must be reset. This was particularly an issue in beta as contract address could change -- extremely unlikely to happen on mainnet, but should still keep it in state especially now that we can perform state migrations in this app.

// 60s timeout -- these calls can take a long time
// if they do time out, we try them again
let eth_provider: eth::Provider = eth::Provider::new(state.chain_id, SUBSCRIPTION_TIMEOUT);
let eth_provider: eth::Provider = eth::Provider::new(CHAIN_ID, SUBSCRIPTION_TIMEOUT);
Copy link
Contributor

Choose a reason for hiding this comment

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

Chain ID should also be in state so it can migrate smoothly

Copy link
Contributor

Choose a reason for hiding this comment

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

Imagine a future where kns_indexer reads from multiple chains. Not too far away

@barraguda
Copy link
Contributor Author

superceded and addressed by #620

@barraguda barraguda closed this Dec 10, 2024
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