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

[Merged by Bors] - Give NiPoSTBuilder more time to create the PoST #4893

Closed
wants to merge 14 commits into from

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Aug 22, 2023

Motivation

Closes #4797

With this change ATXs can now be published until the end of their PublishEpoch (instead of until the start of the next PoET round). On mainnet this means a node as 4 additional days of time to generate a PoST proof and publish an ATX.

It is still required to publishing within the window between the end of one PoET round and the start of the next one to not miss any rewards. This change only allows nodes that weren't able to register for the next PoET round to still publish an ATX within the 4 days (on mainnet) between the end of the CycleGap and the end of the PublishEpoch.

Changes

This PR adapts deadlines to the following:

  • Phase 0 (submitting challenge to PoET): deadline poetRoundStart - unchanged
  • Phase 1 (fetching proof from PoET): before the deadline was the end of the round it submitted to + a grace period of 1 hour; this effectively means there is only a 1 hour window to fetch the proof from PoET before the node gives up. Now instead it will fetch until the end of the PublishEpoch. This means that if the node doesn't manage to publish its ATX before next PoET round starts, it won't be able to publish one next epoch (unchanged) but will still try to publish one for the current epoch.
  • Phase 2 (publishing the ATX): before deadline was nextPoetRoundStart, with the intention to publish the ATX and have enough time left to register for the next PoET round. This is a very short window (just the time between the end of one PoET round and the start of the next one). If the node doesn't manage to generate a PoST proof within that time it gives up on publishing an ATX and misses out on rewards it could get by instead giving up on registering on the next PoET round. This deadline was also extended to the end of the PublishEpoch.

Test Plan

existing tests pass or have been adapted

TODO

  • Explain motivation or link existing issue(s)
  • Test changes and document test plan
  • Update documentation as needed

DevOps Notes

  • This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
  • This PR does not affect public APIs
  • This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
  • This PR does not make changes to log messages (which monitoring infrastructure may rely on)

@fasmat fasmat self-assigned this Aug 22, 2023
@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Merging #4893 (a0861e4) into develop (4bd907c) will decrease coverage by 0.1%.
The diff coverage is 88.0%.

@@            Coverage Diff            @@
##           develop   #4893     +/-   ##
=========================================
- Coverage     76.8%   76.7%   -0.1%     
=========================================
  Files          256     256             
  Lines        29632   29635      +3     
=========================================
- Hits         22759   22755      -4     
- Misses        5402    5408      +6     
- Partials      1471    1472      +1     
Files Changed Coverage Δ
activation/activation.go 75.4% <50.0%> (-0.6%) ⬇️
activation/nipost.go 86.0% <100.0%> (+1.7%) ⬆️

... and 4 files with indirect coverage changes

@fasmat fasmat changed the title Give NiPoSTBuilder more time to for phase 2 Give NiPoSTBuilder more time for phase 2 Aug 22, 2023
@fasmat
Copy link
Member Author

fasmat commented Aug 22, 2023

bors try

bors bot added a commit that referenced this pull request Aug 22, 2023
activation/nipost.go Outdated Show resolved Hide resolved
@bors
Copy link

bors bot commented Aug 22, 2023

try

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@fasmat
Copy link
Member Author

fasmat commented Aug 22, 2023

bors try

bors bot added a commit that referenced this pull request Aug 22, 2023
@fasmat fasmat changed the title Give NiPoSTBuilder more time for phase 2 Give NiPoSTBuilder more time to create the PoST Aug 22, 2023
@bors
Copy link

bors bot commented Aug 22, 2023

try

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

activation/nipost.go Outdated Show resolved Hide resolved
@poszu poszu self-requested a review August 23, 2023 07:46
@fasmat
Copy link
Member Author

fasmat commented Aug 23, 2023

bors merge

bors bot pushed a commit that referenced this pull request Aug 23, 2023
## Motivation
Closes #4797

## Changes
Phase 2 of the BuildNiPoST step in publishing an ATX is restricted with a deadline of `nextPoetRoundStart`. This deadline doesn't need to be this strict. This PR adapts deadlines to the following:

- Phase 0 (submitting challenge to PoET): timeout `poetRoundStart` - unchanged
- Phase 1 (fetching proof from PoET): before the deadline was the end of the round round it submitted to + a grace period of 1 hour; this effectively means there is only a 1 hour window to fetch the proof from PoET before the node gives up. Now instead it will fetch with a deadline until the end of the next PoET round. This means that if the node doesn't manage to publish its ATX before next PoET round starts, it won't be able to publish one next epoch (unchanged) but will still try to publish one for the current epoch, even if its late. It will still miss at most 1 epoch (when its late).
- Phase 2 (publishing the ATX): before timeout was `nextPoetRoundStart`, with the intention to publish the ATX and have enough time left to register for the next PoET round. This is a very short window (just the time between the end of one PoET round and the start of the next one). If the node doesn't manage to generate a PoST proof within that time it gives up on publishing an ATX and misses out on rewards it could get by instead giving up on registering on the next PoET round.

This gives the last phase ~ 2 weeks of time instead of just a few hours, but if the node takes longer than `nextPoetRoundStart` it will not be able to submit a challenge for the next PoET round in time. This is because the new challenge contains the ID of the ATX that is being built right now. In that case the node will skip publishing an ATX for one epoch.

## Test Plan
existing tests pass or have been adapted

## TODO
<!-- This section should be removed when all items are complete -->
- [x] Explain motivation or link existing issue(s)
- [x] Test changes and document test plan
- [x] Update documentation as needed

## DevOps Notes
<!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases -->
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
@bors
Copy link

bors bot commented Aug 23, 2023

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Aug 23, 2023
## Motivation
Closes #4797

## Changes
Phase 2 of the BuildNiPoST step in publishing an ATX is restricted with a deadline of `nextPoetRoundStart`. This deadline doesn't need to be this strict. This PR adapts deadlines to the following:

- Phase 0 (submitting challenge to PoET): timeout `poetRoundStart` - unchanged
- Phase 1 (fetching proof from PoET): before the deadline was the end of the round round it submitted to + a grace period of 1 hour; this effectively means there is only a 1 hour window to fetch the proof from PoET before the node gives up. Now instead it will fetch with a deadline until the end of the next PoET round. This means that if the node doesn't manage to publish its ATX before next PoET round starts, it won't be able to publish one next epoch (unchanged) but will still try to publish one for the current epoch, even if its late. It will still miss at most 1 epoch (when its late).
- Phase 2 (publishing the ATX): before timeout was `nextPoetRoundStart`, with the intention to publish the ATX and have enough time left to register for the next PoET round. This is a very short window (just the time between the end of one PoET round and the start of the next one). If the node doesn't manage to generate a PoST proof within that time it gives up on publishing an ATX and misses out on rewards it could get by instead giving up on registering on the next PoET round.

This gives the last phase ~ 2 weeks of time instead of just a few hours, but if the node takes longer than `nextPoetRoundStart` it will not be able to submit a challenge for the next PoET round in time. This is because the new challenge contains the ID of the ATX that is being built right now. In that case the node will skip publishing an ATX for one epoch.

## Test Plan
existing tests pass or have been adapted

## TODO
<!-- This section should be removed when all items are complete -->
- [x] Explain motivation or link existing issue(s)
- [x] Test changes and document test plan
- [x] Update documentation as needed

## DevOps Notes
<!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases -->
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
@dshulyak
Copy link
Contributor

bors cancel

@bors
Copy link

bors bot commented Aug 23, 2023

Canceled.

@fasmat fasmat force-pushed the 4797-fix-atx-timeouts-in-builder branch from 2a472ad to 4665109 Compare August 23, 2023 12:04
@fasmat
Copy link
Member Author

fasmat commented Aug 23, 2023

bors try

bors bot added a commit that referenced this pull request Aug 23, 2023
@fasmat fasmat requested a review from poszu August 23, 2023 12:56
@bors
Copy link

bors bot commented Aug 23, 2023

try

Build failed:

activation/nipost.go Outdated Show resolved Hide resolved
@fasmat
Copy link
Member Author

fasmat commented Aug 23, 2023

bors merge

bors bot pushed a commit that referenced this pull request Aug 23, 2023
## Motivation
Closes #4797

With this change ATXs can now be published until the end of their `PublishEpoch` (instead of until the start of the next PoET round). On mainnet this means a node as 4 additional days of time to generate a PoST proof and publish an ATX.

It is still required to publishing within the window between the end of one PoET round and the start of the next one to not miss any rewards. This change only allows nodes that weren't able to register for the next PoET round to still publish an ATX within the 4 days (on mainnet) between the end of the `CycleGap` and the end of the `PublishEpoch`.

## Changes
This PR adapts deadlines to the following:

- Phase 0 (submitting challenge to PoET): deadline `poetRoundStart` - unchanged
- Phase 1 (fetching proof from PoET): before the deadline was the end of the round it submitted to + a grace period of 1 hour; this effectively means there is only a 1 hour window to fetch the proof from PoET before the node gives up. Now instead it will fetch until the end of the `PublishEpoch`. This means that if the node doesn't manage to publish its ATX before next PoET round starts, it won't be able to publish one next epoch (unchanged) but will still try to publish one for the current epoch.
- Phase 2 (publishing the ATX): before deadline was `nextPoetRoundStart`, with the intention to publish the ATX and have enough time left to register for the next PoET round. This is a very short window (just the time between the end of one PoET round and the start of the next one). If the node doesn't manage to generate a PoST proof within that time it gives up on publishing an ATX and misses out on rewards it could get by instead giving up on registering on the next PoET round. This deadline was also extended to the end of the `PublishEpoch`.

## Test Plan
existing tests pass or have been adapted

## TODO
<!-- This section should be removed when all items are complete -->
- [x] Explain motivation or link existing issue(s)
- [x] Test changes and document test plan
- [x] Update documentation as needed

## DevOps Notes
<!-- Please uncheck these items as applicable to make DevOps aware of changes that may affect releases -->
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
@bors
Copy link

bors bot commented Aug 23, 2023

Pull request successfully merged into develop.

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot changed the title Give NiPoSTBuilder more time to create the PoST [Merged by Bors] - Give NiPoSTBuilder more time to create the PoST Aug 23, 2023
@bors bors bot closed this Aug 23, 2023
@bors bors bot deleted the 4797-fix-atx-timeouts-in-builder branch August 23, 2023 18:08
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.

Make sure that AtxBuilder continues to build an ATX even if missed next poet round
3 participants