Pre-audit hardening: settlement robustness, term bounds, pinned Kleros interface, docs #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/pre-audit-1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pre-audit hardening of the Market and supporting docs. No deploy, no tag. Base:
main@856b48c.Changes
try/catchwith a fixed 800k gas budget; on failure the payout stands andWorkHistoryRecordFailed(jobId)is emitted. Settlement entry points revert withInsufficientGas(retryable) instead of skipping the record when the caller supplies too little gas. Every settlement path, includingrule(), works with the recorder role revoked (tests).roundsis no longer reset; the cap (opening offer +maxCounters) counts every offer on the job, across cancellations and rejections. Withdrawing the final allowed offer escalates, as rejecting it already did.PostParamsgainsmaxTotal(max bounty + fee + customer deposit),arbitrator(must equal the current arbitrator) andvalidUntil(inclusive). New errorsTermsChanged,Expired.assignReviewerstays allowed while the job is Open, including after bids. Assignment and every reassignment emit the indexedReviewerAssigned(jobId, reviewer, fee, reassignment)event, now documented, so bidders and builders can track the reviewer.src/interfaces/kleros/IArbitrableV2.solandIArbitratorV2.solare byte-identical copies of@kleros/kleros-v2-contracts2.0.0-rc.2, commit9fa3677c7a837d0d9d579c06eb5c9f224b96f14f(header notes the source and sha256).DisputeRequestis now(arbitrator, arbitratorDisputeID, templateId);DisputeCreated(jobId, disputeId, cost)links disputes to jobs.disputeTemplateUristays as an informational setting.maxCounters,DisputeOptionsSetandsubmitDeliverydocs; removed unusedNotArbitrator.NotReviewer,ReviewWindowClosedandInsufficientGasare raised only in the external libraries; each now has a single declaration in TaskulerMarket (so it is in the Market ABI for revert decoding), referenced from ReviewLib / PayoutLib.invariant_NoStuckEscrownow runs on every call: per token,jobHeldmust equal exactly what live jobs (by status) and active bids hold, the balance must cover escrow plus claims, and no arbitration prepay may remain.docs/KNOWN-ISSUES.mdanddocs/THREAT-MODEL.md; refresheddocs/AUDIT-SCOPE.md(files, line counts, base commit); SECURITY-NOTES and OPEN-QUESTIONS updated.ABI changes (frontend)
postJob(PostParams)/postProjectJob(PostParams): tuple addsuint256 maxTotal, address arbitrator, uint64 validUntilat the end (selectors change).DisputeRequest(address indexed _arbitrator, uint256 indexed _arbitratorDisputeID, uint256 _templateId)(was 5 fields).WorkHistoryRecordFailed(uint256 indexed jobId).TermsChanged(),Expired(),InsufficientGas(); removedNotArbitrator().SettlementExhaustedeven after a cancel or reject.Checks
forge test: 211 passed, 0 failed.TaskulerMarketruntime size 22,966 B (limit 24,576).