Develop - #47
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the Moralis dependency and switches license-holder sourcing to on-chain Reader pagination, while also improving oracle availability handling by introducing explicit “syncing / no-data / ok” status and related UI messaging.
Changes:
- Replace Moralis-based NFT owner lookup + API route with
Reader.getLicensesPage()-drivengetAllLicenseHolders()and page-level caching. - Add oracle “no epochs / syncing” detection utilities, extend oracle typings, and surface “Syncing oracles” / “No availability data” UI states.
- Clean up deployment/config references to Moralis (Dockerfiles + GitHub workflows) and add a Playwright preview page showcasing the new states.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| typedefs/blockchain.ts | Extends oracle result types with availability_status, error/no-epochs shape, and server_last_synced_epoch. |
| package.json | Removes moralis dependency. |
| package-lock.json | Removes Moralis dependency tree and updates lockfile accordingly. |
| lib/oracles.ts | Adds helpers/type guards for “no epochs found” and oracle syncing/behind detection. |
| lib/api/oracles.ts | Allows /node_epochs_range to return a “no epochs” payload without throwing (via option). |
| lib/api/blockchain.ts | Removes Moralis usage and adds Reader-based getAllLicenseHolders() pagination. |
| lib/actions.ts | Computes and annotates node availability with availability_status and handles “no epochs” fallback behavior. |
| Dockerfile_testnet | Drops MORALIS build arg/env wiring. |
| Dockerfile_mainnet | Drops MORALIS build arg/env wiring. |
| Dockerfile_devnet | Drops MORALIS build arg/env wiring. |
| components/charts/NodesMap.tsx | Falls back to displaying country code when name lookup fails. |
| app/server-components/shared/SyncingOraclesTag.tsx | Adds reusable “Syncing oracles” tag component. |
| app/server-components/Nodes/NodeListGNDCard.tsx | Updates node response typing after removing OraclesDefaultResult intersections. |
| app/server-components/main-cards/NodePerformanceCard.tsx | Adds “syncing/no data” states and uses safer derived arrays for last-10 epochs rendering. |
| app/server-components/main-cards/NodeCard.tsx | Improves robustness around version formatting and resource rendering. |
| app/server-components/main-cards/LicenseCard.tsx | Updates callback typing for node availability. |
| app/server-components/Licenses/NodeSmallCard.tsx | Updates node response typing. |
| app/server-components/Licenses/LicenseRewardsPoA.tsx | Shows syncing UI state for PoA rewards when oracles are behind. |
| app/server-components/LicensePage/LicensePageNodePerformanceCardWrapper.tsx | Updates wrapper typing for node availability. |
| app/server-components/LicensePage/LicensePageNodeCardWrapper.tsx | Updates wrapper typing for node availability. |
| app/playwright-preview/page.tsx | Adds a preview fixture page that renders new oracle syncing/no-epochs UI states. |
| app/node/[nodeAddr]/page.tsx | Updates node response typing after removing OraclesDefaultResult intersections. |
| app/node-operators/page.tsx | Switches holders source to cached getAllLicenseHolders() and removes the old API fetch path. |
| app/api/license-holders/route.ts | Removes the now-unneeded API route previously backed by Moralis. |
| .github/workflows/release.yml | Removes MORALIS secret/env from release build step. |
| .github/workflows/build_testnet_mainnet.yml | Removes MORALIS build-arg from container builds. |
| .github/workflows/build_devnet.yml | Removes MORALIS build-arg from container builds. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 27 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (2)
lib/api/blockchain.ts:495
totalLicensesis derived by converting a BigInt sum tonumber, which can lose precision (or becomeInfinity) once the on-chain supply grows beyondNumber.MAX_SAFE_INTEGER. That can cause the pagination loop to terminate early or loop incorrectly. Add a safe-integer guard before converting, or keep the comparison in BigInt space.
const page = await getLicensesPage(offset, LICENSE_HOLDERS_BATCH_SIZE);
totalLicenses = Number(page.mndTotalSupply + page.ndTotalSupply);
if (page.licenses.length === 0 && offset < totalLicenses) {
throw new Error(`Reader returned an empty licenses page at offset ${offset} of ${totalLicenses}`);
lib/api/oracles.ts:60
- Logging the entire
data.resultobject on error can be very noisy (it may include large arrays likeepochs_vals, signatures, etc.) and can inflate server logs during transient API failures. Prefer logging only the error message (and endpoint) at an error level.
if ('error' in data.result) {
if (options?.allowNoEpochsResult && hasNoEpochsFoundError(data.result.error)) {
return data.result as T;
}
console.log(endpoint, data.result);
throw new Error(data.result.error);
}
cristibleotiu
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.