Skip to content

abi optimizations - #1476

Merged
sbillig merged 13 commits into
argotorg:masterfrom
sbillig:abi-opt-gas
May 30, 2026
Merged

abi optimizations#1476
sbillig merged 13 commits into
argotorg:masterfrom
sbillig:abi-opt-gas

Conversation

@sbillig

@sbillig sbillig commented May 25, 2026

Copy link
Copy Markdown
Collaborator

Per-commit effect, deltas vs parent:

commit change init/runtime deploy deposit#0/#1/#2 total calls
16a607277 Add decode_from ABI lowering -145/-150 -31,632 -13/-13/-13 -315
200338570 Optimize ABI decode_from paths -46/-26 -5,075 -682/-682/-682 -2,046
a35cdaee1 Avoid msg decode generated name collisions 0/0 0 0/0/0 0
75fc01946 Optimize ABI encode paths -66/-66 -14,309 -201/-201/-201 -603
2d9e6fb53 Optimize tuple ABI field encoding +89/+74 +16,365 -483/-483/-483 -1,449
9a32671a4 Outline dynamic Bytes decode helper -175/-180 -39,069 -44/-43/-44 -234
88f0482d1 Remove BytesView from ssz/deposit_contract -57/-37 -8,681 -20/-20/-20 +252
f262a469b sonatina f4b5b31 0/0 0 0/0/0 0
1b540e02e Validate ABI dynamic decode heads -8/-8 -1,730 0/0/0 -66

Regarding 88f0482 (Remove BytesView from ssz/deposit_contract), this is greatly improved by some fe/sonatina aggregate parameter improvements that I'll push up soon.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bcbc6be7e7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ingots/core/src/contracts.fe Outdated
@sbillig
sbillig requested a review from cburgdorf May 29, 2026 20:59
@sbillig

sbillig commented May 29, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac542f8e2a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ingots/core/src/abi.fe
Adapt eefa434 to the current ABI/SSZ shape by keeping only the applicable inline markers. The hot deposit path now uses Bytes directly instead of the old BytesView inputs, so carry the marker onto the current direct word-load path too. Also mark encode_alloc inline(always), which is the remaining outlined deposit event payload helper that improves bytecode/deploy without increasing deposit call gas.

Release differential_deposit after the change: Fe init/runtime 4633/4467, deploy 1715464, deposit calls 80772/66214/46560, total measured call gas 773751.

(cherry picked from commit eefa434)
@sbillig

sbillig commented May 30, 2026

Copy link
Copy Markdown
Collaborator Author

latest numbers, after cherry-picking the force-inline commit from #1458:

bytecode size
path         fe-O2        sol     sol-IR    fe vs sol-IR
------------------------------------------------------------
init          4633       4819       3082  +1551 (+50.3%)
runtime       4467       4445       2844  +1623 (+57.1%)

deployment gas
path        fe-O2        sol     sol-IR      fe vs sol-IR
-------------------------------------------------------------
deploy    1715464    1738847    1379411  +336053 (+24.4%)

call gas
path                            fe-O2        sol     sol-IR    fe vs sol-IR
-------------------------------------------------------------------------------
supportsInterface(erc165)       21606      21603      21600      +6 (+0.0%)
supportsInterface(deposit)      21634      21641      21600     +34 (+0.2%)
supportsInterface(unknown)      21621      21641      21600     +21 (+0.1%)
get_deposit_root(empty)        105057     117558     109178   -4121 (-3.8%)
get_deposit_count(empty)        23758      24510      24099    -341 (-1.4%)
deposit#0                       80772      84626      81089    -317 (-0.4%)
get_deposit_root(after#0)      105078     117570     109174   -4096 (-3.8%)
get_deposit_count(after#0)      23758      24510      24099    -341 (-1.4%)
deposit#1                       66214      70411      66629    -415 (-0.6%)
get_deposit_root(after#1)      105078     117570     109174   -4096 (-3.8%)
get_deposit_count(after#1)      23758      24510      24099    -341 (-1.4%)
deposit#2                       46560      50414      46877    -317 (-0.7%)
get_deposit_root(after#2)      105099     117582     109170   -4071 (-3.7%)
get_deposit_count(after#2)      23758      24510      24099    -341 (-1.4%)
TOTAL                          773751     838656     792487  -18736 (-2.4%)

@cburgdorf cburgdorf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Amazing work. Didn't find anything to worry about. Let's 🚢 it!

@sbillig
sbillig merged commit a818c1f into argotorg:master May 30, 2026
7 checks passed
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.

2 participants