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

mina funnel #343

Merged
merged 31 commits into from
May 3, 2024
Merged

mina funnel #343

merged 31 commits into from
May 3, 2024

Conversation

ecioppettini
Copy link
Contributor

@ecioppettini ecioppettini commented Apr 11, 2024

This adds a new funnel for Mina.

See PaimaStudios/paima-engine-docs#37 for docs.

TODO

  • Skip graphql and use sql directly ?
  • Currently there is no pagination even if the settings are there, it's not implemented on the backend. Or rather, there is no limit, because I'm not sure right now how to add this easily yet.
  • Get the confirmed block information from the archive node db instead of the node's graphql
  • More testing for correctness (the merging process in particular, I need to construct a precise test)
  • Migrate the queries to pgtyped? This probably would require setting up a new package I think.
  • The db may need some indexes for performance, but I don't have enough data to test this yet, and I don't think it makes sense for paima engine to add those.

@ecioppettini ecioppettini self-assigned this Apr 11, 2024
@ecioppettini ecioppettini marked this pull request as ready for review April 16, 2024 02:32
@@ -19,6 +19,7 @@
"dependencies": {
"assert-never": "^1.2.1",
"@dcspark/carp-client": "^3.1.0",
"@dcspark/cardano-multiplatform-lib-nodejs": "5.2.0"
"@dcspark/cardano-multiplatform-lib-nodejs": "5.2.0",
"postgres": "^3.3.5"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't we use the pg / pg-tx libraries we already use?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be honest I just didn't think about it. I started with this dep because it was being used in the archive node api, and since I took that as the base it was simpler to get started. Then I was considering porting to pgtyped eventually, but I didn't think about that. Switching to pg should be simple, I'll do that first.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah I think switching to pgtyped is a lower priority. If we can at least use pg to avoid having to depend on the postgres package as well I think that's good enough

height: number;
timestamp: string;
};
// TODO: could each data by just a tuple?
Copy link
Contributor

Choose a reason for hiding this comment

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

TODO

@@ -57,7 +62,15 @@ export interface CardanoPresyncChainData {
extensionDatums: ChainDataExtensionDatum[];
}

export type PresyncChainData = EvmPresyncChainData | CardanoPresyncChainData;
// TODO: potentially this and Cardano can be collapsed
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we actually want to do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know. They are basically isomorphic and have the same behavior. But I prefer keeping them separated.

while (true) {
console.log('making query');
Copy link
Contributor

Choose a reason for hiding this comment

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

Presumably you didn't mean to commit these console statements

@@ -80,6 +80,8 @@ export async function getMultipleBlockData(
): Promise<ChainData[]> {
const batch = new web3.BatchRequest();

// console.log('getting multiple block data', fromBlock, toBlock);
Copy link
Contributor

Choose a reason for hiding this comment

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

did you want to leave this one?

Copy link
Contributor

@SebastienGllmt SebastienGllmt left a comment

Choose a reason for hiding this comment

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

LGTM modulo the console.log statements

@SebastienGllmt SebastienGllmt merged commit e5f5f73 into master May 3, 2024
@SebastienGllmt SebastienGllmt deleted the enzo/mina-funnel branch May 3, 2024 10:41
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