Skip to content

Conversation

@jorgecuesta
Copy link
Collaborator

Summary

  • Removed events parameter from indexPrimitives and migrated related logic to indexingHandler for better modularity.
  • Improved optimizedBulkCreate to support higher throughput with parallel writes and increased batch size.
  • Reduced verbose logging across multiple files to enhance output clarity.
  • Small fixes: cleaned up imports and removed unused debug statements for better readability.

Issue

There are blocks on Beta with a size over 700mb (rpc -> /block_results?height=X)
One of those massive blocks contains 1.5 million of events, which need to be filter, processed and indexed.
All this is taking way more, like 2 or 3 minutes on some cases even with transaction, batching, 3 servers with 16 cores and 128gb Ram, NVME disks and full tuneup PostgresQL.

Type of change

Select one or more:

  • New feature, functionality or library
  • Bug fix
  • Code health or cleanup
  • Documentation
  • Other (chore)

Sanity Checklist

  • I have tested my changes using the available tooling
  • I have commented my code
  • I have performed a self-review of my own code; both comments & source code
  • I create and reference any new tickets, if applicable
  • I have left TODOs throughout the codebase, if applicable

- Removed events parameter from `indexPrimitives` and migrated related logic to `indexingHandler` for better modularity.
- Improved `optimizedBulkCreate` to support higher throughput with parallel writes and increased batch size.
- Reduced verbose logging across multiple files to enhance output clarity.
- Added a new script `subquery-publish.sh` for seamless environment-specific publish automation.
- Small fixes: cleaned up imports and removed unused debug statements for better readability.
@jorgecuesta jorgecuesta requested a review from Alann27 June 11, 2025 22:19
@jorgecuesta jorgecuesta self-assigned this Jun 11, 2025
@jorgecuesta jorgecuesta added the enhancement New feature or request label Jun 11, 2025
Alann27 and others added 3 commits June 12, 2025 06:43
We were trigger a lot of promises in parallel, and for some reason when we do this, Sequelize in the background hangs the transactions.

Lowering the number of parallel promises looks like giving more free space into the event loop, which allows To Sequelize to do his job.

- Reordered asynchronous operations in `indexer.manager.ts` for better handling of event processing.
- Introduced a new function `sanitize_cmd` in `shared.sh` to redact sensitive command-line values for logging.
- Updated default values for `BATCH_SIZE` and `CONCURRENCY` in `db.ts`, and added a log entry for global config parameters.
- Enhanced `node-entrypoint.sh` to include additional environment variables and sanitized command logging for execution safety.
- Fixed minor formatting issues in `project.ts` handler configuration.
- Temporarily commented out an ARM64 platform in workflow matrix due to excessive build times.
- Added a note explaining the issue and the need for further investigation.
- Ensured that the AMD64 build process remains unaffected.
@jorgecuesta jorgecuesta merged commit df4af11 into main Jun 17, 2025
3 checks passed
@jorgecuesta jorgecuesta deleted the chore/bulk-write branch June 17, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants