Skip to content

Feat/std calldata array view - #1703

Open
cburgdorf wants to merge 2 commits into
masterfrom
feat/std-calldata-array-view
Open

cburgdorf wants to merge 2 commits into
masterfrom
feat/std-calldata-array-view

Conversation

@cburgdorf

Copy link
Copy Markdown
Collaborator

Added std::abi::ArrayView, a lazy view of a Solidity ABI T[] over calldata or any other ByteInput, created with CallData::array_view or decode_array_view_at. It validates offsets and lengths like a Solidity T[] calldata parameter and decodes elements one at a time with get, with zero-copy bytes_at/string_at and nested array_at accessors, so raw-selector recv arms can read large arrays without decoding them into memory. For hand-written decoders, heads_pos, head_word and unchecked_element_pos expose the raw element heads and tail positions without validating element tails.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-02T18:04:39.358012Z cb83f00 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 02cb8d67e4

ℹ️ 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/std/src/abi/array_view.fe Outdated
@cburgdorf
cburgdorf force-pushed the feat/std-calldata-array-view branch from 02cb8d6 to 1fe7c4e Compare October 2, 2026 15:38
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@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: 1fe7c4eb27

ℹ️ 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/std/src/abi/array_view.fe Outdated
@cburgdorf
cburgdorf force-pushed the feat/std-calldata-array-view branch from 1fe7c4e to 662a593 Compare October 2, 2026 17:04
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

`std::abi::ArrayView<I, T>` views a Solidity ABI `T[]` inside any
`ByteInput` without copying it to memory. Creating the view (via
`CallData::array_view` or `decode_array_view_at`) performs the checks
solc applies to a `T[] calldata` parameter: head word, length word and
all element heads within the input, overflow-safe for any word. `get`
decodes a single element with the regular Solidity decoder (dirty-bit
validation, Panic(0x32) on out-of-range index), `bytes_at`/`string_at`
return zero-copy views of dynamic elements, `array_at` returns a nested
view, and `element_pos` exposes the validated position of an element
for struct field access.
Hand-written decoders that mirror assembly (e.g. Seaport's conduit
reading `heads + calldataload(heads + i * 32)`) need the element heads
position and unchecked tail positions. Add `ArrayView::heads_pos`,
`head_word` and `unchecked_element_pos`, which skip the tail validation
of `element_pos` and are documented as only safe when the caller
validates the element itself or reads past the end as zeros.
@cburgdorf
cburgdorf force-pushed the feat/std-calldata-array-view branch from 662a593 to cb83f00 Compare October 2, 2026 18:00
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@cburgdorf
cburgdorf requested a review from sbillig October 3, 2026 07:43

This branch has not been deployed

No deployments
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.

1 participant