Skip to content

Conversation

@mkysel
Copy link
Collaborator

@mkysel mkysel commented Oct 8, 2025

Sort active node IDs in pkg/payerreport/generator.go::extractActiveNodeIDs to make ordering predictable and return the last submission error from pkg/payerreport/workers/submitter.go::SubmitterWorker.SubmitReports to fix the broken test

This change introduces deterministic ordering for active node IDs and updates report submission error handling to return the last encountered error after processing all reports.

  • Update extractActiveNodeIDs to sort collected node IDs in ascending order after population in generator.go
  • Modify SubmitterWorker.SubmitReports to track and return the most recent submission error instead of always returning nil in submitter.go

📍Where to Start

Start with extractActiveNodeIDs in generator.go, then review SubmitterWorker.SubmitReports in submitter.go.


Macroscope summarized 703b30f.

@mkysel mkysel requested a review from a team as a code owner October 8, 2025 20:45
@graphite-app
Copy link

graphite-app bot commented Oct 8, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • Queue - adds this PR to the back of the merge queue
  • Hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@mkysel
Copy link
Collaborator Author

mkysel commented Oct 8, 2025

Before sorting:

2025-10-08T16:41:20.903-0400    DEBUG   api     api/server.go:225       closed
--- FAIL: TestCanGenerateAndAttestReport (4.60s)
    store.go:50: creating database test_setupmultinodetest_fqqnzsrdbjnx ...
    store.go:50: creating database test_setupmultinodetest_kxviqfmewiqj ...
    integration_test.go:508: 
                Error Trace:    /Users/martinkysel/work/xmtpd/pkg/payerreport/workers/integration_test.go:508
                Error:          Received unexpected error:
                                InsufficientSignatures(uint8 validSignatureCount, uint8 requiredSignatureCount)
                Test:           TestCanGenerateAndAttestReport
FAIL
FAIL    github.com/xmtp/xmtpd/pkg/payerreport/workers   5.403s

After sorting:

go_test_clean ./pkg/payerreport/workers/... -run TestCanGenerateAndAttestReport -failfast -count 1000 -cpu 1
<no failure>

@mkysel mkysel merged commit be9f307 into main Oct 8, 2025
11 checks passed
@mkysel mkysel deleted the mkysel/fix-activeNode-sorting branch October 8, 2025 20:52
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.

3 participants