Skip to content

Conversation

@ayushboss
Copy link
Contributor

@ayushboss ayushboss commented Aug 5, 2025

Summary

Our existing TON code could not parse price feed updates for updates with more than 7 price feeds. This was because the gas usage for those instructions exceeded the max gas limit for TON transactions (1,000,000). The TON people needed at least 8 in an instruction. This optimization fix cuts down on gas usage enough to do that.

The read_and_store_large_data method used to conduct a double reversal process -- it would split the input data up into chunks through a linked list whose head was at the end of the data and tail at the start. It would then again traverse the linked list to reverse that reversed sequence. My optimization splits the input data into its chunks in a forward approach, avoiding the requirement to reverse and re-reverse.

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

Validated against existing tests, and added a new test for 8 price feeds to make sure that worked. In addition, I previously had tests for 9 and 11 price feeds, but those instructions exceeded the gas limit.

@vercel
Copy link

vercel bot commented Aug 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 5, 2025 7:47pm
7 Skipped Deployments
Name Status Preview Comments Updated (UTC)
component-library ⬜️ Skipped (Inspect) Aug 5, 2025 7:47pm
developer-hub ⬜️ Skipped (Inspect) Aug 5, 2025 7:47pm
entropy-debugger ⬜️ Skipped (Inspect) Aug 5, 2025 7:47pm
entropy-explorer ⬜️ Skipped (Inspect) Aug 5, 2025 7:47pm
insights ⬜️ Skipped (Inspect) Aug 5, 2025 7:47pm
proposals ⬜️ Skipped (Inspect) Aug 5, 2025 7:47pm
staking ⬜️ Skipped (Inspect) Aug 5, 2025 7:47pm

@vercel vercel bot temporarily deployed to Preview – entropy-explorer August 5, 2025 19:29 Inactive
@vercel vercel bot temporarily deployed to Preview – insights August 5, 2025 19:29 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-debugger August 5, 2025 19:29 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals August 5, 2025 19:29 Inactive
@vercel vercel bot temporarily deployed to Preview – staking August 5, 2025 19:29 Inactive
@vercel vercel bot temporarily deployed to Preview – developer-hub August 5, 2025 19:29 Inactive
@vercel vercel bot temporarily deployed to Preview – component-library August 5, 2025 19:29 Inactive
@vercel vercel bot temporarily deployed to Preview – developer-hub August 5, 2025 19:44 Inactive
@vercel vercel bot temporarily deployed to Preview – component-library August 5, 2025 19:44 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-debugger August 5, 2025 19:44 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals August 5, 2025 19:44 Inactive
@vercel vercel bot temporarily deployed to Preview – insights August 5, 2025 19:44 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-explorer August 5, 2025 19:44 Inactive
@vercel vercel bot temporarily deployed to Preview – staking August 5, 2025 19:44 Inactive
@ayushboss ayushboss merged commit 6635edd into main Aug 6, 2025
11 checks passed
@ayushboss ayushboss deleted the ton-8-pf-optimizations branch August 6, 2025 14:55
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.

3 participants