Skip to content

Develop - #47

Merged
cristibleotiu merged 4 commits into
mainfrom
develop
Jul 23, 2026
Merged

Develop#47
cristibleotiu merged 4 commits into
mainfrom
develop

Conversation

@aledefra

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings July 23, 2026 10:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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()-driven getAllLicenseHolders() 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.

Comment thread lib/api/blockchain.ts
Comment thread lib/api/oracles.ts
Comment thread app/node-operators/page.tsx
Copilot AI review requested due to automatic review settings July 23, 2026 10:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

  • totalLicenses is derived by converting a BigInt sum to number, which can lose precision (or become Infinity) once the on-chain supply grows beyond Number.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.result object on error can be very noisy (it may include large arrays like epochs_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
cristibleotiu merged commit 36cdc74 into main Jul 23, 2026
4 checks passed
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