Skip to content

Hedera extension: createAccount fails for new users — SDK routing to decommissioned nodes #1098

Description

@justynspooner

✅ Prerequisites

  • Did you perform a cursory search of open issues? Is this bug already reported elsewhere?
  • Are you running the latest SDK version?
  • Are you reporting to the correct repository (magic-js)?

🐛 Description

Account creation via the Magic Hedera extension intermittently fails for new Magic users. When a user logs in for the first time (i.e. the Magic account does not yet exist), the extension has to provision a brand-new Hedera account for that Magic link account. During this flow, the extension's bundled SDK attempts to call createAccount against Hedera consensus nodes that no longer exist. Hedera recently decommissioned a number of nodes, but the SDK still routes requests to them, so the new-account provisioning fails. Existing Magic users (whose Hedera account is already provisioned) are unaffected, since no createAccount call is made. This appears to be resolvable by updating the @hiero-ledger/sdk dependency within the Hedera extension to the latest version, which should carry the current node address book.

🧩 Steps to Reproduce

  1. Install the latest magic-sdk and @magic-ext/hedera.
  2. Initialize Magic with the HederaExtension.
  3. Log in with a brand-new email — one that has no existing Magic account — so the extension must provision a new Hedera account for it.
  4. Observe that the new-account createAccount call intermittently fails when the SDK targets a decommissioned node (e.g. node03).

🤔 Expected behavior

When a new Magic user logs in for the first time, the extension provisions a new Hedera account successfully and consistently, with the SDK only routing the createAccount request to nodes that currently exist in Hedera's address book.

😮 Actual behavior

The call fails on the client side when it hits a removed node. Example failing request:

https://node03.swirldslabs.com/proto.CryptoService/createAccount

node03 no longer exists — see https://status.hedera.com/ for current node status.

💻 Code Sample

import { HederaExtension } from '@magic-ext/hedera';
import { Magic } from 'magic-sdk';

const magic = new Magic(key, {
  extensions: [new HederaExtension({ network })],
});
const didToken = await magic.auth.loginWithEmailOTP({ email });

🌎 Environment

Software Version(s)
magic-sdk ^33.7.1
@magic-ext/hedera ^2.5.1
@magic-sdk/admin ^2.8.2
Browser All (environment-independent)
yarn N/A
Operating System All (environment-independent)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions