Skip to content

Fix duplicated account parsing#209

Merged
febo merged 6 commits into
mainfrom
febo/dup-accounts
Jul 22, 2025
Merged

Fix duplicated account parsing#209
febo merged 6 commits into
mainfrom
febo/dup-accounts

Conversation

@febo
Copy link
Copy Markdown
Collaborator

@febo febo commented Jul 19, 2025

Problem

PR #176 refactored the entrypoint and inlined the processing of accounts, but the parsing of duplicated accounts is wrongly storing the address to an AccountInfo instead of an Account.

Solution

Dereference the AccountInfo to store the address of its Account. The PR also includes a test for duplicated account parsing.

As a side-effect of the fix, CU consumption improved:

Name CUs Delta from current
Account (0) 9 --
Account (1) 13 --
Account (2) 13 -8
Account (3) 33 -1
Account (4) 41 -1
Account (5) 48 -1
Account (6) 63 -1
Account (7) 67 -1
Account (8) 74 -1
Account (16) 139 -1
Account (32) 257 -1
Account (64) 500 -1

cc: @cavemanloverboy

Fixes #208

Comment thread sdk/pinocchio/src/entrypoint/mod.rs
@febo febo requested review from illia-bobyr and joncinque July 19, 2025 11:09
@febo febo marked this pull request as ready for review July 19, 2025 11:12
illia-bobyr
illia-bobyr previously approved these changes Jul 19, 2025
Comment thread sdk/pinocchio/src/entrypoint/mod.rs
joncinque
joncinque previously approved these changes Jul 21, 2025
Copy link
Copy Markdown
Collaborator

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah too bad this snuck in, but looks good to me! I feel silly because I almost asked for a test with duplicates in the previous PR.

Comment thread sdk/pinocchio/src/entrypoint/mod.rs Outdated
@febo
Copy link
Copy Markdown
Collaborator Author

febo commented Jul 21, 2025

Ah too bad this snuck in, but looks good to me! I feel silly because I almost asked for a test with duplicates in the previous PR.

I feel the same. There was not a good reason not to include one.

Copy link
Copy Markdown
Collaborator

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@febo febo merged commit ed37b7c into main Jul 22, 2025
10 checks passed
@febo febo deleted the febo/dup-accounts branch July 22, 2025 00:01
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.

Instruction invokes broken

3 participants