Skip to content

Fix Aptos account transaction limit windows#449

Merged
cawthorne merged 3 commits intodevelopfrom
feature/aptos-account-transactions-limit-window
Apr 30, 2026
Merged

Fix Aptos account transaction limit windows#449
cawthorne merged 3 commits intodevelopfrom
feature/aptos-account-transactions-limit-window

Conversation

@cawthorne
Copy link
Copy Markdown
Collaborator

@cawthorne cawthorne commented Apr 30, 2026

Summary

  • resolve AccountTransactions(start=nil, limit=N) into an explicit bounded window before calling the Aptos SDK
  • return an empty result for zero-sequence accounts instead of issuing an invalid SDK request
  • keep explicit-start account transaction requests unchanged
  • lower expected empty-account transaction logs to debug for new/young transmitter accounts
  • add relayer unit tests for young accounts, normal windows, zero sequence number, and explicit-start passthrough

Root Cause

The Chainlink merge queue Aptos CRE test started requesting recent transmitter account transactions with start=nil, limit=10. That call shape was introduced by smartcontractkit/capabilities#574, specifically https://github.com/smartcontractkit/capabilities/commit/133e87d6fa49e380db7a4648587ef4dbd314e6b7, when the Aptos tx-search phase-1 probe changed from start=nil, limit=nil to a bounded latest-page request.

For limit-only account transaction requests, the Aptos SDK queries the latest transactions and then computes a previous-page cursor from the first returned transaction sequence number. For new accounts with fewer transactions than the requested limit, the earliest returned sequence can be 0, so the SDK computes 0 - 1 and issues a REST request with start=18446744073709551615. The observed CI failure was the Aptos REST API rejecting that invalid cursor.

Fix

This PR handles the limit-only request shape in the relayer by resolving it into a safe explicit latest transaction window before calling the Aptos SDK. For accounts with sequence number 0, the relayer returns an empty transaction list directly. Requests that already provide an explicit start are still passed through unchanged.

Testing

  • go test ./relayer -count=1

Failing runs / consumers:

Aptos SDK issue filed:
aptos-labs/aptos-go-sdk#213

@cawthorne cawthorne marked this pull request as ready for review April 30, 2026 12:06
@cawthorne cawthorne requested review from a team as code owners April 30, 2026 12:06
Comment thread relayer/aptos_service.go Outdated
@cawthorne cawthorne marked this pull request as draft April 30, 2026 12:11
@cawthorne cawthorne marked this pull request as ready for review April 30, 2026 12:17
Comment thread relayer/aptos_service.go
@cawthorne cawthorne merged commit 295a7f9 into develop Apr 30, 2026
39 of 43 checks passed
@cawthorne cawthorne deleted the feature/aptos-account-transactions-limit-window branch April 30, 2026 17:56
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