Skip to content

Support projected static composite event payloads#1873

Merged
Th0rgal merged 1 commit into
mainfrom
codex/event-static-composite-projections
May 14, 2026
Merged

Support projected static composite event payloads#1873
Th0rgal merged 1 commit into
mainfrom
codex/event-static-composite-projections

Conversation

@Th0rgal
Copy link
Copy Markdown
Member

@Th0rgal Th0rgal commented May 14, 2026

Summary

  • add Expr.paramDynamicStaticComposite for static composite fields projected from dynamically encoded tuple parameters
  • lower projected static composite event payloads by loading ABI words from the dynamic parameter data region
  • allow source-shaped emit "NoteLogged" [txn.withdrawal] in the macro path and add regression coverage

Verification

  • git diff --check
  • lake build Compiler.CompilationModelFeatureTest
  • python3 scripts/generate_print_axioms.py --check
  • python3 scripts/check_axioms.py
  • lake build Benchmark.Cases.UnlinkXyz.Pool.Compile in verity-benchmark against this local Verity checkout

Note

Medium Risk
Touches event ABI/log emission and macro translation logic; incorrect offsets/word loading could silently produce malformed event data/topics even though scope/shape validations and feature tests were updated.

Overview
Enables emit arguments to reference static composite fields projected out of a dynamically-encoded tuple parameter via a new Expr.paramDynamicStaticComposite projection.

Event lowering now accepts these projected sources for static composite event params and encodes them by loading ABI words from the dynamic parameter’s data region (applies to both unindexed payload storage and indexed topic hashing).

Macro translation/typing and validations were updated to recognize and typecheck these projections for emit, and feature tests + proof/analysis utilities were extended to cover the new Expr constructor.

Reviewed by Cursor Bugbot for commit 4b251a4. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 4b251a4. Configure here.

if !valueTypeUsesDynamicData fieldTy && !isSingleWordStaticValueType fieldTy then
some (root, fieldTy, wordOffset)
else
none
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing dynamic parent guard in projection function

Medium Severity

paramDynamicStaticCompositeProjection? doesn't verify valueTypeUsesDynamicData param.ty before returning some, unlike the analogous paramDynamicHeadProjection? and paramDynamicMemberProjection? which both include this guard. This means a multi-word static composite field projection from a statically-encoded parent parameter would incorrectly produce an Expr.paramDynamicStaticComposite node, which references a nonexistent {name}_data_offset variable, causing a confusing scope-validation error instead of falling through to the standard translation path.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4b251a4. Configure here.

@Th0rgal Th0rgal merged commit 1ae097e into main May 14, 2026
6 checks passed
@Th0rgal Th0rgal deleted the codex/event-static-composite-projections branch May 14, 2026 21:26
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