Skip to content

Fix MND reward display - #44

Merged
aledefra merged 1 commit into
developfrom
codex/fix-mnd-rewards
May 26, 2026
Merged

Fix MND reward display#44
aledefra merged 1 commit into
developfrom
codex/fix-mnd-rewards

Conversation

@aledefra

Copy link
Copy Markdown
Collaborator

Summary

  • update the Explorer MND ABI to match the deployed reward parameter shape
  • pack oracle availability values into packedAvailabilities and pass fromEpoch / toEpoch to calculateRewards
  • keep the existing undefined fallback when oracle epochs are incomplete or non-contiguous

Root Cause

MND rewards were rendered as ... because the Explorer still called calculateRewards with the old { epochs, availabilies } tuple. The deployed MND contract expects { fromEpoch, toEpoch, packedAvailabilities }, so the read reverted and the UI treated the reward as unavailable.

Validation

  • npm run lint
  • npm run build
  • local runtime check for /license/MND/17 rendered Rewards (PoA) as 55 $R1 with 9.94 carryover instead of ...

Note: npm run build still logs existing stats-page upstream transfer JSON warnings (Must be au...) during static generation, but the build exits successfully.

@aledefra aledefra changed the title [codex] fix MND reward display Fix MND reward display May 26, 2026
@aledefra
aledefra marked this pull request as ready for review May 26, 2026 13:52
Copilot AI review requested due to automatic review settings May 26, 2026 13:52

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 fixes MND reward rendering in the Explorer by aligning the calculateRewards call with the deployed MND contract’s updated parameter shape (epoch range + packed availability bytes), preventing the contract read from reverting and the UI from falling back to ....

Changes:

  • Update the Explorer’s MND ABI calculateRewards tuple fields from { epochs, availabilies } to { fromEpoch, toEpoch, packedAvailabilities }.
  • Add validation that oracle epoch data is complete and contiguous, then pack epochs_vals into a bytes hex payload.
  • Pass fromEpoch / toEpoch along with packedAvailabilities into calculateRewards.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
typedefs/blockchain.ts Updates the ComputeParam shape to match the new MND contract compute params.
lib/api/blockchain.ts Ensures epochs are contiguous/complete, packs availability into bytes, and updates the MND calculateRewards call args.
blockchain/MNDContract.ts Updates the MND ABI tuple component definitions to the deployed contract’s signature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/api/blockchain.ts
@aledefra
aledefra merged commit c02a17f into develop May 26, 2026
3 checks passed
@aledefra
aledefra deleted the codex/fix-mnd-rewards branch May 26, 2026 14:06
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.

2 participants