Rework Submitter Concurrency #1219
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Serialize submitter worker concurrency by adding
db.AdvisoryLocker.LockSubmitterWorkerand updatingpayerreport.SubmitterWorker.SubmitReportsto require a per-report majority of(len(ActiveNodeIDs)/2)+1attestations and mark reports SubmittedThis 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
SubmitterWorkeradvisory lock kind and corresponding locker methods, modifies the submitter worker to acquire the lock during processing, and updates submission logic to compute required attestations fromActiveNodeIDsand set the report status to Submitted after successful on-chain submission.SubmitterWorkerlock kind and implementdb.AdvisoryLocker.LockSubmitterWorkeranddb.TransactionScopedAdvisoryLocker.LockSubmitterWorkerin advisory_lock.gopayerreport.SubmitterWorker.SubmitReportsto acquire a transaction-scoped advisory lock, evaluate per-report majority(len(ActiveNodeIDs)/2)+1, skip insufficiently attested reports, and callpayerReportStore.SetReportSubmittedafter successful submission in submitter.go📍Where to Start
Start with the submission flow in
payerreport.SubmitterWorker.SubmitReportsin 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
Macroscope summarized 3f84733.