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

Add ENS mapping, improve queries performance. Include CHA-556 #73

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

Douglasacost
Copy link
Collaborator

@Douglasacost Douglasacost commented Jan 6, 2025

  • Adapt DB toVM resources, added utility .sh
  • Add ENS mapping (transfers included)
  • Update contentsign ABI
  • Remove non used events from contentsign to prepare for new ENS names

…ent handling, enhance data validation, and streamline ENS registration logic
…M commands for e_r_c721_tokens and e_r_c721_transfers tables.
- Added a new event handler for ENSTransfer to mainnet-click, mainnet-complete, and testnet-complete configurations.
- Implemented the handleENSTransfer function in the ENS mapping to process transfer events and update ownership records accordingly.
- Enhanced the import statements in ens.ts to include necessary utilities for handling transfers.
…dded a new paginated function to fetch ENS records by owner ID.

- Cleaned up import statements and improved formatting for better code clarity.
…w length and adding average rows, cache hits, and disk reads metrics.
…iew length to 500 characters and adding cache hit ratio calculation for improved performance insights.
…conf

- Added new indexes for ENS data in add_field.sh to improve query performance.
…ge and performance. Adjusted memory settings, connection limits, and autovacuum parameters to better suit a 4GB RAM environment. Enhanced logging and query planning settings for improved performance insights and reduced overhead.
…d_field.sh. Updated memory settings for improved performance, increased connection limits, and optimized autovacuum parameters. Added new indexes for ENS data to boost query performance.
Copy link

linear bot commented Jan 6, 2025

CHA-556

await handleLevel(fromNewBalance, from.balance || BigInt(0), timestamp);
await handleLevel(toNewBalance, to.balance || BigInt(0), timestamp);

from.balance = fromNewBalance < 0 ? BigInt(0) : fromNewBalance;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Again I'd rather get error on unexpected values. If the indexer is correctly synced starting from before the contract's start time, then fromNewBalance should never be < 0. Please add an error for fromNewBalance < 0 and then simplify this line as:

Suggested change
from.balance = fromNewBalance < 0 ? BigInt(0) : fromNewBalance;
from.balance = fromNewBalance;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is to prevent negatives, would like to use "Math.max" but is not compatible with BN. Added a comment

Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand. I'm saying if it's negative through an error. If it's not go ahead. But do not assume a negative value as zero solely because it's unexpected.

@aliXsed
Copy link
Collaborator

aliXsed commented Jan 7, 2025

Thank you @Douglasacost for this important improvement and upgrade. I have left just a few comments for you to look at.

…clarity and maintainability. Renamed variables for better readability, ensuring consistent naming conventions. Updated balance calculations in nodl.ts to enhance clarity and prevent negative balances. This includes securing new balances and improving the handling of account states during transfers.
@Douglasacost Douglasacost requested a review from aliXsed January 8, 2025 11:38
Comment on lines +48 to +49
// rawName is the encoded name
const rawName = JSON.stringify(rawOwner);
Copy link
Collaborator

@aliXsed aliXsed Jan 9, 2025

Choose a reason for hiding this comment

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

I'm not sure if there is any value in reading and storing the encoded name. It should be simply a hex convert of the string isn't it? If name is a proper printable string that should be enough.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey Alex, that one was in case we need the encoded name, ad the events have the name encoded
so, the encoded name coming from the name string
Probably we did not use it, so it can be removed in next changes

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