sync: on-chain pitches, proofs, and AuctionAccepted event#2
Merged
Conversation
Brings the reference implementation in line with the private repo's v2 contract changes (PR #83 there). Contract changes: - New events: PitchSubmitted(taskId, worker, pitchHash), ProofSubmitted(taskId, worker, proofHash, proofType, metricValue), AuctionAccepted(taskId, worker, acceptedPrice). The auction event coexists with the legacy BidSubmitted + TaskWorkerSelected pair from acceptAuction so existing indexers keep working. - New functions: submitPitch(taskId, pitchHash) and submitProof(taskId, proofHash, proofType, metricValue) anchor a domain-separated content commitment on-chain. Both follow the existing PGTR forwarder pattern (onlyTrustedForwarder + _effectiveSender). - submitPitch enforces pitchDeadline as well as expiryTime. - Storage: two new mappings appended (taskPitchHashes at slot 10, taskProofHashes at slot 11). __gap shrunk from 48 to 46. The committed storage-layout.before.json and storage-layout.after.json + the new scripts/verify-storage-layout.ts make accidental reordering a CI failure for future upgrades. Other: - AddForwarder.s.sol and DeployForwarder.s.sol added (operational scripts that already existed in the private tree). - ABI artifact regenerated: 91 entries, including the three new events. Forge test: 149 passing. Storage-layout verifier: 11 existing slots unchanged, gap 48 → 46.
Brings the ERC-8195 draft in line with the v2 reference implementation. - ITMP interface gains submitPitch, submitProof, acceptAuction functions and PitchSubmitted, ProofSubmitted, AuctionAccepted events. - Pitch state machine no longer says "off-chain"; pitch hashes are anchored on-chain via submitPitch and indexed via PitchSubmitted. - Benchmark mode documents submitProof as the canonical on-chain anchor path. Validation Registry acceptance remains supported. - Auction mode adds the acceptAuction* transition (Dutch / reverse-Dutch); AuctionAccepted event documented as the primary signal, with the legacy BidSubmitted + TaskWorkerSelected pair marked OPTIONAL for backward compatibility. - Part IV renamed "Deliverable Anchoring" -> "Content Anchoring"; generalized to cover all three anchor types. Pitch and proof hashes MUST be domain-separated as keccak256(abi.encode(taskId, worker, content)) — rationale added. - Part VIII indexer requirements extended to require PitchSubmitted, ProofSubmitted, and AuctionAccepted with their full argument lists. - Appendix A.3 adds a Proof Payload schema mirroring the existing Pitch Payload. - Reference Implementation paragraph updated to mention the new test coverage and storage-layout verifier script.
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
Sync from the private taskmarket repo. Brings the reference implementation in line with PR daydreamsai/taskmarket#83.
The on-chain testnet implementation (proxy
0x436C05C6059D6974608c6123E98B94cC388949a6on Base Sepolia) was upgraded earlier today to this exact contract; the deployed implementation is0x738088D288B2D20C528bB2123a5BA4aC1F002AeD.Contract changes
Three new events extend the surface to cover flows that were previously off-chain:
PitchSubmitted(bytes32 indexed taskId, address indexed worker, bytes32 pitchHash)ProofSubmitted(bytes32 indexed taskId, address indexed worker, bytes32 proofHash, bytes32 proofType, uint256 metricValue)AuctionAccepted(bytes32 indexed taskId, address indexed worker, uint256 acceptedPrice)— emitted alongside the legacyBidSubmitted + TaskWorkerSelectedpair fromacceptAuctionso existing indexers keep workingTwo new functions anchor content hashes on-chain. The pitch text and proof data themselves stay off-chain; the hash is a tamper-evident commitment that third parties can verify against operator-served content:
submitPitch(bytes32 taskId, bytes32 pitchHash) external onlyTrustedForwarder— pitch-mode tasks, status=Open, beforepitchDeadlinesubmitProof(bytes32 taskId, bytes32 proofHash, bytes32 proofType, uint256 metricValue) external onlyTrustedForwarder— benchmark modeBoth use
_effectiveSender()to recover the worker (the existing PGTR pattern). Hash construction is domain-separated: backends are expected to computekeccak256(abi.encode(taskId, worker, content))so the same content can't be replayed across tasks or workers.Storage layout (UUPS-safe, append-only)
taskPitchHashes(slot 10),taskProofHashes(slot 11)__gapshrunk from 48 → 46storage-layout.before.jsonandstorage-layout.after.jsoncommittedscripts/verify-storage-layout.tsdiffs the two and asserts every existing non-gap slot is unchanged. Run withnpx tsx scripts/verify-storage-layout.tstest_StorageGapIs46Slotsreads gap slots directly viavm.loadOther
script/AddForwarder.s.solandscript/DeployForwarder.s.soladded (operational scripts that already lived in the private tree)abi/TaskMarket.jsonregenerated fromforge build— 91 ABI entries, including the three new eventsVerification
forge build— cleanforge test— 149 passingnpx tsx scripts/verify-storage-layout.ts— 11 existing slots unchanged, gap 48 → 46, 2 new slots appendedDeploy ordering (testnet rehearsal already complete)
For anyone tracking the deployed contract: the upgrade was performed earlier via
Upgrade.s.solagainst the existing Base Sepolia proxy. Proxy address unchanged. The first mainnet deploy (whenever that happens) will be a freshDeploy.s.solwith v2 baked in — no upgrade is needed because mainnet has not been launched.