Skip to content

Fix era-horizon error by supplying correct slotConfig to createClient#42

Merged
SynthLuvr merged 2 commits into
mainfrom
copilot/fix-transaction-evaluation-error
Mar 2, 2026
Merged

Fix era-horizon error by supplying correct slotConfig to createClient#42
SynthLuvr merged 2 commits into
mainfrom
copilot/fix-transaction-evaluation-error

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 2, 2026

Transactions submitted on preview/preprod were failing with "Uncomputable slot arithmetic; transaction's validity bounds go beyond the foreseeable end of the current era" because the SDK's internal builder defaults to Mainnet slot config when no slotConfig is provided — converting Date.now() + expiresIn to a Mainnet slot number (~149–180M) that exceeds the testnet era horizon (~106M slots).

Changes

  • src/mint.ts, src/burn.ts, src/distribute.ts — Pass slotConfig: Time.SLOT_CONFIG_NETWORK[getNetwork(projectId)] to createClient so the builder uses the correct genesis parameters for the active network when resolving POSIX timestamps to slot numbers.
  • src/burn.ts — Additionally imports getNetwork from ./wallet (was previously absent).
const client = createClient({
  network: parseNetwork(projectId),
  provider: makeBlockfrostConfig(projectId),
  wallet: { type: "read-only", address: wallet.address },
  slotConfig: Time.SLOT_CONFIG_NETWORK[getNetwork(projectId)], // ← fix
});

Without this, the SDK silently falls back to Mainnet's zeroTime/zeroSlot, producing TTL slots that are valid on Mainnet but out-of-range on any testnet sharing the same epoch topology.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: SynthLuvr <131367121+SynthLuvr@users.noreply.github.com>
Comment thread src/mint.ts
Comment thread src/mint.ts
Copilot AI changed the title [WIP] Fix evaluation context creation issue in transactions Fix era-horizon error by supplying correct slotConfig to createClient Mar 2, 2026
@SynthLuvr SynthLuvr marked this pull request as ready for review March 2, 2026 17:17
@SynthLuvr SynthLuvr merged commit c3e3c2b into main Mar 2, 2026
1 check passed
@SynthLuvr SynthLuvr deleted the copilot/fix-transaction-evaluation-error branch March 2, 2026 17:17
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