Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Algodv2.block() throws for some blocks (v3.0.0) #909

Open
d13co opened this issue Nov 12, 2024 · 0 comments
Open

Algodv2.block() throws for some blocks (v3.0.0) #909

d13co opened this issue Nov 12, 2024 · 0 comments
Labels
new-bug Bug report that needs triage

Comments

@d13co
Copy link

d13co commented Nov 12, 2024

Subject of the issue

Certain blocks make algodv2 client throw this error: Error: Invalid byte array: (object) null

One such block is 44295768

Repro:

import algosdk from 'algosdk';

const algod = new algosdk.Algodv2('', 'https://mainnet-api.4160.nodely.dev', 443);

try {
  const data = await algod.block(44295768).do();
} catch(e) {
  console.error('oops', e);
}

Results in:

oops Error: Invalid byte array: (object) null
    at ByteArraySchema.fromPreparedMsgpack (file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/[email protected]/node_modules/algosdk/dist/esm/encoding/schema/bytearray.js:23:15)
    at file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/[email protected]/node_modules/algosdk/dist/esm/encoding/schema/array.js:22:65
    at Array.map (<anonymous>)
    at ArraySchema.fromPreparedMsgpack (file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/[email protected]/node_modules/algosdk/dist/esm/encoding/schema/array.js:22:28)
    at OptionalSchema.fromPreparedMsgpack (file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/[email protected]/node_modules/algosdk/dist/esm/encoding/schema/optional.js:38:33)
    at NamedMapSchema.fromPreparedMsgpack (file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/[email protected]/node_modules/algosdk/dist/esm/encoding/schema/map.js:106:54)
    at NamedMapSchema.fromPreparedMsgpack (file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/[email protected]/node_modules/algosdk/dist/esm/encoding/schema/map.js:106:54)
    at file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/[email protected]/node_modules/algosdk/dist/esm/encoding/schema/array.js:22:65
    at Array.map (<anonymous>)
    at ArraySchema.fromPreparedMsgpack (file:///home/dontbesilly/+gtmp/repro-algosdk-3-get-block-issue/node_modules/.pnpm/[email protected]/node_modules/algosdk/dist/esm/encoding/schema/array.js:22:28)

Your environment

  • algosdk: v3.0.0
  • Operating System: Ubuntu 22.04
  • Node: v20.11.0

Steps to reproduce

  1. See above

Expected behaviour

Block returned

Actual behaviour

Error thrown

@d13co d13co added the new-bug Bug report that needs triage label Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-bug Bug report that needs triage
Projects
None yet
Development

No branches or pull requests

1 participant