[WIP] feat: Audit missing item for node intergration GetJudgement / Broadcast / Collect Result#910
Open
[WIP] feat: Audit missing item for node intergration GetJudgement / Broadcast / Collect Result#910
Conversation
Implement the auditor work-report evaluation by re-executing the work-package through the existing PVM infrastructure and comparing the result against the claimed report. - Add BundleFetcher interface for node layer to provide bundle retrieval - Add StubBundleFetcher placeholder until CE protocol is integrated - Wire GetJudgement via WorkPackageController.Process() (shared path) - Compare work-reports using canonical WorkReportSerialization - Export ComputeErasureRoot for independent bundle verification Made-with: Cursor
66ab5c4 to
1bdaa4f
Compare
…ration guidance Made-with: Cursor
Contributor
Author
|
This PR listed the requirement of node side todo work for the auditing part, please help to check the discribtion and code. @Terryhung FYI. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Implement
GetJudgement— the function that lets an auditor verify whether a work-report is honest (GP §17.16–17.17).How it works:
The PVM execution pipeline is already in place (
WorkPackageController.Process()). The missing piece is the networking layer to actually fetch bundles from other nodes, so a stub is used for now. All places that need node-layer wiring are marked withNODE-TODO.What changed:
fetch_bundle.goBundleFetcherinterface + stub placeholderjudgement.goGetJudgementlogic (fetch → re-execute → compare)auditing.goNODE-TODOannotations with integration guidancework_package.goComputeErasureRootfor bundle verificationNode-Side TODOs
[bundle fetch]BundleFetcherinterface (replaceStubBundleFetcherinfetch_bundle.go). Fast path: request bundle from guarantor peers via CE usingReportGuarantee.Signatures[].ValidatorIndex. Verify withwork_package.ComputeErasureRoot(). Slow path: reconstruct from ≥342 erasure-coded chunks.[CE144 send]BroadcastAnnouncement()— send audit announcement + VRF evidence to all validators[CE144 recv/sync]UpdateAssignmentMapFromOtherNode()+SyncAssignmentMapFromOtherNodes()— background recv writes to buffer, sync drains buffer per tranche to count no-shows[CE145 send]BroadcastAuditReport()— send signed judgment (validity + signature) to all validators[CE145 recv/sync]UpdatePositiveJudgersFromOtherNode()+SyncPositiveJudgersFromOtherNodes()— same buffer/drain pattern, feeds into next tranche'sComputeAnForValidator()[tranche sync flow]SingleNodeAuditingAndPublish()Steps 9/16 for call sites.[timer]WaitNextTranche()— sleep untilslotStart + (tranche+1) * 8s(GP §17.7)Files changed:
judgement.goGetJudgementlogicfetch_bundle.goBundleFetcherinterface + stubauditing.goNODE-TODOcommentsiwork_package.goComputeErasureRootHow GetJudgement works
GetJudgement(auditReport)
│
├─ Step A: DefaultBundleFetcher.FetchBundle(report)
│ → fetch raw bundle bytes from guarantor (CE) or erasure reconstruction
│
├─ Step B: work_package.NewSharedController(bundleBytes, coreIndex).Process()
│ → decode bundle → ΨI (is-authorized) → ΨR per work-item → assemble WorkReport
│ → all PVM infrastructure already in place
│
└─ Step C: workReportsEqual(recomputed, original)
→ canonical serialization (WorkReportSerialization) + bytes.Equal
Node-Side Integration TODOs Details
Bundle Fetching
NODE-TODO [bundle fetch]StubBundleFetcher.FetchBundle()ReportGuarantee.Signatures[].ValidatorIndex), verify againstPackageSpec.ErasureRootusingwork_package.ComputeErasureRoot(). Fallback: reconstruct from ≥342 erasure-coded chunks.Audit Announcement (CE144)
NODE-TODO [CE144 send]BroadcastAnnouncement()ce144.go — HandleAuditAnnouncement_SendNODE-TODO [CE144 recv]UpdateAssignmentMapFromOtherNode()ce144.go — HandleAuditAnnouncement_RecvNODE-TODO [CE144 sync]SyncAssignmentMapFromOtherNodes()ce144.go — GetAllAuditAnnouncementsForHeaderJudgment Publication (CE145)
NODE-TODO [CE145 send]BroadcastAuditReport()ce145.go — HandleJudgmentAnnouncement_AuditorNODE-TODO [CE145 recv]UpdatePositiveJudgersFromOtherNode()ce145.go — HandleJudgmentAnnouncement_ValidatorNODE-TODO [CE145 sync]SyncPositiveJudgersFromOtherNodes()ce145.go — GetAllJudgmentsForWorkReportTimer
NODE-TODO [timer]WaitNextTranche()