Skip to content

chore(marketplace): use canMarkProofAsMissing #1188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 3, 2025

Conversation

2-towns
Copy link
Contributor

@2-towns 2-towns commented Apr 4, 2025

This PR fixes #1153 by using a new function in the contract, canProofBeMarkedAsMissing.

Since this function is a view and does not transfer reward funds to the validator, we should no longer encounter the ERC20: transfer to the zero address error.

@2-towns 2-towns marked this pull request as ready for review April 7, 2025 08:29
@2-towns 2-towns force-pushed the chore/fix-mark-proof-as-missing branch from 9a0e19c to fe51f53 Compare April 15, 2025 15:13
Copy link
Contributor

@emizzle emizzle left a comment

Choose a reason for hiding this comment

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

Just a couple suggestions, but no blockers, so will approve now 👍

Comment on lines +208 to +209
test "can check whether a proof cannot be marked as missing before a proof is required":
let slotId = slotId(request, slotIndex)
Copy link
Contributor

Choose a reason for hiding this comment

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

Considering that each test starts off at the exact same point and assuming that the block hashes will always be deterministic, this test SHOULD work every time, but there may be a chance that there is a proof required as soon as the slot is filled.

check (await market.canProofBeMarkedAsMissing(slotId, missingPeriod)) == true
check (await market.canMarkProofAsMissing(slotId, missingPeriod)) == true

test "can check whether a proof cannot be marked as missing when the slot is free":
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should add a test that checks if a proof is required before the slot is filled (also free)

Copy link
Contributor Author

@2-towns 2-towns Apr 18, 2025

Choose a reason for hiding this comment

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

I'm not sure it's really useful, because if a slot isn't filled, we are not able to call waitUntilProofRequired which is almost the same situation as in the test "can check whether a proof cannot be marked as missing before a proof is required", no ?

@2-towns 2-towns force-pushed the chore/fix-mark-proof-as-missing branch from fe51f53 to 909d801 Compare April 18, 2025 08:28
@2-towns 2-towns mentioned this pull request May 27, 2025
@2-towns 2-towns force-pushed the chore/fix-mark-proof-as-missing branch from 909d801 to 3634d86 Compare June 2, 2025 09:49
@2-towns 2-towns force-pushed the chore/fix-mark-proof-as-missing branch from 3634d86 to f34a12a Compare June 2, 2025 18:14
@2-towns 2-towns changed the title chore(marketplace): use canProofBeMarkedAsMissing chore(marketplace): use canMarkProofAsMissing Jun 3, 2025
@2-towns 2-towns enabled auto-merge June 3, 2025 07:09
@2-towns 2-towns added this pull request to the merge queue Jun 3, 2025
Merged via the queue into master with commit 45ade0e Jun 3, 2025
18 checks passed
@2-towns 2-towns deleted the chore/fix-mark-proof-as-missing branch June 3, 2025 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validator not marking proofs as missing
3 participants