Skip to content

Conversation

@mkysel
Copy link
Collaborator

@mkysel mkysel commented Oct 7, 2025

Serialize submitter worker concurrency by adding db.AdvisoryLocker.LockSubmitterWorker and updating payerreport.SubmitterWorker.SubmitReports to require a per-report majority of (len(ActiveNodeIDs)/2)+1 attestations and mark reports Submitted

This change introduces a submitter-specific advisory lock and updates report submission to use a per-report majority threshold and explicit post-submission status updates. It adds a new SubmitterWorker advisory lock kind and corresponding locker methods, modifies the submitter worker to acquire the lock during processing, and updates submission logic to compute required attestations from ActiveNodeIDs and set the report status to Submitted after successful on-chain submission.

  • Add SubmitterWorker lock kind and implement db.AdvisoryLocker.LockSubmitterWorker and db.TransactionScopedAdvisoryLocker.LockSubmitterWorker in advisory_lock.go
  • Update payerreport.SubmitterWorker.SubmitReports to acquire a transaction-scoped advisory lock, evaluate per-report majority (len(ActiveNodeIDs)/2)+1, skip insufficiently attested reports, and call payerReportStore.SetReportSubmitted after successful submission in submitter.go
  • Add comments clarifying submission status handling in payer_report_manager_storer.go and generator.go

📍Where to Start

Start with the submission flow in payerreport.SubmitterWorker.SubmitReports in submitter.go, then review the advisory lock additions in advisory_lock.go to understand how the transaction-scoped lock is acquired and released.

Changes since #1219 opened

  • Replaced comment documentation for concurrency timing hazard [d78190f]

Macroscope summarized 3f84733.

@mkysel mkysel requested a review from a team as a code owner October 7, 2025 19:38
Comment on lines 130 to 131
// NOTE: a report can not be unsubmitted, but it can transition to submitted via the submitter
// once it transitions, this will re-generate a new report
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to be addressed in a 3rd PR.

Base automatically changed from mkysel/attestation-locks to main October 8, 2025 14:17
@mkysel mkysel force-pushed the mkysel/submitter-locks branch 2 times, most recently from c47c7ee to 12d5627 Compare October 8, 2025 14:45
@mkysel mkysel force-pushed the mkysel/submitter-locks branch from d78190f to 3f84733 Compare October 8, 2025 20:24
@mkysel mkysel merged commit 03885f4 into main Oct 8, 2025
11 checks passed
@mkysel mkysel deleted the mkysel/submitter-locks branch October 8, 2025 20:33
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