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] - Verify self-generated POST proofs to catch errors early #4721

Closed
wants to merge 5 commits into from

Conversation

poszu
Copy link
Contributor

@poszu poszu commented Jul 18, 2023

Motivation

Currently, if a node generated invalid POST proof (possibly because it has invalid POST data), it will learn it after Poet round ended (2 weeks) - upon publishing the ATX. It's suboptimal, we can check the proof right after it was created to give the operator more time to react.

Changes

Verify the generated POST proofs immediately after they are created.

Test Plan

  • UT
  • system test
  • manual test joining the mainnet

@@ -211,6 +212,7 @@ func (b *Builder) StartSmeshing(coinbase types.Address, opts PostSetupOpts) erro
return nil
case err != nil:
b.log.Panic("initialization failed: %v", err)
return err
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: this is only needed to pass the unit test that mocks log.Panic... (and doesn't actually panic, allowing the code to proceed)

activation/post.go Outdated Show resolved Hide resolved
activation/activation.go Outdated Show resolved Hide resolved
activation/activation_test.go Outdated Show resolved Hide resolved
activation/post.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Merging #4721 (2daac62) into develop (c40a4ab) will increase coverage by 0.0%.
The diff coverage is 59.7%.

@@           Coverage Diff           @@
##           develop   #4721   +/-   ##
=======================================
  Coverage     77.3%   77.3%           
=======================================
  Files          255     255           
  Lines        28724   28784   +60     
=======================================
+ Hits         22207   22257   +50     
- Misses        5132    5141    +9     
- Partials      1385    1386    +1     
Impacted Files Coverage Δ
events/events.go 93.4% <0.0%> (-4.5%) ⬇️
activation/activation.go 77.8% <58.0%> (-1.3%) ⬇️
activation/nipost.go 85.3% <74.0%> (-1.1%) ⬇️
node/node.go 65.6% <100.0%> (+<0.1%) ⬆️

... and 5 files with indirect coverage changes

activation/activation.go Outdated Show resolved Hide resolved
Copy link
Member

@fasmat fasmat left a comment

Choose a reason for hiding this comment

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

❤️ LGTM

@poszu
Copy link
Contributor Author

poszu commented Jul 18, 2023

bors merge

bors bot pushed a commit that referenced this pull request Jul 18, 2023
## Motivation
Currently, if a node generated invalid POST proof (possibly because it has invalid POST data), it will learn it after Poet round ended (2 weeks) - upon publishing the ATX. It's suboptimal, we can check the proof right after it was created to give the operator more time to react.

## Changes
Verify the generated POST proofs immediately after they are created.

## Test Plan
- UT
- system test
- [x] manual test joining the mainnet
@bors
Copy link

bors bot commented Jul 18, 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 Verify self-generated POST proofs to catch errors early [Merged by Bors] - Verify self-generated POST proofs to catch errors early Jul 18, 2023
@bors bors bot closed this Jul 18, 2023
@bors bors bot deleted the verify-self-generated-post-proofs branch July 18, 2023 16:52
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.

None yet

3 participants