fix: support dynamic fields in event signatures - #1522
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 539cd703e2
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Build canonical Solidity type names for dynamic-array event fields while preserving correct topic and payload encoding. Diagnose unsupported indexed dynamic fields from resolved core types, including aliases, without rejecting shadowed user types. Surface generated TOPIC0 CTFE failures and semantic-constant reification failures instead of panicking, with focused UI and execution regressions.
|
@sbillig This one is ready for human review |
Motivation
Fe already provides Solidity ABI types such as
Bytes,DynString, andDynArray<T>, but they could not be used reliably as non-indexed event fields.For example:
This should produce the Solidity event signature:
ValuesChanged(uint256[])and ABI-encoded event data containing:
offset(0x20) | array length | array elementsBefore this change:
What changed
Add composable SolCompat implementations for dynamic and fixed-size arrays.
Generate event signature fragments through qualified SolCompat resolution:
Encode all non-empty event data as a tuple through encode_event_payload.
Detect unsupported indexed dynamic fields from their resolved semantic type.
Report generated TOPIC0 CTFE and semantic-constant reification failures as compiler diagnostics instead of panicking.
Result
Non-indexed dynamic event fields now compile and emit Solidity-compatible topics and data:
TOPIC0 = keccak256("ValuesChanged(uint256[])")
data = offset(0x20) | length | elements
Indexed dynamic fields remain unsupported for now, but produce a targeted diagnostic rather than failing indirectly.
Test coverage
Added regression coverage for: