Skip to content

fix: correct block IDs returned by get_blocks when start is non-zero#10738

Open
Rachit2323 wants to merge 3 commits into
dfinity:masterfrom
Rachit2323:fix/decode-block-range-wrong-block-id
Open

fix: correct block IDs returned by get_blocks when start is non-zero#10738
Rachit2323 wants to merge 3 commits into
dfinity:masterfrom
Rachit2323:fix/decode-block-range-wrong-block-id

Conversation

@Rachit2323

Copy link
Copy Markdown
Contributor

Bug

get_blocks(start=5, length=3) returns blocks with wrong IDs (10, 11, 12) instead of correct IDs (5, 6, 7).

The loop variable i already equals the block position, but the code was passing start + i as the block ID — adding start twice by mistake.

Fix

Change decoder(start + i, ...) to decoder(i, ...) — one character fix.

Changes

  • rs/ledger_suite/icrc1/index-ng/src/main.rs — bug fix
  • rs/ledger_suite/icrc1/index-ng/tests/tests.rs — test added

@github-actions github-actions Bot added the fix label Jul 11, 2026
@basvandijk basvandijk added the security-review-passed IDX or InfraSec have concluded it's safe to run CI on the external PR. label Jul 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@basvandijk

Copy link
Copy Markdown
Collaborator

@Rachit2323 thanks for the contribution. Note there's a clippy error. Also note both of your PRs are drafts. If you want us to review them I suggest to undraft them.

@Rachit2323 Rachit2323 marked this pull request as ready for review July 13, 2026 11:15
@Rachit2323 Rachit2323 requested a review from a team as a code owner July 13, 2026 11:15
@github-actions github-actions Bot added the @defi label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@defi external-contributor fix security-review-passed IDX or InfraSec have concluded it's safe to run CI on the external PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants