Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

fix(validator): check if work info returned by contract is zero#581

Merged
JannikSt merged 3 commits into
developfrom
fix/invalid-workunit-submission
Jun 24, 2025
Merged

fix(validator): check if work info returned by contract is zero#581
JannikSt merged 3 commits into
developfrom
fix/invalid-workunit-submission

Conversation

@JannikSt
Copy link
Copy Markdown
Member

No description provided.

@JannikSt JannikSt requested a review from Copilot June 24, 2025 06:31

This comment was marked as outdated.

@JannikSt JannikSt requested a review from Copilot June 24, 2025 06:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the work info verification by ensuring that work info returned by the contract is valid (i.e., not zero) and updates test cases accordingly.

  • Updates tests to include a non-zero work_units value and a new NODE_ADDRESS for better simulation
  • Enhances the work info retrieval logic with validity checks and improved error handling
  • Introduces the is_valid() method for WorkInfo in the shared contracts module

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
crates/validator/src/validators/synthetic_data/tests/mod.rs Updates test cases with non-zero work_units and NODE_ADDRESS modifications
crates/validator/src/validators/synthetic_data/mod.rs Adds validity checks using is_valid(), and includes additional debug logging
crates/shared/src/web3/contracts/implementations/work_validators/synthetic_data_validator.rs Defines the is_valid() method to verify work info integrity

Comment thread crates/validator/src/validators/synthetic_data/mod.rs
Comment thread crates/validator/src/validators/synthetic_data/mod.rs Outdated
@JannikSt JannikSt force-pushed the fix/invalid-workunit-submission branch from 81ff1f3 to aeff76d Compare June 24, 2025 07:09
@JannikSt JannikSt merged commit d4f8664 into develop Jun 24, 2025
1 check passed
@JannikSt JannikSt deleted the fix/invalid-workunit-submission branch June 25, 2025 12:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants