@@ -25,7 +25,7 @@ import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
2525
2626contract RandomSampling is INamed , IVersioned , ContractStatus , IInitializable {
2727 string private constant _NAME = "RandomSampling " ;
28- string private constant _VERSION = "1.0.0 " ;
28+ string private constant _VERSION = "1.0.1-freeze " ;
2929 uint256 public constant SCALE18 = 1e18 ;
3030
3131 IdentityStorage public identityStorage;
@@ -139,45 +139,31 @@ contract RandomSampling is INamed, IVersioned, ContractStatus, IInitializable {
139139
140140 /**
141141 * @dev Creates a new challenge for the calling node in the current proofing period
142- * Caller must have a registered profile and cannot have an active unsolved challenge
143- * Generates a random knowledge collection and chunk to be proven
144- * Can only create one challenge per proofing period
142+ * V8 -> V10 freeze: this function is a silent no-op on this contract version.
143+ * Score accumulation has stopped on V8; nodes should migrate to V10.
144+ * Returns early without writing to RandomSamplingStorage so that running
145+ * proofing loops on V8 nodes do not fail their transactions.
145146 */
146147 function createChallenge ()
147148 external
148149 profileExists (identityStorage.getIdentityId (msg .sender ))
149150 nodeExistsInShardingTable (identityStorage.getIdentityId (msg .sender ))
150151 {
151- uint72 identityId = identityStorage.getIdentityId (msg .sender );
152-
153- RandomSamplingLib.Challenge memory nodeChallenge = randomSamplingStorage.getNodeChallenge (identityId);
154-
155- if (nodeChallenge.activeProofPeriodStartBlock == updateAndGetActiveProofPeriodStartBlock ()) {
156- // Revert if node has already solved the challenge for this period
157- if (nodeChallenge.solved) {
158- revert ("The challenge for this proof period has already been solved " );
159- }
160-
161- // Revert if a challenge for this node exists but has not been solved yet
162- if (nodeChallenge.knowledgeCollectionId != 0 ) {
163- revert ("An unsolved challenge already exists for this node in the current proof period " );
164- }
165- }
166-
167- // Generate a new challenge
168- RandomSamplingLib.Challenge memory challenge = _generateChallenge (msg .sender );
169-
170- // Store the new challenge in the storage contract
171- randomSamplingStorage.setNodeChallenge (identityId, challenge);
152+ // V8 -> V10 freeze: silent no-op. No new challenges are generated and
153+ // no writes are made to RandomSamplingStorage. Existing on-chain
154+ // challenges remain accessible via the storage contract for historical
155+ // inspection but cannot be progressed via this contract version.
172156 }
173157
174158 /**
175- * @dev Submits proof for an active challenge to earn score used for later reward calculation
176- * Validates the submitted chunk and merkle proof against the expected Merkle root
177- * On successful proof: marks challenge as solved, increments valid proofs count,
178- * calculates and adds node score, and updates epoch scoring data
179- * @param chunk The data chunk being proven (must match challenge requirements)
180- * @param merkleProof Array of hashes for Merkle proof verification
159+ * @dev Submits proof for an active challenge to earn score.
160+ * V8 -> V10 freeze: this function is a silent no-op on this contract
161+ * version. No score is added, no events are emitted, and no
162+ * RandomSamplingStorage state is mutated. Submission attempts succeed
163+ * (rather than revert) so that running V8 node proof loops do not
164+ * generate failed-tx noise during the migration window.
165+ * @param chunk Unused under freeze. Retained for ABI compatibility.
166+ * @param merkleProof Unused under freeze. Retained for ABI compatibility.
181167 */
182168 function submitProof (
183169 string memory chunk ,
@@ -187,56 +173,9 @@ contract RandomSampling is INamed, IVersioned, ContractStatus, IInitializable {
187173 profileExists (identityStorage.getIdentityId (msg .sender ))
188174 nodeExistsInShardingTable (identityStorage.getIdentityId (msg .sender ))
189175 {
190- // Get node identityId
191- uint72 identityId = identityStorage.getIdentityId (msg .sender );
192-
193- // Get node challenge
194- RandomSamplingLib.Challenge memory challenge = randomSamplingStorage.getNodeChallenge (identityId);
195-
196- if (challenge.solved) {
197- revert ("This challenge has already been solved " );
198- }
199-
200- uint256 activeProofPeriodStartBlock = updateAndGetActiveProofPeriodStartBlock ();
201-
202- // verify that the challengeId matches the current challenge
203- if (challenge.activeProofPeriodStartBlock != activeProofPeriodStartBlock) {
204- revert ("This challenge is no longer active " );
205- }
206-
207- // Construct the merkle root from chunk and merkleProof
208- bytes32 computedMerkleRoot = _computeMerkleRootFromProof (chunk, challenge.chunkId, merkleProof);
209-
210- // Get the expected merkle root for this challenge
211- bytes32 expectedMerkleRoot = knowledgeCollectionStorage.getLatestMerkleRoot (challenge.knowledgeCollectionId);
212-
213- // Verify the submitted root matches
214- if (computedMerkleRoot == expectedMerkleRoot) {
215- // Mark as correct submission and add points to the node
216- challenge.solved = true ;
217- randomSamplingStorage.setNodeChallenge (identityId, challenge);
218-
219- uint256 epoch = chronos.getCurrentEpoch ();
220- randomSamplingStorage.incrementEpochNodeValidProofsCount (epoch, identityId);
221- uint256 score18 = calculateNodeScore (identityId);
222- randomSamplingStorage.addToNodeEpochProofPeriodScore (
223- epoch,
224- activeProofPeriodStartBlock,
225- identityId,
226- score18
227- );
228- randomSamplingStorage.addToNodeEpochScore (epoch, identityId, score18);
229- randomSamplingStorage.addToAllNodesEpochScore (epoch, score18);
230-
231- // Calculate and add to nodeEpochScorePerStake
232- uint96 totalNodeStake = stakingStorage.getNodeStake (identityId);
233- if (totalNodeStake > 0 ) {
234- uint256 nodeScorePerStake36 = (score18 * SCALE18) / totalNodeStake;
235- randomSamplingStorage.addToNodeEpochScorePerStake (epoch, identityId, nodeScorePerStake36);
236- }
237- } else {
238- revert MerkleRootMismatchError (computedMerkleRoot, expectedMerkleRoot);
239- }
176+ // V8 -> V10 freeze: silent no-op.
177+ chunk;
178+ merkleProof;
240179 }
241180
242181 /**
0 commit comments