Skip to content

feat!: emit anchor block timestamp for offchain messages#21414

Merged
mverzilli merged 5 commits intomerge-train/fairiesfrom
martin/offchain-emit-anchor-block-ts
Mar 13, 2026
Merged

feat!: emit anchor block timestamp for offchain messages#21414
mverzilli merged 5 commits intomerge-train/fairiesfrom
martin/offchain-emit-anchor-block-ts

Conversation

@mverzilli
Copy link
Contributor

@mverzilli mverzilli commented Mar 12, 2026

Changes offchain messages to track anchor block timestamp for lifecycle management instead of transaction TTL. This gives as an objective point in time to place the emission of offchain messages that is valid for both private and utility methods.

This is in preparation to make utility methods allow emission of offchain messages.

I'm adding a bunch of unit tests to make sure all proper code paths that need to produce offchain messages in Aztec.js and wallet code are exercised. Admittedly, the tests are not as I would want them:

  1. They rely too much on mocks.
  2. There's a lot of repetition.

I think this is a symptom of us missing some more abstractions in our JS contract interaction management code, which is out of scope of this PR.

Closes F-423

@mverzilli mverzilli requested review from benesjan and nchamo March 12, 2026 10:59
@mverzilli mverzilli requested a review from nventuro as a code owner March 12, 2026 10:59
@mverzilli mverzilli changed the title emit anchor block timestamp for offchain messages feat!: emit anchor block timestamp for offchain messages Mar 12, 2026
@benesjan
Copy link
Contributor

I see that you got the failure of e2e_offchain_payment.test.ts. I also got that today and it reproduced on merge-train/fairies so it's not specific to this PR.

BTW not sure why we are getting exit code 2. Was chatting about it with AI here

@mverzilli
Copy link
Contributor Author

I see that you got the failure of e2e_offchain_payment.test.ts. I also got that today and it reproduced on merge-train/fairies so it's not specific to this PR.

BTW not sure why we are getting exit code 2. Was chatting about it with AI here

Sth probably changed in how rollbacks are handled, I tried a fix some minutes ago but it seems it wasn't enough

@mverzilli mverzilli enabled auto-merge (squash) March 13, 2026 10:07
@mverzilli mverzilli merged commit 478dd33 into merge-train/fairies Mar 13, 2026
11 checks passed
@mverzilli mverzilli deleted the martin/offchain-emit-anchor-block-ts branch March 13, 2026 11:24
@AztecBot
Copy link
Collaborator

❌ Failed to cherry-pick to v4-next due to conflicts. (🤖) View backport run.

AztecBot pushed a commit that referenced this pull request Mar 13, 2026
AztecBot pushed a commit that referenced this pull request Mar 13, 2026
AztecBot added a commit that referenced this pull request Mar 13, 2026
Accepted new test cases from PR #21414 in batch_call.test.ts.
AztecBot pushed a commit that referenced this pull request Mar 13, 2026
AztecBot pushed a commit that referenced this pull request Mar 13, 2026
ludamad added a commit that referenced this pull request Mar 13, 2026
…1414) (#21483)

## Summary

Backport of #21414
to v4-next.

Changes offchain messages to track anchor block timestamp for lifecycle
management instead of transaction TTL. Adds `anchorBlockTimestamp` field
to `OffchainMessage` type and passes it through all code paths that
create offchain messages.

## Conflict Resolution

Rebased onto latest `backport-to-v4-next-staging` (which now includes
the offchain reception backport #20893). Only one conflict remained in
`batch_call.test.ts` — accepted the new test cases from the original PR.

## Verification

- yarn-project builds successfully
- All unit tests pass (`interaction_options.test.ts`,
`batch_call.test.ts`)

ClaudeBox log: https://claudebox.work/s/f59343e7af96e770?run=2
github-merge-queue bot pushed a commit that referenced this pull request Mar 13, 2026
BEGIN_COMMIT_OVERRIDE
feat!: emit anchor block timestamp for offchain messages (#21414)
fix(aztec-nr): warn on unknown note type id in
compute_note_hash_and_nullifier (#21491)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants