-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
…g and add caller information
…ent handling, enhance data validation, and streamline ENS registration logic
…ate filter to match new function signature
…transaction handling and error checking
… remove unused functions
…MintBatchReward to use tuple notation
…ainnet-complete configurations
…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.
subquery/src/mappings/nodl.ts
Outdated
await handleLevel(fromNewBalance, from.balance || BigInt(0), timestamp); | ||
await handleLevel(toNewBalance, to.balance || BigInt(0), timestamp); | ||
|
||
from.balance = fromNewBalance < 0 ? BigInt(0) : fromNewBalance; |
There was a problem hiding this comment.
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:
from.balance = fromNewBalance < 0 ? BigInt(0) : fromNewBalance; | |
from.balance = fromNewBalance; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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.
// rawName is the encoded name | ||
const rawName = JSON.stringify(rawOwner); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
…to Sepolia testnet
.sh