Skip to content
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

Add proof deadline to /Submit GRPC #410

Merged
merged 2 commits into from
Sep 29, 2023
Merged

Conversation

poszu
Copy link
Contributor

@poszu poszu commented Sep 27, 2023

Closes #351

Added a new field deadline in the /Submit GRPC method. It allows the node to tell when they need the proof. If the field is provided, the poet will check if the round ends within the requested time and it will reject the registration with Failed Precondition status otherwise. If the field is empty, the check is disabled (it works as before).

@poszu poszu requested a review from fasmat September 27, 2023 10:41
@codecov
Copy link

codecov bot commented Sep 27, 2023

Codecov Report

Merging #410 (060bdcb) into develop (01820bd) will increase coverage by 0.2%.
The diff coverage is 100.0%.

@@            Coverage Diff            @@
##           develop    #410     +/-   ##
=========================================
+ Coverage     74.9%   75.1%   +0.2%     
=========================================
  Files           23      23             
  Lines         1892    1909     +17     
=========================================
+ Hits          1418    1435     +17     
  Misses         357     357             
  Partials       117     117             
Files Coverage Δ
registration/registration.go 76.1% <100.0%> (+1.1%) ⬆️
rpc/rpcserver.go 88.8% <100.0%> (+0.8%) ⬆️

@poszu poszu added this pull request to the merge queue Sep 29, 2023
Merged via the queue into develop with commit bc84a36 Sep 29, 2023
11 checks passed
bors bot pushed a commit to spacemeshos/go-spacemesh that referenced this pull request Oct 4, 2023
## Motivation
Avoid slipping into the next poet round when submitting a challenge late. It's a prerequisite to support phased poets. It will let the nodes avoid wrongly registering in poets with earlier phases (their round has already started). 

Depends on spacemeshos/poet#410

## Changes
Pass the required time (deadline) by which the poet proof must be ready. If poet decides that the current open round ends after that time - it will reject challenge registration.

## Test Plan
- existing tests should pass
- added poet client unit test to see if the error is properly detected and handled
- the functionality itself is tested in poet tests
bors bot pushed a commit to spacemeshos/go-spacemesh that referenced this pull request Oct 5, 2023
## Motivation
Avoid slipping into the next poet round when submitting a challenge late. It's a prerequisite to support phased poets. It will let the nodes avoid wrongly registering in poets with earlier phases (their round has already started). 

Depends on spacemeshos/poet#410

## Changes
Pass the required time (deadline) by which the poet proof must be ready. If poet decides that the current open round ends after that time - it will reject challenge registration.

## Test Plan
- existing tests should pass
- added poet client unit test to see if the error is properly detected and handled
- the functionality itself is tested in poet tests
@fasmat fasmat deleted the 351-avoid-registration-slip branch May 14, 2024 08:31
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.

Provide a mechanism to avoid slipping round registration to the next round
2 participants