Skip to content

Return block timestamp in EVM WriteReportReply - #916

Merged
Krish-vemula merged 8 commits into
mainfrom
feat/evm-write-report-block-timestamp
Nov 21, 2026
Merged

Krish-vemula merged 8 commits into
mainfrom
feat/evm-write-report-block-timestamp

Conversation

@Krish-vemula

@Krish-vemula Krish-vemula commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What

EVM WriteReport now fills in WriteReportReply.block_timestamp (microseconds), matching Aptos and Stellar, for SLO tx-latency tracking.

How

  • All reply paths (prior success, invalid receiver, failed with enough gas, new attempt success/revert) go through replyFromReceipt, so the change is made once there.
  • Receipts and logs carry no timestamp. When the feature is active, we call HeaderByNumber(receipt.BlockNumber) (with WithQuickRetry) and return header.Timestamp * 1_000_000.
  • The feature is gated by FeatureEVMWriteReportBlockTimestampActivePeriod, checked against the execution timestamp. This is the same pattern as the L1 fee flag and the Aptos block timestamp flag.

Behaviour

  • Flag off (default): no extra RPC call and the field is not set, so behaviour is unchanged.
  • Header lookup uses the same WithQuickRetry as the receipt/fee lookups. If it still fails, or the receipt has no block number, the reply fails with an error, so nodes never reply without the field (keeps the remote F+1 identical-response quorum intact).
  • Header hash ≠ receipt block hash (RPC lag or reorg): retried; if it never matches (receipt's block reorged out), the reply fails rather than returning another block's timestamp.
  • Revert paths keep the existing revertReplyBuildError wrapping, so the revert reason is still surfaced.

Testing

  • New TestReplyFromReceiptBlockTimestamp (table-driven) covers: flag on/off, success and revert, header error, empty header, zero timestamp, missing block number, hash mismatch.
  • TestReplyFromReceiptBlockTimestamp_NilLimiterOmitsTimestamp
  • New TestWriteReportBlockTimestamp_FeatureFlagWiring runs the full EVM.WriteReport flow with the limiter built from cresettings defaults.
  • go test ./... -race passes and golangci-lint reports 0 issues (run against local chainlink-common).

Dependencies

  • Depends on chainlink-common #2554. Bump chainlink-common in chain_capabilities/evm/go.mod once it merges.

Rollout

Set FeatureEVMWriteReportBlockTimestampActivePeriod in CRE settings for each environment to enable.

@Krish-vemula
Krish-vemula force-pushed the feat/evm-write-report-block-timestamp branch from 28323b7 to 23e2dc0 Compare November 18, 2026 22:48
@Krish-vemula
Krish-vemula marked this pull request as ready for review November 18, 2026 22:54
@Krish-vemula
Krish-vemula requested review from a team as code owners November 18, 2026 22:54
amit-momin
amit-momin previously approved these changes Nov 20, 2026
jmank88
jmank88 previously approved these changes Nov 20, 2026
@Krish-vemula
Krish-vemula added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2026
@Krish-vemula
Krish-vemula added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2026
@Krish-vemula
Krish-vemula dismissed stale reviews from jmank88 and amit-momin via 815d619 November 21, 2026 00:05
@Krish-vemula
Krish-vemula added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 38eacf1 Nov 21, 2026
18 checks passed
@Krish-vemula
Krish-vemula deleted the feat/evm-write-report-block-timestamp branch November 21, 2026 03:37
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.

4 participants