Skip to content

Conversation

@AlgoStephenAkiki
Copy link
Contributor

@AlgoStephenAkiki AlgoStephenAkiki commented Sep 20, 2021

Summary

Resolves #2738

Adds the following:

  • consensus.go: Adds the default MaxExpiredAccountsToProcess value for
    the new consensus protocol
  • block.go: Adds necessary block header entries
  • eval.go: Scans for expired accounts, modifies them to be offline and adds
    validation for this use case
  • eval_test.go: Basic unit tests
  • participationExpiration_test.go: Added e2e tests that verify that
    different consensus protocols behave differently

Test Plan

Unit test and e2e tests added

@tsachiherman
Copy link
Contributor

Please update the PR's Summary and Test Plan.

@codecov-commenter
Copy link

codecov-commenter commented Sep 20, 2021

Codecov Report

Merging #2924 (6eef8b5) into master (f17f73e) will decrease coverage by 0.07%.
The diff coverage is 49.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2924      +/-   ##
==========================================
- Coverage   47.63%   47.55%   -0.08%     
==========================================
  Files         359      359              
  Lines       57964    58406     +442     
==========================================
+ Hits        27611    27775     +164     
- Misses      27231    27458     +227     
- Partials     3122     3173      +51     
Impacted Files Coverage Δ
data/basics/userBalance.go 19.54% <0.00%> (-1.45%) ⬇️
data/bookkeeping/block.go 50.18% <ø> (ø)
data/bookkeeping/msgp_gen.go 42.55% <45.63%> (-1.60%) ⬇️
agreement/msgp_gen.go 41.23% <49.85%> (-0.62%) ⬇️
ledger/eval.go 78.98% <89.65%> (+1.17%) ⬆️
config/consensus.go 84.64% <100.00%> (+0.10%) ⬆️
agreement/cryptoVerifier.go 75.73% <0.00%> (-2.21%) ⬇️
agreement/proposalManager.go 96.07% <0.00%> (-1.97%) ⬇️
network/requestTracker.go 70.25% <0.00%> (-0.87%) ⬇️
network/wsPeer.go 75.20% <0.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f17f73e...6eef8b5. Read the comment docs.

Copy link
Contributor

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

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

Overall looks good - I've had few requests, some are just code-style, some are more around compatibility with other PRs.

Copy link
Contributor

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

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

given that you've modified the encoding of the block header, you'll need to regenerate the msgp in order to make it persistent; use make msgp to regenerate all the auto-gen msgp encoders/decoders.

Copy link
Contributor

@tsachiherman tsachiherman left a comment

Choose a reason for hiding this comment

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

The test you've added at TestExpiredAccountGeneration is good - but we would need more extensive unit testing. In practice, you change would affect the GenerateBlock(), eval() and EvalForIndexer. For each one of these, we need to make sure that the code changes produce their expected output;
as a generic guideline, each of the if-statements that you've included in your PR need to be tested for both success and failure.

Resolves #2738

Adds the following:

- consensus.go: Adds the default MaxExpiredAccountsToProcess value for
  the new consensus protocol
- block.go: Adds necessary block header entries
- eval.go: Scans for expired accounts, modifies them to be offline and adds
  validation for this use case
- eval_test.go: Basic unit tests
- participationExpiration_test.go: Added e2e tests that verify that
  different consensus protocols behave differently
@tsachiherman tsachiherman merged commit c59326f into algorand:master Oct 7, 2021
cce pushed a commit to cce/go-algorand that referenced this pull request Oct 28, 2021
## Summary

Resolves algorand#2738

Adds the following:

- consensus.go: Adds the default MaxExpiredAccountsToProcess value for
  the new consensus protocol
- block.go: Adds necessary block header entries
- eval.go: Scans for expired accounts, modifies them to be offline and adds
  validation for this use case
- eval_test.go: Basic unit tests
- participationExpiration_test.go: Added e2e tests that verify that
  different consensus protocols behave differently

## Test Plan

Unit test and e2e tests added
@egieseke egieseke mentioned this pull request Nov 23, 2021
tsachiherman added a commit that referenced this pull request Feb 10, 2022
## Summary

Create an update path that would enable the following features:
1. Batch Verification (#3031)
2. State Proof Keys (#2990)
3. TEAL 6 (#3397)
4. Expired Participation Keys (#2924)
5. Fix rewards calculation bug (#3403)

## Test Plan

Unit tests added.
tsachiherman added a commit that referenced this pull request Feb 17, 2022
## Summary

Clear out AccountData.StateProofID when ClearOnlineState() is called, by resetExpiredOnlineAccountsParticipationKeys (as part of #2924)

## Test Plan

Updated TestExpiredAccountGeneration to generate random online account data, so that it fails without this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clearing Expired Participation Keys

4 participants