Skip to content

Fix/fastsync#36

Open
i-naman wants to merge 8 commits into
add/redisstreamsfrom
fix/Fastsync
Open

Fix/fastsync#36
i-naman wants to merge 8 commits into
add/redisstreamsfrom
fix/Fastsync

Conversation

@i-naman
Copy link
Copy Markdown
Member

@i-naman i-naman commented May 26, 2026

What

Why

How

Testing

Checklist

  • make build passes
  • make lint passes
  • make fmt-check passes
  • Commit messages follow conventional commits
  • No secrets or credentials in the diff

saishibunb and others added 8 commits May 21, 2026 15:32
- Added ListAccountsPaginatedCursor function to provide a cursor-based alternative to ListAccountsPaginated, improving performance by avoiding O(N²) re-scans.
- Updated account manager to utilize the new cursor-based pagination in NewAccountNonceIterator and GetAccountsByNonces methods, enhancing efficiency in account retrieval.
- Adjusted related logic to support cursor management, ensuring seamless iteration through accounts without unnecessary overhead.
* feat: add ListAccountsPaginatedFrom and GetZKBlockByNumberFast functions for improved account retrieval

- Introduced ListAccountsPaginatedFrom for cursor-based pagination of accounts, allowing efficient retrieval starting from a specified key.
- Added GetZKBlockByNumberFast for faster block retrieval without proof generation, optimizing performance for bulk reads.
- Refactored existing account retrieval logic to utilize the new functions, enhancing overall efficiency and reducing connection pool strain.
- Updated error handling and logging for better traceability during account and block operations.

* chore: update JMDN-FastSync dependency version in go.mod and go.sum

- Updated the JMDN-FastSync dependency to version v0.0.0-20260526085909-5117eb5dffbf in both go.mod and go.sum files for compatibility with recent changes.

---------

Co-authored-by: Neeraj Chowdary <57310710+neerajchowdary889@users.noreply.github.com>
* feat: add ListAccountsPaginatedFrom and GetZKBlockByNumberFast functions for improved account retrieval

- Introduced ListAccountsPaginatedFrom for cursor-based pagination of accounts, allowing efficient retrieval starting from a specified key.
- Added GetZKBlockByNumberFast for faster block retrieval without proof generation, optimizing performance for bulk reads.
- Refactored existing account retrieval logic to utilize the new functions, enhancing overall efficiency and reducing connection pool strain.
- Updated error handling and logging for better traceability during account and block operations.

* chore: update JMDN-FastSync dependency version in go.mod and go.sum

- Updated the JMDN-FastSync dependency to version v0.0.0-20260526085909-5117eb5dffbf in both go.mod and go.sum files for compatibility with recent changes.

* feat: integrate Redis for asynchronous account synchronization

- Added Redis support for the account sync worker, enabling WriteAccounts and BatchUpdateAccounts to enqueue operations to a Redis Stream, decoupling them from the ImmuDB commit latency.
- Updated configuration to include Redis connection settings in jmdn_default.yaml and corresponding defaults.
- Enhanced error handling to ensure proper initialization of the sync worker and logging for better traceability.
- Refactored account management functions to utilize the new Redis streaming mechanism for improved performance and reliability.

---------

Co-authored-by: Neeraj Chowdary <57310710+neerajchowdary889@users.noreply.github.com>
… immudb_account_manager.go to streamline code and improve maintainability.
This commit introduces proper support for Redis authentication and ensures all nested configuration structures perfectly map to environment variables via Viper.

Changes:
- Add Password field to RedisSettings struct in config.go.
- Update main.go to pass cfg.Database.Redis.Password to the Redis client during initialization.
- Update defaults.go and jmdn_default.yaml to explicitly bind Redis URL to 127.0.0.1:6379 instead of an empty string or wildcard.
- Update loader.go's setDefaults() to explicitly register all top-level Security settings (e.g., global_rate_limit, trusted_proxies).
- Introduce dynamic Viper default registration for Security.Services in loader.go, fully enabling runtime environment variable overrides for nested map fields (e.g. JMDN_SECURITY_SERVICES_EXPLORER_API_RATE_LIMIT).
- FastsyncV2 adapter now maps ChainID and AccessList into non-headers protobufs
- immudb_data_writer and immudb_block_nonheaders properly serialize/deserialize these fields to defaultdb
- immudb_headers_writer now correctly stores and serves LogsBloom
This fixes the Merkle hash divergence on newly fast-synced nodes.
- account_sync_worker: parseAccountsPayload now correctly pushes the DID key into the stream so BatchRestoreAccounts successfully creates the bound did: reference for new accounts.
- account_immuclient: BatchRestoreAccounts now performs field-merging (DIDAddress, CreatedAt, AccountType, Metadata) when processing partial account updates from Fastsync Reconciliation. This prevents data loss for active accounts.
- account_immuclient: PutNonceofAccount migrated to a monotonic nanosecond counter (Option C) to resolve silent uint64 overflow bugs.
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